Commit Graph

16 Commits

Author SHA1 Message Date
Joshen Lim
7f5865872a Enforce noUnusedLocals and noUnusedParameters in tsconfig.json + fix all related issues (#45264)
## Context

Enforce `noUnusedLocals` and `noUnusedParameters` in tsconfig.json + fix
all related issues
2026-04-27 17:42:34 +08:00
Joshen Lim
9b0dc8d9b9 Chore/fix storage explorer when switching buckets (#43541)
## 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
2026-03-09 14:32:34 +07:00
Ivan Vasilov
e8c309c312 fix: resolve undefined project ref in TabsStateContextProvider (#43222)
This pull request refactors how the `TabsStateContextProvider` receives
the project reference and updates related imports for consistency and
maintainability. The main change is to pass `projectRef` explicitly as a
prop instead of fetching it internally, which improves context control
and makes the component easier to test and reuse. Additionally, the PR
updates import paths to use absolute aliases and removes an unused
function.

This fixes an issue which you can replicate by:
1. Go to SQL editor
2. Open any snippet
3. Delete the local storage `supabase_studio_tabs_{project ref}`
4. Refresh the page while still the snippet is open

This will make the snippet to enter in a ghost state where the tab name
is not visible but you see the content.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-02-27 12:32:01 +08:00
Joshen Lim
a057c951ea Make edge functions page accessible on coming up (#42549)
## Context

Related prior work was making edge functions page accessible while
project is restoring - however the status of the project gets flipped to
COMING_UP while it's restoring hence why the functions page was still
inaccessible.

## Changes involved

- Update `NavigationBar.utils` to have edge functions link to
`/functions` irregardless of project status
- (Unrelated) Disable (with tooltip) deploy new function CTA on edge
functions page if project is not active
<img width="403" height="108" alt="image"
src="https://github.com/user-attachments/assets/88479247-999b-4d41-a444-6705f8c3993e"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Deploy Edge Function button now disables and shows a tooltip when the
project is inactive to make deployment status clear.

* **Bug Fixes**
* Edge Functions link now points consistently to the functions view
regardless of project build state.

* **Refactor**
* Consolidated project-active check and reorganized related UI wiring to
standardize inactive-state handling across settings and controls.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-09 16:56:23 +08:00
Francesco Sansalvadore
5213e681b4 feat(studio): add "create" command menu commands (#41473) 2025-12-29 09:18:06 +01:00
Joshen Lim
cab0585533 Fe 1799/consolidate to useselectedprojectquery and (#37684)
* Replace all usage of useProjectContext with useSelectedProjectQuery

* Replace all usage of useSelectedProject with useSelectedProjectQuery

* Replace all usage of useProjectByRef with useProjectByRefQuery

* Replace all usage of useSelectedOrganization with useSelectedOrganizationQuery

* Deprecate useSelectedProject, useSelectedOrganization, and useProjectByRef hooks

* Deprecate ProjecContext
2025-08-06 10:53:10 +07:00
Alaister Young
d75cb8b45c fix: studio circular imports (#36026)
* fix: studio circular imports

* Fix the import cycle on Wrappers tabs components.

* Remove duplicate declarations of the feature previews array.

* fix feature previews circular import

* Minor nit

* update all project contexts to use useSelectedProject

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-06-06 16:38:25 +08:00
Alaister Young
22db2c323e chore: refactor tabs store (#35551)
* chore: refactor tabs store

* remove tabs from local storage when disabling preview
2025-05-15 11:42:18 +08:00
Joshen Lim
70a8888b0a Chore/refactor storage explorer store part 1 (#35271)
* 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
2025-04-28 14:16:46 +08:00
Alaister Young
1085987eb3 feat: support postgres custom access token hooks (#34893)
* chore: refactor role impersonation

* fix: handle undefined claims in role impersonation SQL generation

* feat: support postgres custom access token hooks

* remove unused hook

* fix ts
2025-04-17 17:30:22 +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
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
Jonathan Summers-Muir
a09ffd0104 Feat/get layout - Project pages updated to use getLayout (#33365)
* Update AppBannerWrapper.tsx

* full width header layout

* layout fixing for sign in pages

* update

* init

* Update app-state.ts

* Update ProjectLayout.tsx

* init project pages

* Update LayoutHeader.tsx

* sign in layout fixed

* Update AppBannerWrapper.tsx

* Update AppBannerWrapper.tsx

* update

* Update DefaultLayout.tsx

* Update WithSidebar.tsx

* Update ProjectLayout.tsx

* Update DefaultLayout.tsx

* layout header updatefix header

* add fragment back in

* Update ProjectLayout.tsx

* Update ProjectLayout.tsx

* Update ProjectLayout.tsx

* Update ProjectLayout.tsx

* Remove ProjectContextFromParams component (duplicate to ProjectContextProvider).

* Fix the loading state of SignInMfa page.

* Update sign-in-fly-tos.tsx

* Update ProjectLayout.tsx

* Update ProjectLayout.tsx

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-02-07 15:00:02 +08:00
Joshen Lim
da792ba0ba Chore/show rr UI only if project is enabled (#19642)
* Only show RR UI if project is enabled

* Only show RR UI if project has read replicas enabled, shift DatabaseSelector state to valtio, add Database Selector to API URl

* Update usage of Project interface from types to Project from project-details-query

* Fix ts errors

* Another one

* Another one...

* God one more

* Fingers crossed

* jesus

* Add deprecate mark on ProjectBase

* Resolve conflicts

* Rename ProjectState from valtio to DatabaseSelectorState

* Rename file

* fix imports

* tiny code changes

* Fixes

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2023-12-20 16:49:53 +07:00
Alaister Young
9d8e8b068f chore: move role impersonation state into a context (#19510)
* chore: move role impersonation state into a context

* clean up ProjectContext.tsx imports

* move isRoleImpersonationEnabled to only relevant queries
2023-12-11 16:32:11 +11: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