Files
supabase/packages/ui-patterns
CharisandJoshen Lim c1505ba617 fix: table editor menu on mobile (#38572)
* fix: table editor menu on mobile

Problem:

On mobile, when the schema selector is changed in the table editor menu,
the menu immediately closes again before the user has a chance to select
a table.

Solution:

The closing is caused by the new schema selection updating the router
query. Whenever router.asPath changes, layout logic causes the mobile
menu to collapse. This layout logic probably makes sense for the vast
majority of cases, and I don't want to touch something that probably
affects many screens, so I opted instead to change the schema selection
locally within the TableEditorMenu.

The schema selection on mobile is now a two-phase commit. In the first
phase, only local schema state changes, so the user has time to select a
table. When the user selects a table or closes the menu, the schema
state is committed, which triggers the global state change, including
the router query update.

* Revert "fix: table editor menu on mobile"

This reverts commit f8835137a1.

* fix: don't close mobile menu simply for query param changes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-11-03 12:19:12 -05:00
..
2025-10-01 10:45:34 -04:00

Supabase UI Patterns

This package should be used for components which are built using NPM libraries (react-markdown, reactflow for example), which make no sense to be included in all apps. It should also be used for components which are constructed using various components from the ui package.

This package does not have a barrel file - each component has to be imported from its index (ui-patterns/PrivacySettings, for example). This is intentional so that adding a new component which is used only in 1 or 2 apps doesn't burden the rest of the apps.