Commit Graph
120 Commits
Author SHA1 Message Date
Joshen Lim 656a2dcbd8 Fix horizontal scrolling in table editor when no rows present (#35526) 2025-05-07 15:11:05 -02:30
Jonathan Summers-MuirandAlaister Young 62d00873c5 Feat/sort via column header (#35139)
* init

* update Popovers to use new hooks

* init

* Update SortPopover.tsx

* Update Header.tsx

* made primitive components for filter and sorts

* Delete FilterPopoverWrapper.tsx

* Delete SortPopoverWrapper.tsx

* remove

* Create README.md

* Update README.md

* fix sort popover issues

* Update SupabaseGrid.tsx

* move DeleteConfirmationDialogs into context

* fix issue with

* more stuff for alaister

* fix ts and tables pages

* Update ColumnMenu.tsx

* Update Header.tsx

* Update useTableSort.ts

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-05-05 21:51:33 +08:00
Joshen Lim 380a9cbef3 Fix reading filters from URL in Pagination (#35464) 2025-05-05 18:20:07 +08:00
21bbc93afa Chore/table editor filter sorts logic moved to hooks (#35138)
* init

* update Popovers to use new hooks

* Update Header.tsx

* made primitive components for filter and sorts

* Delete FilterPopoverWrapper.tsx

* Delete SortPopoverWrapper.tsx

* remove

* Create README.md

* Update README.md

* fix sort popover issues

* Update SupabaseGrid.tsx

* move DeleteConfirmationDialogs into context

* fix issue with

* more stuff for alaister

* fix ts and tables pages

* First round of clean up

* Update README.md

* Smol fix

* Fix issues identified

* Smol fix

* Fix updating table name in database/tables not invalidating

* Improve SQL editor invalidation logic

* Add fix to reopen last opened table when landing on table editor

* Smol fix

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-30 14:19:21 +08:00
Joshen Lim 58a9db9db5 Chore/fix searching in table editor clearing tabs (#35198)
* Fix searching in table editor clears tabs

* Clean

* clean

* Make close button slightly bigger
2025-04-22 17:33:21 +07:00
Joshen Lim 8f64345725 Table Editor: Shift loading, error and empty states outside of DataGrid (#35031) 2025-04-16 19:09:09 +08:00
Joshen Lim a4d5af48c8 Downgrade and fix radix dialog version to 1.0.5, and remove unnecessary modal props from all usages of DropdownMenu (#35027)
* Downgrade and fix radix dialog version to 1.0.5, and remove unnecessary modal props from all usages of DropdownMenu

* Downgrade and fix radix dialog version to 1.0.5, and remove unnecessary modal props from all usages of DropdownMenu

* Fix PopoverPOrtal

* Fix
2025-04-15 17:29:32 +08:00
Jonathan Summers-Muir f79f1d0073 Fix/safari browser rendering Popover in grid header (#35024)
* fix: adds `portal` to force content popover into body

* update comments

* more
2025-04-15 10:53:40 +08:00
Alaister Young af462c0e57 chore: refactor role impersonation (#34827)
* chore: refactor role impersonation

* fix: handle undefined claims in role impersonation SQL generation
2025-04-11 08:17:13 +00:00
Jordi Enric a5b626b7bc Fix filters and sort not added to query in table editor (#34862)
fix filters and sort not added to query in table editor
2025-04-09 14:08:44 +02:00
Jordi EnricandJoshen Lim 1d4c0af295 Table Editor filters: Add backwards compatible filter parser (#34796)
* add custom parser

* pass old params to setParams

* refactor all this bullshit code to something simpler, add tests

* rm consolelogs

* Address feedback

* fix and rename

* solve conflict

* add testing lib hooks dep

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-08 15:46:11 +02:00
Joshen Lim d25451efe5 Remove useKeyboardShortcuts in Results.tsx (#34733)
* Remove useKeyboardShortcuts in Results.tsx

* Remove Cmd C overrides in table editor

* Refactor onCellKeydown to a common utils, and add check for ctrlKey
2025-04-04 18:50:02 +08:00
Alaister Young 98c7cbff4d fix: disallow edit row on protected schemas (#34692)
* fix: edit row on protected schemas

* disable editing on side panel editor

* allow viewing of json and text
2025-04-03 10:57:14 +00:00
Joshen Lim 06091157d9 Table editor filter convert empty string value to null if column is not text based type (#34674) 2025-04-03 15:46:29 +08:00
143f49414b Feat/tabs (#31071)
* init

* Update inner-side-menu.mdx

* chore: update SQL sidebar to use ui pattern components

* mor

* Update

* Update index.tsx

* init: merge table editor and sql editor and schema visualization together

* more

* move to valtio

* fix issue with Command+B shortcut

* now shows in treeviews if item is opened in tab

* Update ProjectLayout.tsx

* fix sidebar

* fix schema selector for non explorer version

* show schema name in tabs

* added schema names to tabs

* tabs have been updated to support preview tabs

* fix URL issue

* add empty state stuff

* Update SQLEditorNav.tsx

* preview tab works now

* more tabs stuff. 'new' tab also added

* new tab concept

* updates

* fix type errors

* remove unused files

* update test

* move back button, fix width issues on sidebar

* update sidebar logic

* Update ProjectLayout.tsx

* lots of updates. layouts now streamlined. localstorage for tabs in use

* moar

* bunch of new tab logic

* fix empty tab issue

* Update tabs.ts

* layouts switched

* new pages now have fixed layouts

* fix tabs

* fix code bg

* add tabs support for multiple project refs

* intialization issue

* update ID handling

* fixed isOpened state for SQL snippets

* remove old assistant because its bugging up panels

* preview style works in sql editor

* fix border

* removes preview tab if there is one

* fix background of loading skeleton

* lots of issues with types/icons/redirect

* new tab cards

* snippets in empty state now work

* moar stuff

* tabs now in feature flags

* Update tabs.ts

* Update tabs.ts

* moar

* add feature previews

* remove code not needed

* Update next-env.d.ts

* Delete FeaturePreviewModal.tsx

* fix typescript errors. remove more explorer stuff

* remove explorer files

* fixed issues with templates and quickstarts tab

* fixed active state when tabs are not opted in

* logic error

* fix open/highlight issue when opted out of tabs

* templates/quickstarts now displayed with new cards

* Update recent-items.tsx

* Update new-tab.tsx

* add icon back in

* add old empty state back in

* recent items updated to respect project ref

* localstorage cleanup on deletion

* moar

* overflow tabs now working

* correct tab names used for new sql templates/quickstarts

* ongoing queries fix

* cleanup

* update images

* Update RouteValidationWrapper.tsx

* Update AppLayout.tsx

* Update NavigationBar.tsx

* add headers back into side panels

* improve writing

* tabs now drag and drop a billion times better

* Update tabs.tsx

* Update tabs.tsx

* init issues on stores, which caused a race condition.

* fix hydration error

* fix new tab issue in sql

* Update ProjectLayout.tsx

* Update pnpm-lock.yaml

* Update new-tab.tsx

* move EditorMenuListSkeleton

* Fix type issues

* fixes: DESIGN-87

fixes: DESIGN-87

* refactor sort/filter components

* Update rules-set-button-text.tsx

* remove discussions for now

* small styling fixes

* Update FeaturePreviewModal.tsx

* Update FeaturePreviewModal.tsx

* Update RouteValidationWrapper.tsx

* revert

* revert

* revert

* revert

* revert

* more revert

* Update collapse-button.tsx

* Update SQLEditorTreeViewItem.tsx

* revert

* Update SchemaGraph.tsx

* Delete new-upcoming.tsx

* revert

* Update ProjectLayout.tsx

* fix home link

* Update table-editor.spec.ts

* test update

* Update table-editor.spec.ts

* Fix the playwright tests.

* layout fixes

* layout fix

* revert sort/filter

* Update LastSignInWrapper.tsx

* revert

* revert

* remove

* update file names

* revert

* revert

* revert

* Fix TreeView console error props

* Add guards in SQL Editor to ensure that feature preview tabs changes do not affect existing UI when flag is off

* Fix missing DefaultLayout in SQL editor templates + fix New tab

* Remove console log

* Remove DatabaseSelector for SQL editor on local

* Fix SQL editor shared favorites for local

* Fix test

* Ensure NewTab doesn't show up if flag is not toggled for SQL editor

* Decouple UI state changes from content-query and entity-types-infinite-query

* Fix tab closing unnecessary rerouting

* Beef up feature previews

* Fix create new table from table editor new tab

* Fix tabs getting incorrectly reset when going between table and SQL editors

* Fix last visited SQL snippet for both tabs and not tabs

* Fix last visited table for table editor tabs

* Clear dashboard history when closing last tab

* Fix loading dashboard history

* Add comment to refactor stores

* Ensure we only save up to 8 items for recent items for each type

* Remove unneccesary logic in tabs

* Smol style fix for DeleteAccountButton

* Smol fix

* Fix inability to close New tab

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-27 17:46:57 +08:00
Andrew Valleteau 23aec2190d fix(studio): update table-query-rows generated sql for truncation (#34237)
* chore(studio): move Query to pgMeta add tests

- Move the Query builder from studio to pgMeta
- Add e2e tests over the generated sql to ensure syntax and runtime
  result over pg database
- fix bug with orde by for table with undefined column

* chore: add table-row-query to pgMeta and tests

* chore: fix query import path

* chore: reduce maxArraySize

* chore: use pg-meta getTableRowsSql implementation in studio

* chore: add truncation on large array fields

* chore: set ES target for lint

* chore: update comment

* chore: reduce test size for CI
2025-03-25 16:51:55 +01:00
Alaister YoungandJoshen Lim 8fd6c9276d chore: remove react-tracked part 2 (#34153)
* chore: remove react-tracked part 1

* move out table specific state to own store

* chore: remove react-tracked part 2

* remove unused type

* ensure table is properly updated on changes

* remove all filters save in local storage

* Tiny fixes

* fix sort / filters applying issue + feedback

* fix entity links

* remove unnecessary style

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-03-24 21:11:11 +08:00
Andrew Valleteau eb7efdef7f chore(studio): move Query to pgMeta add tests (#34232)
* chore(studio): move Query to pgMeta add tests

- Move the Query builder from studio to pgMeta
- Add e2e tests over the generated sql to ensure syntax and runtime
  result over pg database
- fix bug with orde by for table with undefined column

* chore: fix query import path

* chore: set ES target for lint

* chore: add github action for pg-meta test package

* chore: add tsconfig to sparse checkout
2025-03-20 19:04:58 +00:00
2a4c6c38ad Fix/table editor export (#33906)
* Fix table editor export

* Types

* Fix return

* Fix pagination

* Formatting

* Throw instead of returning []

* Add progress bar for exporting all rows in table editor

* Add error handling

* Cleanup toast

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-03-19 10:38:15 -02:30
Alaister Young 8dada9fd52 chore: remove react-tracked part 1 (#34020)
* chore: remove react-tracked part 1

* move out table specific state to own store
2025-03-12 23:42:00 +08:00
Ivan Vasilov 4bb36de27b Fix: Fix the set null button when the value is empty (#34102)
Fix the set null button when the value is empty.
2025-03-10 16:12:56 +01:00
Long Hoang 69726689c9 chore: remove event enums (#33730)
* chore: remove event enums

* chore: remove more event enums

* chore: remove unused HomepageHeroRequestDemoClickedEvent

* chore: remove unused HomepageHeroRequestDemoClickedEvent

* chore: rename custom_report events to use underscores

* chore: remove telemetry enum

* chore: remove unused imports

* chore: remove enums from merged events

* chore: remove unused imports

* chore: add typedocs for module and hide exported types that are not events
2025-02-25 13:08:31 +08:00
Terry Sutton 41715714f4 Chore/column dropdown bug (#33776)
Fix the blasted column dropdown bug
2025-02-23 22:07:05 -03:30
Joshen Lim d81832c549 Check for value before converting bytea to hex in ForeignKeyFormatter (#33355)
minor fix
2025-02-05 21:44:04 +08:00
Joshen Lim f64b747e24 Support bytea data type in table editor (#33312)
* Support bytea data type in table editor

* Fix rendering bytea in reference record peek

* More fixes
2025-02-05 16:49:21 +08:00
Joshen Lim a7f872dd4e Set stale time for users infinite query on auth/users to infinite (#33308) 2025-02-04 19:53:35 +08:00
Joshen Lim 63d3627d7f Use portal for reference record peek (#33294)
* Use portal for reference record peek

* Lint
2025-02-04 17:10:17 +08:00
Pamela ChiaandJoshen Lim b6cefe5c25 Feat/add studio events (#33148)
* add tracking for help, feedback, import data, and example clicked

* clarify www pricing plan and add run sql query event

* add pricing plan cta tracking

* Add one more event to Import data from CSV

* Consistent copy

* Clean up and refactors

* Some fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-02-03 20:08:30 +08:00
Joshen Lim dbafc765ba Support peeking referencing record from table editor (#33141)
* Support peeking referencing record from table editor

* Clean up
2025-01-29 11:43:28 +08: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
Ivan Vasilov 8aa5523fcc chore: Migrate tooltips in studio to use shadcn tooltips (#32679)
* Remove radix-popover and radix-tooltip as deps from studio.

* Migrate all uses of tooltip to shadcn tooltips.

* Add tooltip portal to all shadcn tooltips.

* Fix a warning about MenuItem not accepting refs in StorageMenu.

* Remove unneeded styling for the tooltips.

* Set a default delay duration for all tooltips in Studio.

* Fix a type error.

* Check and fix all tooltips.
2025-01-17 10:54:02 +01:00
Terry SuttonandJoshen Lim 44d3204b2f Chore/fix set to now (#32749)
* Reuse set to now logic

* Ensure set to now cta is visible if column is not nullable

* Minor refactor

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-01-14 11:21:35 -03:30
Alex MotocandAlaister Young 364f001e68 fix: update json editor initial value formatting (#30990) (#32513)
* fix: update json editor initial value formatting (#30990)

* update logic to stringify initialValue before formatting

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-01-02 12:06:34 +08:00
hawkcookie 50f9ccb5c7 fix: fix horizontal scroll reset when clicking timestamp cells on the Dashboard (#31624)
* add preventScroll option to ref.current.focus

* add ref props to Input component and remove autoFocus props
2024-12-27 15:45:12 +00:00
Joshen LimandIvan Vasilov 97d83e7aa9 Update grid cell editor for date and timestamp type fields (#31121)
* Update grid cell editor for date and timestamp type fields

* Forgot to commit this

* Add basic validation

* Remove console log

* Add placeholder

* Add Set to NOW action

* Pass isNullable to the DatetimeEditor.

* Fix the TooltipTrigger to deduplicate classes. Fix the TimestampInfo to use TooltipTrigger as child.

* Fix the height of the spans to match.

* Fix

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-12-18 12:55:53 +08:00
Alaister Young 398b3eec68 fix: oid types in text editor (#30784) 2024-12-02 18:18:59 +08:00
Kevin Grüneberg 2a5072d722 chore: replace Markdown component in some generic studio components (#30666)
We no longer want to use Markdown when not necessary. I checked the props for these components and we were only passing in a regular text without any actual markdown
2024-11-26 19:56:50 +08:00
Alaister Young 0e3bc5804b chore: remove useExecuteSqlQuery (part 1) (#30437)
* chore: remove useExecuteSqlQuery part 1

* fix invalidation

* fixes

* more fixes

* I fixed it, but tested on preview instead of local 🤦🏻

* only refetch table rows and not count on row updates

* removed unneeded invalidations and prefetched new table after create
2024-11-14 15:21:29 +08:00
Jordi Enric aad6c48d03 remove debugger (#30440)
rm debugger
2024-11-13 11:32:07 +08:00
Joshen Lim 1f2f431b59 Remove clsx library from dashboard (#30311)
* Remove clsx library from dashboard

* PRETTY
2024-11-07 18:45:18 +08:00
a5a2873302 chore: table editor optimisation 2 (#30295)
* chore: table editor query optimisation 2

* fix editing tables from tables page

* Small style fixes

* Small style fixes

* address feedback

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-06 08:31:35 +00:00
Terry Sutton cbfef7ec77 Chore/allow export from non editable tables (#30310)
Allow exporting from non-editable tables
2024-11-06 11:55:20 +08:00
Terry SuttonandJoshen Lim 7c28989d83 Chore/table header simplification (#29963)
* Simplify table header

* Show gridHeaderActions only when no selections in table

* Small refactors

* Rearrange buttons

* Small refactor

* Remove unnecessary parent div

* Tiny style fix

* Tiiiiny

* Fix indeterminate state fill

* Refactor one more button tooltip

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-05 12:16:36 -03:30
Joshen LimandJonathan Summers-Muir 6836199e8e Fix https://supabase.sentry.io/issues/6037628167/ (#30258)
* Fix https://supabase.sentry.io/issues/6037628167/

* Fix https://supabase.sentry.io/issues/6037624935

* Clean up ColumnForeignKey

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-11-05 15:42:24 +08:00
Joshen LimandTerry Sutton 2c8a09a313 Fix missing enforceExactcount param (#30097)
* Fix missing enforceExactcount param

* Update apps/studio/components/grid/components/header/Header.tsx

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-11-01 21:36:57 +08:00
Alaister YoungandJoshen Lim 3a27070dc2 chore(perf): table editor query optimisation (#30184)
* chore: table editor query optimisation

* removed unused queries and fix invalidations

* address feedback

* fix filtering for foreign tables

* Update

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-10-31 15:20:40 +08:00
Alaister YoungandJoshen Lim 5781937739 chore: aggressive prefetching (#29987)
* chore: aggressive prefetching

* use abort signals in prefetchers

* move encrypted columns to react-query

* prefetching for filter and sort applied

* prefetch remaining entity types

* prefetch tables in more places

* prefetch editor page on project panel

* add feature flag

* fix typescript

* nit

* Nit

* fix imports

* remove views check on encrypted schemas

* use fetchQuery instead of prefetchQuery

* fix useEncryptedColumnsQuery ts error

* filter by schema on encrypted columns

* don't use pg_get_tabledef for foreign tables

* Remove unnecesary import

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-10-24 20:59:35 +08:00
Joshen Lim d586346e27 Chore/sentry fixes 211024 (#30003)
* Resolve https://supabase.sentry.io/issues/5808689343

* Fix SecurityStatus map key prop issue

* Fix FileExplorerHeader to use ButtonTooltip

* Fix https://supabase.sentry.io/issues/5998687405

* Fix https://supabase.sentry.io/issues/5414129652

* Fix https://supabase.sentry.io/issues/5414129652

* Fix map key issue in QueryPerformanceGrid

* Add whitelist error for sign up mutation

* Fix map key in DiskUsage

* Fix prop name in info-tooltip
2024-10-22 15:21:06 +08:00
Alaister Young 90072a2608 chore: improve table grid loading skeleton (#29734)
* chore: improve table grid loading skeleton

* nudge by 1px

* attempt syncing shimmers
2024-10-08 16:00:15 +08:00
Joshen Lim c2608f837d Chore/improvements to datetime editing in table editor (#29660)
* Auto open date time picker, add set to null CTA for nullable date time fields

* Add dropdown option instead

* Small fix

* Add docs Url for database functions and triggers, fix space-x-2 in database/tables

* Some fixes
2024-10-04 09:55:04 +08:00