* chore: remove auth-helpers (deprecated)
* type supabase client in feedback
* small adjustments to error and loading state handling for docs search
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
Fixed 2 bugs with Ask AI input field:
- If you try to edit in the middle of the input value, your cursor will
jump to the end
- Can't accept CJK IME input
* fix(cmdk): empty state shows up when it shouldn't
Can't remember why on earth I put this in a useMemo instead of a
useEffect...
* fix(command menu): switch branch command not showing up
We were hacking around force-mount behavior because it wasn't working in
a previous version of cmdk. cmdk version was bumped a few weeks ago
which fixes force-mount.
* feat: add switch org command
* fix: change switch org to configure org
The org doesn't really get globally switched, you just land on the
settings page, so this seems more accurate.
* fix: allow cjk ime input on commandinput component
- Add a dummy CommandList descendant
- Needed for cmdk to not throw an error
- No easy way to remove the Command Menu because it's needed in the
empty state
- Somewhat hacktastic but solves the error
Fixes a bug in docs search from duplicated code (I moved the
useEffect into a new component and forgot to delete the old one,
so it runs the on-entry query submit twice, resulting in a double
conversation in production.)
In dev, there is actually a _quadruple_ -_-" converstation, due to
useEffect running twice as designed, with no cleanup. Added a
cleanup function to reset after the first useEffect, so it only
runs once on dev as well.
This only happens when there is an existing query to send when you
hit the AI page, so to reproduce the current bug, type in the
command input _before_ selecting "Supabase AI". If you select
"Supabase AI" before entering your prompt, it won't occur, which is
how I guess this bug slipped past manual testing.
Add commands to studio cmd k for searching and running snippets (doesn't actually run them directly cause that would take a lot of duplicated logic, just links to sql editor with them loaded)
Replace docs command menu with Command Menu V2 from ui-patterns/CommandMenu.
This introduces the prepackaged folder for the shared Command Menu, which contains commands that are shared across the sites (for example, docs search, theme switcher).
Commands that are only applicable to a single site are now defined within that site's own app folder (put them wherever makes sense for your app folder organization, as long as you use the hooks within a global CommandProvider it will work...)
Tested navigating around, using search and AI on laptop and mobile.
Add all the outstanding pieces for state management of new command menu:
- Pages state (handles routing between command menu views, e.g., docs
search, AI, etc.)
- View state (handles opening and closing and initiation (needed for
lazy loading))
- Query state (handles active search term)
Introduces the first (very small) slice of the new command menu as a `ui-pattern`.
This slice just handles state for available commands. It isn't hooked up to anything yet.