Commit Graph

37 Commits

Author SHA1 Message Date
ChloeGarciaMillerand
590ec2bbd4 fix: improve accessibility for icon buttons (#45981)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Improving accessibility for icon-only buttons

## What is the current behavior?

Icon-only buttons do not have explicit accessible names for screen
readers.

## What is the new behavior?

All icon-only buttons now have explicit accessible names using visually
hidden text (sr-only), ensuring proper screen reader support.

## Additional context

Tooltip text is preserved for visual users.
No visual changes were introduced.


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

* **Bug Fixes**
* Added/updated aria-labels across refresh buttons, sidebar controls,
dropdown triggers, and navigation links for better accessibility.
* Added conditional aria-labels for the “Create with Assistant” control
to reflect permission states.
* Improved screen-reader descriptions for sidebar toggle and other
stateful controls to better convey status changes.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/45981)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-15 15:32:14 +02:00
Charis
4a0bb36ca8 style: require sorted imports in studio/components (#44408)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-04-01 10:22:37 +02:00
Vaibhav
efa6f2070f fix: add loading state to prevent API status flicker (#43729)
Before:

https://github.com/user-attachments/assets/4e617090-7563-445e-ab5a-1982078eb667


After:

https://github.com/user-attachments/assets/124a9556-0f5d-463b-be6e-31c335a444ac
2026-03-12 20:12:33 -06:00
Saxon Fletcher
1bcecb1c42 Table list entity api badge copy (#41547)
* api badge copy

* ts

* test

* API badge policy row (#41548)

api badge policy row

* refine

* fix tiny nits

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2026-01-06 08:04:40 +10:00
Ali Waseem
2023b2632a Chore: added RLS tests (#40689)
* added RLS tests

* removed index clicking for label and added unrestricted tests

* updated PR feedback
2025-11-21 20:10:47 +00:00
Saxon Fletcher
d66307f98b fix responsive issues (#40029)
* fix responsive issues

* sidebar width
2025-10-31 19:25:41 +10:00
Saxon Fletcher
738c568e6b Sidebar manager (#39795)
* sidebar-manager

* storage keys

* tests

* more ai spots

* test fix

* revert to default

* remove ref

* Update apps/studio/state/sidebar-manager-state.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix ts

* fix

* fux

* fux query param

* clean

* fix

* more

* mock local storage

* simplify

* remove provider test

* remve useopensidebar

* fix(new homepage): open ai assistant on advisor card button clicks

* Update apps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/studio/state/sidebar-manager-state.tsx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* refine

* FIX

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-10-28 10:07:21 +10:00
Charis
13c4b1584c fix,perf(policies search) (#39790)
* fix(policies search): replace useUrlState with nuqs

There is a bug when typing quickly into the search field on the policies
page: because useUrlState naively uses router.replace, which is
asynchronous, the search term can get corrupted, e.g., searching for
"dummy" might end up with a final value of "dum". Switched to nuqs for
better handling.

* perf(policies page): memoize and optimize for projects with many tables

A project with hundreds of tables will have extremely slow search
performance for the policies page, because of heavy rerendering. Made
some optimizations:
- Memoized to reduce rerendering
- Hid filtered-out tables instead of unmounting, so we don't have to
remount when the search is cleared

* refactor(policies page): pass policies info through context

Avoid having a mess of props by creating a PoliciesDataContext to share
policy information.

* cleanup(policies pages): minor code cleanup, no user-facing changes
2025-10-22 20:57:11 +00:00
Joshen Lim
d46525eac1 Chore/swap use check permissions with use async check project permissions part 8 (Season Finale) (#38619)
* Update perms checking in audit logs

* Deprecate useCheckPermissions, useIsPermissionsLoaded and useCheckProjectPermissions as they're no longer used

* Rename useAsyncCheckProjectPermissions to useAsyncCheckPermissions

* Fix TS
2025-09-16 17:05:57 +08:00
Saxon Fletcher
a299180c24 update realtime and storage policies (#38229)
* update realtime and storage policies

* Small refactors

* Tiny fix

* Fix typo

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-27 16:07:27 +07:00
Saxon Fletcher
db4ae7e326 Refine the policies page (#38204)
* refine the policies page

* minor fixes

* Fix TS

* Do not transform table name in policy row table header

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-26 22:09:17 +07:00
Joshen Lim
a897cc27f0 Part 1 of swapping useCheckPermissions with useAsyncCheckProjectPermissions (#37751)
* Part 1 of swapping useCheckPermissions with useAsyncCheckProjectPermissions

* Update apps/studio/hooks/misc/useCheckPermissions.ts

Co-authored-by: Drake Costa <drake@saeris.io>

* Address feedback

---------

Co-authored-by: Drake Costa <drake@saeris.io>
2025-08-11 11:53:15 +07: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
Saxon Fletcher
73644db62d Link to auth provider (#33951)
* link to provider

* Simplify implementation

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-03-03 17:03:10 +08:00
Saxon Fletcher
28fe5811de Inline editor feature preview (#33541)
* add edge function knowledge

* deploy edge function mutaton

* add edge function block with deploy

* update function url

* update tools

* editor sql

* add templates

* use monaco editor

* hook up templates

* fixes

* add behind feature flag

* preview docs

* move editor

* initialPrompt

* consolidate widgets

* remove generic editor

* move logic

* fix ts

* include schema metadata

* Fix width of save snippet button

* Set tooltip position

* Use inlineLink component

* Remove unnecessary z index

* Lint

* Lint import statements in EditorPanel

* fixes

* fix keyboard shortcut

* show/hide results and invalidation

* fix focus issues in widget

* fixes

* fix ts

* Support cmd enter shortcut to run query in InlineEditor

* Update InlineEditorPreview to use admonition

* prompt updates

* add discussion url to preview

* schemas array

* One last clean up

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-02-19 14:58:58 +10:00
Joshen Lim
d88cb12794 Remove assistant V2 from feature preview (#30779)
* Remove assistant V2 from feature preview

* Hide fix with assistant button in rls editor
2024-12-02 22:03:31 +08:00
Saxon Fletcher
8c3da2ed95 More assistant refinements (#30730)
* ai refinements

* ui fixes

* space

* reduce dot height

* Fix prop type issue

* Assign allowHoverEffect to ai assistant button and panel

* Lint

* Some lints

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-29 20:31:02 +10:00
Joshen Lim
12d92aed99 Assistant V2 (#30523)
* start

* added panels

* remove stuff

* fixes and refinements

* clean up

* remove old assistant panel

* resizable assistant kinda

* use icon

* Add missing package

* remove canvas

* add suggestions

* updated empty state if no tables exist

* fix table condition

* Implement diffing if using assistant in sql editor

* Reinstate old assistant in SQL editor if feature preview is off

* pane size adjustment

* assistant button corners

* Add SQL snippet content to assistant if opening assistant in sql editor

* Add the necessary checks for opt in and hipaa

* revert adding snippet to assistant when opening assistant in sql editor

* Add cmd i shortcut

* Add admonitions for when disablePrompt is toggled on, and if no api key is set. Add footer note RE rate limitation

* Bump ai package in packages

* some fixes for backwards compability depending on feature preview toggled

* Rename feature preview property for new assistant

* Smol fix

* Prevent SQL snippet from running until message is finished

* only loading last message

* fix z-index

* save chat state to global state

* add debug to failed ai queries

* Add basic contextual invalidation

* Add explain code action to SQL editor

* Add link to abort ongoing queries from SqlSnippet

* Update feature preview content

* Fix

* Fix

* Fix

* Te4st

* Fix tests

* ONly show ai button within a project

* Fix PH tracking

* Beef up a bit more event tracking

* Rough fix to padding when assistant is open

* A bit more telemetry stuff

* Update prompts

* fix rls editing via assistant

* Update generate-v3.ts

prompt to get auth schema too

* Add policy satement to assistant when editing

* Address all comments

* fixc

* Fix SqlSnippet not taking full width on larger viewports

* Adjust max width

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
2024-11-25 18:50:56 +08:00
Joshen Lim
225d461381 Hook up RLS to new assistant if feature flag is enabled (#30357)
* Hook up RLS to new assistant if feature flag is enabled

* Reset conversation if opening a different entity

* Add prompt to use alter policy if policy definition is provided

* Remove console log
2024-11-08 18:03:30 +08:00
Alaister Young
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
Joshen Lim
3a3360bbd0 Fix all usage of button tooltip (#30076)
* Fix all usage of button tooltip

* PRETTY
2024-10-24 13:32:47 +00:00
Alaister Young
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
f521109ce2 Chore/database functions v2 (#29969)
* Init AiAssistantPanel

* Temp

* Temp

* iterating on assistant ux

* More spiking

* Tweaking...

* Moar tweaking..

* Even more tweaking

* Tweek

* More tweaks

* Final tweaking...

* TWEAK

* Spelling

* Fix

* Assistant error handling and small bug fix in context for message

* Add feature flag

* Fix

* Address all feedback

* Minor
2024-10-23 16:43:38 +08:00
Terry Sutton
a40ccd11bc rls changes (#29118)
* Inital setup

* Add suggest feature to the RLS Assistant

* Add AI button

* Use existing policies in AI editor

* Remove old feature preview

* Cleanup

* Tooltip

* Update

* Change panel width

* Fix type

* Fix types again

* Flag cleanup

* Add tooltip

* Cleanup

* Add a clear history button
2024-10-02 08:52:36 -02:30
Terry Sutton
b3fd925af1 POC for revised RLS page (#29401)
* POC for revised RLS page

* nudge colours

* Nudges

* Colour nudge
2024-09-23 15:40:34 -02:30
Joshen Lim
058698e6e8 Chore/auth policies page fixes (#28579)
* Use ButtonTooltip component for create policy CTAs

* Use ButtonTooltip component in PolicyRow

* Remove use of old tooltip component in PolicyRow

* Update Auth policies to allow read only to access edit policy UI but prevent saving from there

* Fix
2024-08-13 14:04:01 +08:00
Alaister Young
70da0f1d1d chore: cleanup packages (#27770)
* chore: cleanup packages

- Avoid circular imports
- Export API-types as types
- pg-format without depending on Node internal Buffer (not browser-compatible)
- Avoid importing from barrel files in ui dir

* chore: avoid barrel file imports in studio (#27771)

* chore: avoid barrel file imports

- Removes some unused imports
- Avoids barrel file import for faster builds + less memory

* add eslint rule

* type fixes

* delete layouts barrel

* delete components/grid barrel file

* delete components/grid/utils barrel file

* delete components/grid/components/common barrel file

* delete components/grid/components/editor barrel file

* delete components/grid/components/formatter barrel file

* delete components/grid/components/grid barrel file

* delete components/grid/components/header/filter barrel file

* remote components/grid/store barrel file

* remove components/interfaces/Auth/Policies barrel file

* delete components/interfaces/Settings/Logs barrel file

* delete components/ui/CodeEditor barrel file

* delete components/ui/Forms barrel file

* delete components/ui/Shimmers barrel file

* delete data/analytics barrel file

* delete hooks barrel file

* cleanup lib/common/fetch barrel file

* final * barral files cleanup

* global react-data-grid styles

* remove console.log

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>

* fix build

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-04 14:48:10 +08:00
Ivan Vasilov
ee8f901bfd feat: RLS policies for realtime channels (#27490)
* Add queries and mutations for realtime channels.

* Change the layout, add a link for policies and modal for creating a channel.

* Add a page for policies.

* Add templates for realtime tables.

* Fix the spacing in the PolicyDetails component. Add better types.

* Pass templateData to the template generating functions.

* Various CSS fixes.

* Add components for rendering the realtime policies page.

* Fix the editing policy flow.

* Fix refetching when adding or deleting policies.

* Minor various fixes.

* Remove an old console.log.

* More fixes for templates.

* Make the realtime policies open by default when clicking on realtime.

* Update the realtime policy templates.

* Use a dropdown button for the three types of policies.

* Fix a copy-paste mistake.

* Fix icons.

* Fix the toast.

* Clean up the previous components.

* Clean up more unneeded code.

* Remove templateData prop.

* Remove unneeded queries and mutations.

* More cleanup.

* Reuse the components from the Auth Policies.

* Minor fixes for the new components.

* Add a feature flag for AuthZ.

* Revert some changes.

* Fix a build error.

* Fix all definitions.

* Fix an issue with copying large lines which from templates which are word-wrapped.

* Addressed various comments by Joshen.

* Revert the UI changes in the Policy Editor.

* Update the template names.

* Small style fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-06-26 13:27:29 +02:00
Terry Sutton
78e99d5666 Use combo box (#23193)
* Use combo box

* small fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-04-24 14:48:38 +07:00
Joshen Lim
4b9f9dfe15 Add create policy CTA under each table in auth policies page (#23140)
* Add create policy CTA under each table in auth policies page

* Remove log
2024-04-23 12:10:20 +07:00
Joshen Lim
4327d58df5 Hybrid RLS Assistant (#21806)
* Midway checking on hybrid rls assistant

* Demo

* Midway

* Polish + hook up everything for policy creation

* Temp fix for open in sql editor

* Resolve conflicts

* Support updating policies with new hybrid ui

* Fix generateQuery for altering policies

* Update to support feature preview

* Fix spelling lint

* Addressing small bugs

* Fix

* Clean upo

* Add new MultiSelectV2 in ui-patterns, use in RLS editor

* More clean uo

* Fix RadioGroupLargeItem label cursor state when disabled

* Lint lowercase sql
2024-03-25 16:02:50 +07:00
Jonathan Summers-Muir
a4a4a7e26d Deprecate old Badge component (#22037)
* Update Badge.tsx

* refactor apps with new props

* Update APIKeys.tsx

* format

* remove old code
2024-03-19 10:33:12 +01:00
Terry Sutton
46051bce17 Chore/table editor header simplification (#18366)
* start

* Update

* Types

* Passhref

* Cleanup

* Update

* Fix

* Updates

* Updates

* Enable RLS from table editor

* Cleanup

* Filter current table policies

* Fix missing footer

* Duplicate role picker

* Remove rls banner

* Add tooltip for rls enabled, but no policies

* Fix footer positioning

* Prettier

* Change wording

* Update button style

* Cleanup

* Small update

* Fix Auth policies button number bg color

* Fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-15 09:10:30 -03:30
Joshen Lim
ec77b7f305 Fix policies page locked schema notice (#21217) 2024-02-13 17:58:50 +08:00
Alaister Young
42164183f2 fix: add missing asChild props (#19456)
* fix: add missing asChild props

* move csvlink outside of dropdown trigger

* fix incorrect merge
2023-12-06 21:11:32 +11:00
Joshen Lim
f65c847b54 Chore/rls ai assistant updates (#19325)
* Have rls ai assistant sit in feature preview + shown via feature flag

* Support editing existing policy in new AI assistant panel

* Beef up feature preview

* Shift AI settings modal to components/ui and add AI settings to RLS AI assistant panel

* Update apps/studio/components/interfaces/App/FeaturePreview/RLSAIAssistantPreview.tsx

Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>

* Update apps/studio/components/interfaces/App/FeaturePreview/RLSAIAssistantPreview.tsx

Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>

---------

Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>
2023-12-01 11:24:12 +01: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