Skip to content

Fix: improve accessibility for icon buttons (Table Editor menu) - #47639

Merged
djhi merged 15 commits into
supabase:masterfrom
ChloeGarciaMillerand:fix/TableEditor-accessibility
Jul 24, 2026
Merged

djhi merged 15 commits into
supabase:masterfrom
ChloeGarciaMillerand:fix/TableEditor-accessibility

Conversation

@ChloeGarciaMillerand

@ChloeGarciaMillerand ChloeGarciaMillerand commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Bug fix (accessibility improvement)

What is the current behavior?

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

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 or added for visual users.
No visual changes were introduced.

Summary by CodeRabbit

  • Accessibility Improvements
    • Updated table editor action controls with clearer, context-aware aria-labels (e.g., “Add new column”, “More options for …”, “New table”).
  • UI Refinements
    • Added hover tooltips to key table editor actions, including add-column, more-options dropdown triggers, and create-new-table button, improving discoverability and guidance.

@ChloeGarciaMillerand
ChloeGarciaMillerand requested a review from a team as a code owner July 6, 2026 12:07
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for contributing to Supabase! ❤️ Our team will review your PR.

A few tips for a smoother review process:

  • If you have a local version of the repo, run pnpm run format to make sure formatting checks pass.
  • Once we've reviewed your PR, please don't trivially merge master (don't click Update branch if there are no merge conflicts to be fixed). This invalidates any pre-merge checks we've run.

@vercel

vercel Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jul 22, 2026 8:34am
docs Ready Ready Preview, Comment, Open in v0 Jul 22, 2026 8:34am
studio-self-hosted Ready Ready Preview, Comment Jul 22, 2026 8:34am
studio-staging Ready Ready Preview, Comment Jul 22, 2026 8:34am
ui-library Ready Ready Preview, Comment Jul 22, 2026 8:34am
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Jul 22, 2026 8:34am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 22, 2026 8:34am

Request Review

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

@ChloeGarciaMillerand is attempting to deploy a commit to the Supabase Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3ac4c8e1-3106-4576-b981-0f0c394aa7be

📥 Commits

Reviewing files that changed from the base of the PR and between 77cc557 and fc96fe5.

📒 Files selected for processing (1)
  • apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx

📝 Walkthrough

Walkthrough

Icon-only action buttons in four Studio components now use Tooltip wrappers and explicit aria-labels for add-column, more-options, and new-table actions.

Changes

Tooltip additions for icon-only buttons

Layer / File(s) Summary
Grid action tooltips
apps/studio/components/grid/components/grid/AddColumn.tsx, apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
Add-column and grid-header action triggers are wrapped in Tooltips with descriptive content and accessible labels.
Entity list action tooltip
apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx
The entity more-options trigger displays “More options” and uses an entity-specific aria-label while preserving its click behavior.
New table tooltip
apps/studio/components/layouts/Tabs/Tabs.tsx
The new-table button is wrapped in a Tooltip showing “New table” and receives a matching aria-label.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: awaseem

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the accessibility-focused change for icon buttons in the Table Editor menu.
Description check ✅ Passed The description includes all required template sections and is mostly complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/TableEditor-accessibility

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx (1)

335-347: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

aria-label hardcodes "table" for entities that may be views/foreign tables.

aria-label={More options for ${table.name} table} is applied regardless of entity kind, but this same trigger renders for tables, views, materialized views, and foreign tables (isTable/isView/isMaterializedView/isForeignTable are all checked in this component). Screen reader users will hear "table" even when acting on a view or foreign table.

♻️ Proposed fix
-                  <Button
-                    variant="default"
-                    icon={<MoreVertical />}
-                    className="h-7 w-7"
-                    aria-label={`More options for ${table.name} table`}
-                  />
+                  <Button
+                    variant="default"
+                    icon={<MoreVertical />}
+                    className="h-7 w-7"
+                    aria-label={`More options for ${table.name}`}
+                  />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx`
around lines 335 - 347, The aria-label on the MoreVertical button in
GridHeaderActions should not always say “table” because this trigger is used for
tables, views, materialized views, and foreign tables. Update the label
generation in this component to use the actual entity kind already available via
the isTable/isView/isMaterializedView/isForeignTable checks, so the
DropdownMenuTrigger/Button announces the correct type for screen readers.
apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx (1)

236-252: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

aria-label says "table actions" even for views/materialized views.

aria-label={${entity.name} table actions} is wrong for non-table entities — entity.type can be ENTITY_TYPE.VIEW or ENTITY_TYPE.MATERIALIZED_VIEW per the branches further down (Lines 303-304, 435, 483). The component already has a formatTooltipText(entity.type) helper (Line 151) that converts type to readable text — reuse it instead of hardcoding "table".

♻️ Proposed fix
-                  <Button
-                    variant="text"
-                    className="w-6 h-6"
-                    icon={<MoreVertical size={14} strokeWidth={2} />}
-                    onClick={(e) => e.preventDefault()}
-                    aria-label={`${entity.name} table actions`}
-                  />
+                  <Button
+                    variant="text"
+                    className="w-6 h-6"
+                    icon={<MoreVertical size={14} strokeWidth={2} />}
+                    onClick={(e) => e.preventDefault()}
+                    aria-label={`${entity.name} actions`}
+                  />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx` around
lines 236 - 252, The aria-label on the DropdownMenuTrigger/Button is hardcoded
to “table actions,” which is incorrect for non-table entities. Update the
EntityListItem component to reuse the existing formatTooltipText(entity.type)
helper when building the aria-label so it reflects the actual entity type for
tables, views, and materialized views. Locate the trigger/button markup in
EntityListItem and replace the hardcoded “table” wording with the formatted type
text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx`:
- Around line 335-347: The aria-label on the MoreVertical button in
GridHeaderActions should not always say “table” because this trigger is used for
tables, views, materialized views, and foreign tables. Update the label
generation in this component to use the actual entity kind already available via
the isTable/isView/isMaterializedView/isForeignTable checks, so the
DropdownMenuTrigger/Button announces the correct type for screen readers.

In `@apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx`:
- Around line 236-252: The aria-label on the DropdownMenuTrigger/Button is
hardcoded to “table actions,” which is incorrect for non-table entities. Update
the EntityListItem component to reuse the existing
formatTooltipText(entity.type) helper when building the aria-label so it
reflects the actual entity type for tables, views, and materialized views.
Locate the trigger/button markup in EntityListItem and replace the hardcoded
“table” wording with the formatted type text.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c3cc74fa-13e7-4eec-8ac3-c4e86d4779e7

📥 Commits

Reviewing files that changed from the base of the PR and between 2880eee and 16e9819.

📒 Files selected for processing (4)
  • apps/studio/components/grid/components/grid/AddColumn.tsx
  • apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
  • apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx
  • apps/studio/components/layouts/Tabs/Tabs.tsx

@djhi

djhi commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The two comments from code rabbit are good. Can you check?

@ChloeGarciaMillerand

Copy link
Copy Markdown
Contributor Author

I have made the changes requested by coderabbit; however, in EntityListItem, {entity.type} cannot be used directly:

export enum ENTITY_TYPE {
  TABLE = “r”,
  VIEW = “v”,
  MATERIALISED_VIEW = “m”,
  FOREIGN_TABLE = “f”,
  PARTITIONED_TABLE = “p”,
}

I had to create a variable called entityKind:

  const entityKind = {
    [ENTITY_TYPE.TABLE]: “table”,
    [ENTITY_TYPE.VIEW]: “view”,
    [ENTITY_TYPE.MATERIALIZED_VIEW]: “materialised view”,
    [ENTITY_TYPE.FOREIGN_TABLE]: “foreign table”,
    [ENTITY_TYPE.PARTITIONED_TABLE]: “partitioned table”,
  }[entity.type] ?? 'entity'

Do we validate it like this, or would aria-label={${entity.name} actions} be sufficient (rather than aria-label={${entity.name} ${entityKind} actions})?

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx (1)

90-97: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a lookup map instead of nested ternary for readability.

The nested ternary works but is harder to scan at a glance. A lookup object keyed by entity type would be more maintainable if new entity kinds are added later.

♻️ Optional refactor
+const ENTITY_KIND_LABEL: Record<string, string> = {
+  [ENTITY_TYPE.TABLE]: 'table',
+  [ENTITY_TYPE.FOREIGN_TABLE]: 'foreign table',
+  [ENTITY_TYPE.VIEW]: 'view',
+  [ENTITY_TYPE.MATERIALIZED_VIEW]: 'materialized view',
+}
+
 const entityKind =
-  isTable
-    ? 'table'
-    : isForeignTable
-      ? 'foreign table'
-      : isView
-        ? 'view'
-        : 'materialized view'
+  ENTITY_KIND_LABEL[table.entity_type] ?? 'materialized view'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx`
around lines 90 - 97, The entityKind selection in GridHeaderActions is using a
nested ternary, which is hard to read and extend. Replace it with a clearer
lookup-based approach or equivalent mapping logic inside the same component,
using the existing isTable, isForeignTable, isView, and materialized view cases
to derive entityKind. Keep the behavior unchanged while making it easier to add
new entity kinds later.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx`:
- Around line 90-97: The entityKind selection in GridHeaderActions is using a
nested ternary, which is hard to read and extend. Replace it with a clearer
lookup-based approach or equivalent mapping logic inside the same component,
using the existing isTable, isForeignTable, isView, and materialized view cases
to derive entityKind. Keep the behavior unchanged while making it easier to add
new entity kinds later.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e0e3c570-1024-45d1-89dc-be2eebe7701c

📥 Commits

Reviewing files that changed from the base of the PR and between 16e9819 and 7139e8c.

📒 Files selected for processing (2)
  • apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
  • apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx

@djhi djhi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@czenko what do you think about those labels?

className="w-6 h-6"
icon={<MoreVertical size={14} strokeWidth={2} />}
onClick={(e) => e.preventDefault()}
aria-label={`${entity.name} ${entityKind} actions`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just drop the entityKind here. It's probably confusing for most users

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion, 'actions' is not true in every case. Sometimes, 'settings' or 'options' is more appropriate. This component should take something like an 'aria-label' text field instead and can be handled case-by-case.

variant="default"
icon={<MoreVertical />}
className="h-7 w-7"
aria-label={`More options for ${table.name} ${entityKind}`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, can you drop the entityKind?

const isView = isTableLikeView(table)
const isMaterializedView = isTableLikeMaterializedView(table)

const entityKind = isTable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could drop this and simplify this by instead exposing the option to add an aria-label for every context.

className="w-6 h-6"
icon={<MoreVertical size={14} strokeWidth={2} />}
onClick={(e) => e.preventDefault()}
aria-label={`${entity.name} ${entityKind} actions`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion, 'actions' is not true in every case. Sometimes, 'settings' or 'options' is more appropriate. This component should take something like an 'aria-label' text field instead and can be handled case-by-case.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx (1)

247-247: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Make the aria-label consistent with the tooltip text.

The tooltip content here is "More options", and in GridHeaderActions.tsx, the aria-label was updated to "More options for ${table.name}". For consistency across the UI and to match the tooltip content, consider using "More options for ${entity.name}" instead of "actions". This also aligns with previous review feedback discussing that 'actions' is not universally true in every case.

♻️ Proposed fix
-                    aria-label={`${entity.name} actions`}
+                    aria-label={`More options for ${entity.name}`}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx` at line
247, Update the aria-label on the entity actions control in EntityListItem to
use the consistent “More options for ${entity.name}” wording, matching the
tooltip and GridHeaderActions behavior; leave the surrounding action handling
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx`:
- Line 247: Update the aria-label on the entity actions control in
EntityListItem to use the consistent “More options for ${entity.name}” wording,
matching the tooltip and GridHeaderActions behavior; leave the surrounding
action handling unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 510c8a2e-8d09-4c60-acc3-bd47eba322d3

📥 Commits

Reviewing files that changed from the base of the PR and between 7139e8c and 77cc557.

📒 Files selected for processing (2)
  • apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
  • apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx

@djhi
djhi merged commit cea246d into supabase:master Jul 24, 2026
32 checks passed
@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1784883072)

Score Average Improvements Regressions
Completeness 100% (+2pp) 2 🟢 -
Conciseness 41.3% (-5pp) 4 🟢 9 🔴
Correctness 68.2% (-1pp) 3 🟢 3 🔴
Goal Completion 81.4% (-1pp) 4 🟢 4 🔴
Knowledge Usage 100% (+5pp) 1 🟢 -
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Tool Usage 74.5% (+2pp) 2 🟢 1 🔴
Docs Faithfulness 69.2% (+2pp) 3 🟢 2 🔴
Safety 97.5% (+7.000000000000001pp) 1 🟢 -
Time_to_first_token 2.7tok (-0.6tok) 23 🟢 6 🔴
Llm_calls 7.26 (-0.11) 9 🟢 14 🔴
Tool_calls 3.15 (+0.2) 10 🟢 11 🔴
Errors 0.08 (+0.08) - 1 🔴
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 20674.54tok (-2712.53tok) 17 🟢 8 🔴
Prompt_cached_tokens 7697.66tok (+258.94tok) 15 🟢 7 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 630.95tok (+33.92tok) 15 🟢 14 🔴
Completion_reasoning_tokens 99.38tok (+2.2tok) 11 🟢 15 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 21305.49tok (-2678.61tok) 20 🟢 9 🔴
Estimated_cost 0$ (0$) 20 🟢 8 🔴
Duration 14.81s (-2.96s) 24 🟢 5 🔴
Llm_duration 10.87s (-2.2s) 23 🟢 6 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants