Skip to content

fix(studio): treat region flags as decorative by default - #49574

Merged
joshenlim merged 2 commits into
masterfrom
dnywh/region-flag-decorative-a11y
Aug 26, 2026
Merged

joshenlim merged 2 commits into
masterfrom
dnywh/region-flag-decorative-a11y

Conversation

@dnywh

@dnywh dnywh commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Studio accessibility fix.

What is the current behavior?

RegionFlag defaults to alt="", but only some callsites also pass aria-hidden / role="presentation". Decorative flags beside visible region names can still be announced inconsistently.

What is the new behavior?

RegionFlag defaults to aria-hidden when alt is empty, matching how the component is used next to visible region text. Redundant callsite a11y props from #49517 are removed.

To test

  • Open Edge Function observability. Open the Region filter and confirm each option still shows a flag beside the region label. The DOM has aria-hidden on the flag img.
    Open the new project flow region selector. Confirm the selected-region flag still renders without role="presentation".
  • Open New project. Open the region selector and confirm the selected value and menu items still show flags beside the region names. The DOM has aria-hidden on the flag img.

RegionFlag already ships empty alt because it sits beside visible region
labels. Default aria-hidden the same way so callers do not have to
repeat the decorative treatment.
@vercel

vercel Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview Aug 26, 2026 3:39am
studio-staging Ready Ready Preview Aug 26, 2026 3:39am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Aug 26, 2026 3:39am
design-system Skipped Skipped Aug 26, 2026 3:39am
docs Skipped Skipped Aug 26, 2026 3:39am
ui-library Skipped Skipped Aug 26, 2026 3:39am
zone-www-dot-com Skipped Skipped Aug 26, 2026 3:39am

Request Review

@dnywh
dnywh requested a review from a team as a code owner August 26, 2026 03:26
@supabase

supabase Bot commented Aug 26, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@dnywh
dnywh requested a lite review from Copilot August 26, 2026 03:29
@coderabbitai

coderabbitai Bot commented Aug 26, 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 Plus

Run ID: 870a164b-3ee2-48cd-9f33-9ec1ff4a898e

📥 Commits

Reviewing files that changed from the base of the PR and between a288cde and 921cbeb.

📒 Files selected for processing (1)
  • apps/studio/components/ui/RegionFlag.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

RegionFlag now applies aria-hidden only as a fallback for empty alt text. Two usages remove redundant accessibility attributes.

Changes

RegionFlag accessibility

Layer / File(s) Summary
RegionFlag default and call-site cleanup
apps/studio/components/ui/RegionFlag.tsx, apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx, apps/studio/pages/project/[ref]/observability/edge-functions.tsx
RegionFlag applies aria-hidden when alt is empty and no explicit value exists. Two usages no longer set redundant accessibility attributes.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 921cb

This localized accessibility change makes region flags decorative by default while preserving their visual rendering. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: alaister

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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.
Title check ✅ Passed The title clearly and concisely describes the main accessibility change: region flags are decorative by default.
Description check ✅ Passed The description explains the current behavior, new behavior, affected component, and testing steps. It does not include the required CONTRIBUTING.md confirmation or an explicit Additional context sect…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files.

Full details: Description check

Explanation

The description explains the current behavior, new behavior, affected component, and testing steps. It does not include the required CONTRIBUTING.md confirmation or an explicit Additional context section, but the required change details are mostly complete.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dnywh/region-flag-decorative-a11y

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.

Copilot AI 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.

Pull request overview

This PR updates the shared RegionFlag image component in Studio so region flags are treated as decorative by default (empty alt plus aria-hidden), and removes now-redundant a11y props at callsites that display a flag alongside visible region text.

Changes:

  • Default RegionFlag to include aria-hidden (in addition to alt="") so decorative flags aren’t inconsistently announced by assistive technologies.
  • Remove explicit aria-hidden/role="presentation" props from region-flag callsites that render next to visible region labels.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/studio/pages/project/[ref]/observability/edge-functions.tsx Removes redundant aria-hidden on RegionFlag in the region filter option rendering.
apps/studio/components/ui/RegionFlag.tsx Makes RegionFlag decorative-by-default by setting aria-hidden unless overridden.
apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx Removes redundant role="presentation" from RegionFlag in the selected-region display.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Keep decorative-by-default when alt is empty, but do not hide a
flag that a caller has given meaningful alt text.
className="w-5"
region={selectedRegion.code}
/>
<RegionFlag className="w-5" region={selectedRegion.code} />

@dnywh dnywh Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Remove role="presentation" from this and the edge functions callsites. It becomes redundant after alt="" and aria-hidden.

@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (tanstack)

passed  243 passed
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  3 minutes, 45 seconds
commit  921cbeb

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@joshenlim joshenlim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes LGTM!

@joshenlim
joshenlim merged commit 81dfcc9 into master Aug 26, 2026
41 checks passed
@joshenlim
joshenlim deleted the dnywh/region-flag-decorative-a11y branch August 26, 2026 07:05
@github-actions

Copy link
Copy Markdown
Contributor

Braintrust eval report

Evals in progress... ⌛

hunleyd added a commit that referenced this pull request Aug 26, 2026
…for-pitr-archiving-stale

* origin/master: (26 commits)
  chore(docs): add Simon Tomlinson to humans.txt (#49547)
  fix(docs): make code blocks reachable and readable by keyboard and screen reader (#49562)
  feat: update mgmt api docs (#49128)
  fix: display request body Array<object> schema/fields in Management API Reference (#49575)
  Set up feature preview for explorer (#49602)
  docs(troubleshooting): add postgres_changes not delivering guide (#48997)
  chore: Update API types (#49598)
  refactor(studio): fetch MCP tool→FGA map from mgmt-api endpoint (#49225)
  Add go page: Postgres Summit US 2026 contest (#49597)
  Add Lingo.dev customer case study (#49595)
  fix(studio): hide legacy API keys on High Availability projects (#49552)
  [FE-4246] fix(studio): resolve notebook database labels (#49554)
  fix(studio): resolve dirty notebook save conflicts (#49540)
  fix(studio): make menu links reliable (#49584)
  [FE-3717] feat(studio): Multigres cluster topology diagram (#49298)
  feat(www): homepage json-ld, canonical, 404 links (#49533)
  refine role impersonation popover (#49467)
  feat(studio): move read replica creation to a dialog (#49516)
  fix(www): pricing table spacing and sticky offset (#49532)
  fix(studio): treat region flags as decorative by default (#49574)
  ...
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