Commit Graph

48 Commits

Author SHA1 Message Date
Joshen Lim
09c6f0aa2c DropdownMenu component modal prop default to false, but allow passing prop value (#34846)
* DropdownMenu component modal prop default to false, but allow passing prop value

* Smol fix for advisor
2025-04-09 13:59:57 +08:00
Terry Sutton
28c1c213eb Fix modal locking up page (#34837) 2025-04-08 22:35:36 +02:00
Saxon Fletcher
58272034b1 Multiple assistant chats (#34011)
* add assistant chats

* refactoring

* refactor

* refactor to use onfinish

* fix ts

* dependencies removal

* Update useAssistant.ts

* ts

* refactor useAssistant hook to valtio store

* Minor tweaks

* Add name param to newChat, and add names to each call of newChat

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-03-28 16:36:41 +08:00
Saxon Fletcher
ecaba079be fix duplicate policy name (#34316)
* fix duplicate policy name

* style
2025-03-21 11:28:36 +08:00
Saxon Fletcher
2d48ba3314 Click function/trigger/policy to edit (#34172)
click to edit
2025-03-13 20:49:33 +10:00
Ivan Vasilov
52735e38bf chore: Rename all uses of Tooltip_Shadcn_ to just Tooltip (#32860)
* Rename all uses of Tooltip_Shadcn_ to just Tooltip.

* Fix a leftover change.
2025-01-20 22:23:45 +01:00
Francesco Sansalvadore
ecd181bcd9 studio mobile v2 (#32630)
* improve some studio mobile layouts

* improve some studio mobile layouts

* improve settings

* assistant mobile

* assistant mobile

* assistant mobile

* responsive formlayout and new project layout

* improve dashboard pages headers

* improve dashboard auth pages

* mobile org settings

* mobile billing fixes

* adjust paused project container height

* remove comments

* triggers

* leftovers

* ai assistant

* fix errors

* remove 16px input size

* fix test

* merge access tokens settings page conflicsts

* smol integrations here and there
2025-01-17 19:07:35 +01:00
Joshen Lim
d88cb12794 Remove assistant V2 from feature preview (#30779)
* Remove assistant V2 from feature preview

* Hide fix with assistant button in rls editor
2024-12-02 22:03:31 +08:00
Saxon Fletcher
8c3da2ed95 More assistant refinements (#30730)
* ai refinements

* ui fixes

* space

* reduce dot height

* Fix prop type issue

* Assign allowHoverEffect to ai assistant button and panel

* Lint

* Some lints

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-29 20:31:02 +10:00
Joshen Lim
d8a57c1c7e Add settings for queues: toggle expose through postgrest + permissions via table privileges (#30564)
* Add settings for queues: toggle expose through postgrest + permissions via table privileges

* Ensure appropriate grants are granted when toggling, and revoked when disabling

* Update to use queues_public schema

* Update queue schema to pgmq_public and add/remove from data api when enabling/disabling

* Fix query for retrieving toggle state

* Add schema invalidation

* Remove hard code

* Use QueuesSettings from Queues folder, remove from NewQueues

* Update SQL for toggling exposure + support RLS enabling

* Support toggling RLS for a queue

* Update admonition copy in queues for enabling/disable postgrest exposure

* Add custom RLS policy for queue

* Minor style fixes

* Fix

* Remove hard code

* Update RLS to add message regarding relevancy only if exposure to PostgREST is enabled

* Update message in exposing queues to postgREST

* Address feedback

* Address feedback

* Don't revoke postgres role stuff

* Remove hard code

* Update copy

* Update

* Address Oli's feedback, ensure that queues ALL have RLS enabled prior to allowing exposure to PostgREST

* Address remaining feedback

* Remove hardcode

* Update

* Address feedback
2024-11-27 12:10:33 +08:00
Joshen Lim
12d92aed99 Assistant V2 (#30523)
* start

* added panels

* remove stuff

* fixes and refinements

* clean up

* remove old assistant panel

* resizable assistant kinda

* use icon

* Add missing package

* remove canvas

* add suggestions

* updated empty state if no tables exist

* fix table condition

* Implement diffing if using assistant in sql editor

* Reinstate old assistant in SQL editor if feature preview is off

* pane size adjustment

* assistant button corners

* Add SQL snippet content to assistant if opening assistant in sql editor

* Add the necessary checks for opt in and hipaa

* revert adding snippet to assistant when opening assistant in sql editor

* Add cmd i shortcut

* Add admonitions for when disablePrompt is toggled on, and if no api key is set. Add footer note RE rate limitation

* Bump ai package in packages

* some fixes for backwards compability depending on feature preview toggled

* Rename feature preview property for new assistant

* Smol fix

* Prevent SQL snippet from running until message is finished

* only loading last message

* fix z-index

* save chat state to global state

* add debug to failed ai queries

* Add basic contextual invalidation

* Add explain code action to SQL editor

* Add link to abort ongoing queries from SqlSnippet

* Update feature preview content

* Fix

* Fix

* Fix

* Te4st

* Fix tests

* ONly show ai button within a project

* Fix PH tracking

* Beef up a bit more event tracking

* Rough fix to padding when assistant is open

* A bit more telemetry stuff

* Update prompts

* fix rls editing via assistant

* Update generate-v3.ts

prompt to get auth schema too

* Add policy satement to assistant when editing

* Address all comments

* fixc

* Fix SqlSnippet not taking full width on larger viewports

* Adjust max width

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
2024-11-25 18:50:56 +08:00
Joshen Lim
225d461381 Hook up RLS to new assistant if feature flag is enabled (#30357)
* Hook up RLS to new assistant if feature flag is enabled

* Reset conversation if opening a different entity

* Add prompt to use alter policy if policy definition is provided

* Remove console log
2024-11-08 18:03:30 +08:00
Joshen Lim
01e81fd400 Chore/assistant tweaks 281024 (#30134)
* Add alpha notice

* Close assistant via cmd i if not focused on monaco

* Add edit with assistant CTA for database functions

* Attach existing function definition when editing a function to prompt

* Leave comments

* Small refactor
2024-10-29 15:10:00 +08:00
Joshen Lim
3a3360bbd0 Fix all usage of button tooltip (#30076)
* Fix all usage of button tooltip

* PRETTY
2024-10-24 13:32:47 +00:00
Joshen Lim
f521109ce2 Chore/database functions v2 (#29969)
* Init AiAssistantPanel

* Temp

* Temp

* iterating on assistant ux

* More spiking

* Tweaking...

* Moar tweaking..

* Even more tweaking

* Tweek

* More tweaks

* Final tweaking...

* TWEAK

* Spelling

* Fix

* Assistant error handling and small bug fix in context for message

* Add feature flag

* Fix

* Address all feedback

* Minor
2024-10-23 16:43:38 +08:00
Jordi Enric
3fa447d57d fix layouts and make sure buttons are visible in smol screens (#28939)
* improve table editor headers

* sql editor horizontal scroll auto in headers

* fix headers in tablelist

* fix headers in db roles

* fix database functions in smol screens

* fix table list headers

* fix trigger lists table

* fix enum types headers

* Update Extensions component styling with flex-wrap

* Update Indexes component UI layout and styling

* fix publications table

* move sql editor pagination tobottom

* rm unused imports, add correct label to db selector

* fix layout shift in run button

* add tooltip to results limitter

* make header in sql editor results scrollable

* Fix Button tooltip and table header formatting for database/tables/[id] ColumnList

* Fix SQL editor footer disappearing with resizable panel

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-09-02 16:46:19 +07:00
Ivan Vasilov
df52ea7ee0 feat: Replace all toasts with sonner (#28250)
* Update the design of the sonner toasts. Add the close button by default.

* Migrate studio and www apps to use the SonnerToaster.

* Migrate all toasts from studio.

* Migrate all leftover toasts in studio.

* Add a new toast component with progress. Use it in studio.

* Migrate the design-system app.

* Refactor the consent toast to use sonner.

* Switch docs to use the new sonner toasts.

* Remove toast examples from the design-system app.

* Remove all toast-related components and old code.

* Fix the progress bar in the toast progress component. Also make the bottom components vertically centered.

* Fix the width of the toast progress.

* Use text-foreground-lighter instead of muted for ToastProgress text

* Rename ToastProgress to SonnerProgress.

* Shorten the text in sonner progress.

* Use the correct classes for the close button. Add a const var for the default toast duration. Remove the custom width class from sonner.

* Set the position for all progress toasts to bottom right. Set the duration for all toasts to the default (when reusing a toast id from loading/progress toast, the duration is set to infinity).

* Fix the playwright tests.

* Refactor imports to use ui instead of @ui.

* Change all imports of react-hot-toast with sonner. These components were merged since the last commit to this branch.

* Remove react-hot-toast lib.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-08-31 07:50:51 +08:00
Ivan Vasilov
8c6d0f1890 feat: Save the selected schema in the URL and local storage (#28662)
* Add nuqs package.

* Add useSchemaQueryState hook.

* Use the new hook in all places where there's is a schema selector.

* Make the useQueryState work with SSR in playwright.

* Fix the saving to local storage to happen as a side effect without any additional rerenders.
2024-08-19 13:28:25 +02:00
Joshen Lim
6a265a3289 Chore/fix autodocs stored procedure menu (#28385)
* Fix highlighted state in nav bar for V1 auto docs when selecting a store procedure

* Fix RPC parameters in V2 auto docs

* Replace database functions create function button cta with ButtonTooltip
2024-08-05 17:11:17 +08:00
Joshen Lim
2662583d7e Add placeholder in database functions editor (#27922)
* Add placeholder in database functions editor

* Address feedback

* Don't show placeholder if language is sql

* Fixes

* Fix
2024-07-15 14:23:59 +08:00
Monica Khoury
cb9eff3c0c Fix: convertArgumentTypes parsing bug (#27800)
* Fix: convertArgumentTypes parsing bug

* Fix typecheck error
2024-07-04 12:13:12 -02:30
Alaister Young
70da0f1d1d chore: cleanup packages (#27770)
* chore: cleanup packages

- Avoid circular imports
- Export API-types as types
- pg-format without depending on Node internal Buffer (not browser-compatible)
- Avoid importing from barrel files in ui dir

* chore: avoid barrel file imports in studio (#27771)

* chore: avoid barrel file imports

- Removes some unused imports
- Avoids barrel file import for faster builds + less memory

* add eslint rule

* type fixes

* delete layouts barrel

* delete components/grid barrel file

* delete components/grid/utils barrel file

* delete components/grid/components/common barrel file

* delete components/grid/components/editor barrel file

* delete components/grid/components/formatter barrel file

* delete components/grid/components/grid barrel file

* delete components/grid/components/header/filter barrel file

* remote components/grid/store barrel file

* remove components/interfaces/Auth/Policies barrel file

* delete components/interfaces/Settings/Logs barrel file

* delete components/ui/CodeEditor barrel file

* delete components/ui/Forms barrel file

* delete components/ui/Shimmers barrel file

* delete data/analytics barrel file

* delete hooks barrel file

* cleanup lib/common/fetch barrel file

* final * barral files cleanup

* global react-data-grid styles

* remove console.log

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>

* fix build

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-04 14:48:10 +08:00
Alaister Young
8e47d317fa chore: pg-meta functions (#26881)
* start pg-meta functions

* pg meta create function

* pg meta database functions update and delete

* fix ts

* update execute sql error type

* update execute sql error type

* remove duplicate database functions query
2024-06-03 23:21:19 +08:00
Alaister Young
155570bfa7 fix: allow sql language functions (#25986) 2024-05-10 09:48:49 -02:30
Ivan Vasilov
09c397f331 fix: Parse the function args properly when editing a DB function (#22877)
* Fix the header when editing a function.

* Parse the arguments properly.
2024-04-25 14:25:48 +02:00
A̴m̴r̴ ع̲مِےـرۅ
3c6b083787 chore: Add missing whitespaces (#23171)
* Update DeleteFunction.tsx

* Update DeleteFunction.tsx

* format

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2024-04-23 10:06:13 -04:00
Alaister Young
2bb742a38f fix: require function definition (#23151) 2024-04-23 00:02:07 +10:00
Ivan Vasilov
db2fb81ec8 feat: Add more lint rules (#22594)
* Refactor the functions page to keep its state in the URL.

* Derive the filter options from currently active lints.

* Update the lint query sql.

* Update the urls to the docs.

* Fix the paddings on the filterPopover.

* Add handling for the other types of lints.

* Comment out the ignore lint functionality.

* Fix a misspell.

* unbest

* Bring back the CTA button.

* Update the SQL code from the splinter repo.

* Add handling for the duplicate index lint rule.

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-04-11 11:50:17 +02:00
Jonathan Summers-Muir
645273cb45 Chore/update confirmation modal (#22328)
* Update confirmation modal

* update all props

* Update ExtensionCard.tsx

* clen up
2024-04-02 13:39:27 +08:00
Kevin Grüneberg
27f9f96ff7 chore: upgrade to node 20 (#22240) 2024-03-26 18:54:22 +07:00
Ivan Vasilov
221ee13f79 feat: Expandable code editor in the Create Function panel (#22000)
* Refactor and remove the CreateFunctionStore.

* Fix a duplicate key in the functions table.

* More fixes for the create-function form.

* Add excluded schemas to schema selector.

* Cleanup the createFunction code after the merge.

* Remove unneeded wrapper fragments.

* Minor fixes for the FormItemLayout stories.

* Refactor the CreateFunction panel using the new FormItemLayout.

* Revert the migration to use FormItemLayout. Will revisit later.

* Add a CSS class for popover content width to match its trigger width. Use it on the schema selector.

* Replace all listboxes with selects.

* Fix the comments.

* Switch to FormItemLayout wherever possible.

* Move the createFunction file to its own folder.

* Refactor the panel to use shadcn components: Sheet, SheetContent and SheetHeader.

* Add showClose prop to the Sheet component.

* Add function editor and a feature to maximize/minimize the code editor.

* Some fixes

* Add sameWidthAsTrigger to the popover component.

* Fix the icon size.

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-03-15 10:36:48 +01:00
Ivan Vasilov
a775e3ba69 chore: Migrate create-function store from mobx to react-hook-form (#21888)
* Refactor and remove the CreateFunctionStore.

* Fix a duplicate key in the functions table.

* More fixes for the create-function form.

* Add excluded schemas to schema selector.

* Cleanup the createFunction code after the merge.

* Remove unneeded wrapper fragments.

* Minor fixes for the FormItemLayout stories.

* Refactor the CreateFunction panel using the new FormItemLayout.

* Revert the migration to use FormItemLayout. Will revisit later.

* Add a CSS class for popover content width to match its trigger width. Use it on the schema selector.

* Replace all listboxes with selects.

* Fix the comments.

* Switch to FormItemLayout wherever possible.

* Some fixes

* minor lint

* One more lint

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-03-14 14:38:52 +08:00
Jonathan Summers-Muir
9104cbc359 Chore/add first pattern docs (#21741)
* remove un-needed stuff

* Update preview.js

* Update preview.js

* upgrade sb

* Update preview.js

* chore: main init of the confirmTextModal

* update modals

* dialog positioned fixed

* fix backdrop

* chore: overlay now wrapping DialogContent !!

* more modal updates

* fix props

* update size

* padding fixed

* Update Dialog.stories.tsx

* add padding to more Dialog stuff

* update text

* start using subcomponents in storybook

* make thinner because it's too wiiiiide

* Tiny fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-03-05 18:08:28 +08:00
Kevin Grüneberg
f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
Jonathan Summers-Muir
d8e7ecbfe5 Chore/move dialog to patterns (#21688)
* update exampleps

* move text confirm modal
2024-03-01 10:47:36 +00:00
Jonathan Summers-Muir
c4a492002b Chore/move confirmation dialogs (#21651)
* move confirmation dialogs

* Update index.tsx

* Update ExtensionCard.tsx
2024-03-01 18:16:25 +08:00
Ivan Vasilov
630eeefa93 fix: Minor papercut fixes in the studio (#21319)
* Fix small issues with the tables and keys.

* Refactor the TimezoneSelection with shadcn components.

* Dont pass active to the NavMenuItem.

* Fix the double hash in the _ page.

* Fix an error where an input received an undefined as value.

* Fix increase retention period in PITR disabled incorrectly

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-19 13:34:24 +08:00
Jonathan Summers-Muir
754ee55cd0 chore: update themes and add dark-new theme set (#20865)
* chore: update themes and add dark-new theme set

* chore: update

* add deep dark css theme

* fix issue with wrong class

* chore: add `bg-studio` as a custom remapped color for studio background

* updated surface classes to use a surface-75.

* update backgrounds and borders

* Update CardButton.tsx

* Update NavigationIconButton.tsx

* chore: add theme selection

* Update package.json

* Update index.ts

* Update package.json

* update alias

* Update ThemeSettings.tsx

* chore: split up theme support

* remove old code

* Update index.ts

* add back in

* Update ThemeSettingsOld.tsx

* fix issue with system theme leaking through

* reset themes

* update imports

* packagelock updated

* Update ThemeSettingsWithPreferredTheme.tsx

* Update system.svg

* Update NavigationIconButton.tsx

* Update NavigationBar.tsx

* update

* Update light.css

* updated some colors

* light mode updated

* hacked

* prettier

---------

Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-02-15 16:56:18 +01:00
Ivan Vasilov
4c7ff74a00 fix: Update the types in api.d.ts. (#21287)
* Update the types in api.d.ts.

* Send zero for integration id.
2024-02-15 13:01:12 +01:00
hallidayo
312da2b18a fix: functions argument truncation (#20960)
* argument truncation

* fix prettier

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-02-05 19:39:49 +11:00
Clarence
432de2fc69 chore: clean up on empty className attributes (#20203)
clean up on empty className attrib

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-01-08 05:49:28 +00:00
Kevin Grüneberg
542d984b3e chore: reduce main bundle size (#19918) 2023-12-20 17:49:15 +01:00
Terry Sutton
db3ff7b7b8 Alpha sort db functions, triggers and indexes tables (#19852)
* Alpha sort db functions, triggers and indexes tables

* Use lowercased names when sorting.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-12-19 11:53:12 +01:00
Joshen Lim
09de17cac3 Chore/deprecate functions store (#19714)
* Shift all usage of database functions from pg meta store to RQ

* Remove functions store from pg meta mobx store

* fix

* Fix

* Fixes

* fix

* Address comments
2023-12-14 15:30:26 +07:00
Joshen Lim
04c19a0d62 Chore/refactor db extensions to rq (#19622)
* Init db extensions to RQ

* Shift all extensions to RQ

* Deprecate extensions meta store

* Address comments

* Address comment

* Address comment

* Update apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

* Remove connection string check for entity-types-query and database-triggers-query

* Remove connection string checks

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2023-12-13 12:02:20 +07:00
Alaister Young
42164183f2 fix: add missing asChild props (#19456)
* fix: add missing asChild props

* move csvlink outside of dropdown trigger

* fix incorrect merge
2023-12-06 21:11:32 +11:00
Francesco Sansalvadore
be9590c890 Multiple themes management (#18871)
* set up multiple themes in studio

* set up multiple themes in studio

* set up multiple themes in docs and www

* update all resolvedTheme to also include deep-dark

* update all resolvedTheme checks to also include deep-dark

* update tailwind.config.js tokens

* update tailwind.config.js tokens

* update leftover scale12 token

* update if resolvedTheme _doesn't_ include 'dark'

* update more styling tokens

* add dynamic themes to CmdK

* fix nav and footer for multi theme

* add data-theme selector output to transformTokens.js

* update code-hike.css to target data-theme css

* update tailwindcss to ^3.3.5

* ThemeImage with light and dark src for www and docs

* add brand-button styling token

* update old dark theme boolean

* update old dark theme boolean

* make homepage product visuals themeable

* update product page themed images

* update badge green with brand

* fix roles list appearance

* fix auth widget in auth page

* update more dark logic

* update more dark logic

* add button default bg and border

* update pricing page theme styling

* clean up Themeimage

* remove forceDark in homepage

* update dark:border-dark occurrences

* update dark:border-dark occurrences

* fix dark mode base colors

* remove foreground-strong

* fix notification badge bg

* remove some dark: selectors

* update dark: selectors

* update code-hike deep dark bg color

* fix comment typo

* update border-button-hover token

* fix customer story logo

* remove some more dark: selectors

* restore forceDark in www homepage

* fix auth react icon

* fix homepage product visuals

* remove theme

* add brand-link token

* fix checkbox bg

* npm install

* more visible EntityListItem active bg

* fix --background-alternative-default css vars

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2023-11-16 16:41:53 +00:00
Ivan Vasilov
436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00