## What kind of change does this PR introduce?
Refactor, cleanup, and docs update.
## What is the current behavior?
After the page-title rollout, `ProjectLayout` is still in a transitional
state:
- it accepts a deprecated `title` prop
- it still supports a separate `browserTitle.surface`
- wrapper layouts are split between passing `title` directly and passing
`browserTitle.section`
That makes the API harder to reason about than it needs to be, even
though the rendered titles are already correct.
## What is the new behavior?
This cleanup finishes the API simplification that came out of the
stacked PR review:
- wrapper layouts stay `title`-first for DX
- `ProjectLayout` no longer accepts `title`
- `product` is now the single source of truth for the project-surface
title segment
- `browserTitle` is now only used for extra browser-title metadata
(`entity`, `section`, `override`)
- the remaining project-scoped callers now pass `browserTitle.section`
when they need a section label
- docs now reflect the final pattern instead of the transitional one
Rendered page titles stay the same.
## Additional context
Checks run:
- `pnpm --filter studio exec vitest --run lib/page-title.test.ts
components/layouts/ProjectLayout/index.test.tsx`
- `pnpm --filter studio typecheck`
- `pnpm exec prettier --check ...` on touched files
This is intended as the post-rollout cleanup PR based on Joshen's review
feedback across the stacked title changes.
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
## Context
Taking a slightly different approach to [this
PR](https://github.com/supabase/supabase/pull/43370)
Original problem was that if you opened some folders while in a bucket
and then switched to a different bucket, the folder UI will persists
(folders from Bucket A will render when landing on Bucket B)
## Changes involved
- Shift `StorageExplorerStateContextProvider` into `[bucketId].tsx]`
instead of `ProjectContext`
- The valtio store here only applies for the storage explorer so having
it so high in the project's context was unnecessary
- This also just implies that the valtio store will automatically reset
whenever the bucket changes
- Simplify storage explorer valtio store by initializing the store with
the bucket
- We'll initialize the selected bucket with the store now (Same as
previous PR)
- Removes unnecessary `setSelectedBucket` method which required a
separate `useEffect` in `StorageExplorer.tsx`
## To test
- [ ] Verify that the original is resolved
- [ ] General smoke test of the storage explorer - i've also re-added
the e2e test that Gildas wrote up in his PR
* First pass of deprecating old storage UI components
* Clean up local-storage flag for new storage UI
* Add coming soon UI for analytics and vector buckets pages
* Set up warning states for analytics buckets
* fix spelling and margin
* Smol fix
* nit
* Surface wrappers upgrade check in UI instead of toast
* Nit clean up
* update tests
---------
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
* refactor(infinite list): use @tanstack/react-virtual for virtualization
Swapping virtualization libraries from `react-window` to
`@tanstack/react-virtual`.
Motivation: we need a completely headless library for maximum
flexibility. `react-window` injects extra DOM elements which makes it
hard to customize styling and placement on elements that are very picky
about their DOM structure, like tables.
* refactor(table editor menu): use new infinite list
* refactor(notifications): use new infinite list
* cleanup(infinite list): remove old infinite list
* refactor(storage menu): use new infinite list & remove react-window deps
* fix(storage ui v2): virtualize files buckets table
* refactor(virtualized table): make virtualized table a general ui component
Make virtualized table a general UI component and refactor FilesBuckets
to use VirtualizedTable.
* Fix header bg color, add sort to files buckets, sort bucket list
* Smol fix
* nit
* fix(storage buckets list): keep unvirtualized if user has <= 50 buckets
* Break up FilesBuckets into smaller components
* Nit
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* feat(preferences): allow disable hotkeys
Add a section in /account/me for disabling hotkeys. Only added one
hotkey for now (Cmd + E for toggling editor side panel) but we can add
more with the same pattern.
* refactor: remove default export on ProjectLayout
* feat(hotkeys): allow toggling of command menu and ai assistant hotkeys
* Nit
* PRettier lint
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* feat: bucket type page and corresponding sidebar
* feat: handle /storage URL redirection based on feature flag
* fix: default sidebar selection
* Use feature flag for feature preview, and have new UI behind feature preview instead
* Remove hardcode
* Minor clean ups
* chore: improve feature preview description
* chore: more descriptive name for general file storage type
* fix: preview image
* Minor nits
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* feat: move storage settings
* feat: redirect
* feat: database settings in service area
* feat: move data api settings
* fix: revert data API placement
* feat: minor UX touches
* fix: simplify configuration group
* feat: references to database settings
* feat: references to storage settings
* fix: redirects and formatting
* fix: Import StorageMenu dynamically to avoid SSR issues with useLocalStorage
* feat: sticky sidebar footer
* fix: move Data API closer to semantic siblings
* fix: revert smart comma
* Shift bucket sort logic into storage explorer store
* Small fix and clean up
* fix: correct background-color class
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* feat: move storage settings
* feat: redirect
* feat: database settings in service area
* feat: move data api settings
* fix: revert data API placement
* feat: minor UX touches
* fix: simplify configuration group
* feat: references to database settings
* feat: references to storage settings
* fix: redirects and formatting
* fix: Import StorageMenu dynamically to avoid SSR issues with useLocalStorage
* fix: move Data API closer to semantic siblings
* fix: revert smart comma
* Shift bucket sort logic into storage explorer store
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* Update studio testing setup files
Improves API mocking type safety and polyfills browser APIs necessary to run tests with framer-motion components
* fix missing listen call for msw, resolve test type error
* fix imports
* Update studio testing setup files
Improves API mocking type safety and polyfills browser APIs necessary to run tests with framer-motion components
* fix missing listen call for msw, resolve test type error
* fix imports
* Move non-layout Storage related components to `components/interfaces`
* Fix paths
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* Migrate the CreateBucketModal to use RHF.
* Minor fixes for the create bucket modal.
* Use the bucket type from the API everywhere.
* Improve the types on some functions. Add "skip" mode to FDWCreateMutation.
* Expand the CreateBucketModal to explain what will happen when creating an iceberg bucket.
* Add a page for iceberg buckets.
* Add error states to the iceberg explorer.
* Fix the names for the FDWs.
* Add a dialog for setting up namespace.
* Restructure the new files.
* Add a download env button.
* Add warning to install the wrappers extension when creating an iceberg bucket.
* Add failover details when the FDW is not setup.
* Fix a lint error.
* Fix a type error.
* Minor fixes.
* Fix the server name.
* Add an icon for iceberg buckets.
* Fix the import foreign schema dialog.
* Make the setup wrapper button functional.
* Fix a bad useMemo dependency.
* Small changes to the iceberg bucket page.
* Minor fix for the edit wrapper sheet.
* Rename the files from kebab-case to PascalCase.
* Rename the files again to include Analytic instead of Iceberg.
* Rename Iceberg type to Analytic.
* Add a switch for creating namespace in the import foreign schema dialog.
* Fix the CreateBucketModal.
* Fix the delete modal feature.
* Fix the S3 keys in the FDW.
* Only create a namespace if the switch is true.
* Regenerate and fix the types.
* Fix the FDW create mutation to handle numbers in the FDW names.
* Make the icon smaller.
* Check whether the namespace exists, if it doesn't create it.
* Hide action from the analytic bucket which don't work.
* Invalidate namespaces when creating them.
* Add small explanation for the creation of namespaces.
* Minor fixes.
* Tons of changes to make the namespace feature work.
* Fix type errors.
* Fix bad import.
* Minor copy fixes.
* Replace the multiple cards with a table of namespaces.
* update copy icon
* tiny copy update
* Fix the empty state for foreign tables.
* Hide the analytics bucket option for self-hosted.
* Minor copy fixes.
* Expand the CTA on no namespaces state.
* More minor fixes.
* More small fixes.
---------
Co-authored-by: Alaister Young <a@alaisteryoung.com>
* Shift every logic in storage mobx store to storage valtio store
* Deprecate localStores folder
* REMOVE MOBX ENTIRELYYYYYYY 😄
* Update
* Clean up
* Small improvement for rename folder
* Use Context for Storage Explorer valtio store + shift views to new store
* Shift downloadFile from mobx store to utils
* Shift formatTime outside of StorageExplorerStore to StorageExplroer.utils
* Clean up
* Address comments
* 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.
* Fix the types for API settings to include protocol.
* Use the protocol property in all usages of endpoints.
* Update
* Lint
* Revert changes to retrieving protocol
* Remove console.logs
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* Add perms check in projects API query
* Start deprecating use of projects-api-query, move to projects-settings-v2-query
* PRETTY
* Shift all uses of project api query to project settings v2 query, and deprecate project api query
* Shift all uses of project-settings-query to project-settings-v2-query and deprecate project-settings-query
* Fix
* Add perms check in projects API query
* Start deprecating use of projects-api-query, move to projects-settings-v2-query
* PRETTY
* Address feedback
* Address feedback
* Switch all top-level imports for ui-patterns components to use specific components when importing.
* Remove the @ui-patterns shorthand since it works exactly the same without the @.
* More import fixes.
* Fix the ui-patterns tests.
* Add lucide-react to docs (to make the autocomplete work).
* Migrate the docs app icons.
* Migrate the ui-patterns.
* Remove the old icons from ui package.
* Migrate the www app from react-feather icons.
* Migrate all of studio icons.
* Migrate the only component in design-system.
* Fix an old import in ui package. Revert an import in docs app.
* Fix some pages in www.
* Remove unneeded files used in generation of icons.
* Fix a prettier error.
* Fix more issues in www.
* Fix an issue in Log Date picker.
* Replace all string sizes with number sizes because the icons grew in some cases.
* Fix more imports in security page.
* Fix an extra import.
* Remove the size prop from all icons if they're in a button and they match the button size.
* Minor fixes for docs and www.
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* 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>
* fix: update Permission params
* fix: upgrade check permission hook to support project level role
* fix: usePermissionsLoaded
* fix: Permission params can be undefined
* Scaffold new access management UI
* Add validation
* Update roles view
* Add tooltip
* Add button to apply role to all projects
* Update UI to select projects first instead of roles
* Merge master update UI
* Midway trying to implementation project level perms API
* First pass implementating updating project level permissions
* Add client side validation for assigning/removing roles
* Midway implementing new invites
* Integrate most of the project level permissions functionality
* fix: filter out org-level permissions before checking
* Add relevant UI guards in org level pages for project role POV
* Minor refactors
* Small refactors
* More fixes
* Moar refactors
* More fixes
* More fixes
* Refactor update role logic and smack some test cases on it
* Fixes
* Fix type issue
* Fix type
* more fixes, refactors, adding checks...
* MORE fixes
* Add perms checking for replicas
* Add ButtonTooltip component and use them to prevent repetition of pointer events auto for buttons with tooltips
* Convert all buttons with tooltips to use ButtonTooltip
* refactor
* PRettier
* Small fix
* Remove commented out code in organization-invitation-accept-mutation
* fix: switch to use the platform oauth authorizations routes
* Add perms checking for org audit logs and org oauth apps
* PRettier
* Fix incorrect URL for oauth app flow
* Fix incorrect URL for oauth app flow
* Fix
* Add perms checking for warehouse related UI
* Update roles helper icon
* remove unused lib
* Update package lock... again
* Update package lock... again
* Smalllll update
* Update some checks
* Add gate for project level permissions
* Last fix
* update codegen
* Update warehouse endpoint routes
* Fix
---------
Co-authored-by: phamhieu <phamhieu1998@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
* Migrate all API calls to data folder.
* Remove unused mutation.
* MInor leftover type fixes.
* chore: Make the `StorageExplorerStore` fully typed (#23397)
* Migrate all API calls to data folder.
* Convert the poor man enums into proper enums.
* Add types to most of the methods.
* Add types around the methods for uploading files.
* Add types for file cache.
* Add types for buckets.
* Fix bunch of type errors.
* Add types to all store methods. Fix all types in components related to the store.
* Remove all anys from the Storage components.
* Fix the multiple selection.
* Fix the selected checkbox.
* Set all private methods to private and delete some unneeded code.
* Remove unneeded mutation.
* Update all mutations for storage explorer to follow template syntax
* Update apps/studio/components/to-be-cleaned/Storage/StorageExplorer/PreviewPane.tsx
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
* Final replacements of ui setNotification with toast
* Rip out UiStore
* Rip out UiStore
* Shift files under authConfigSchema to components/Auth
* Rip out use of observers
* Remove observer calls for pages and components that no longer use mobx stores
* Close nav bar on click link
* Remove onClick for navigationiconbutton
* If user clicked on nav icon thats within the nav bar, dont reopen until mouse left side bar once
* Fix
* 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.