chore(site): enforce sentence-case UI labels in AgentsPage via Biome plugin#26000
Draft
matifali wants to merge 1 commit into
Draft
chore(site): enforce sentence-case UI labels in AgentsPage via Biome plugin#26000matifali wants to merge 1 commit into
matifali wants to merge 1 commit into
Conversation
…plugin Add a Biome GritQL plugin scoped to src/pages/AgentsPage non-test files that flags Title Case in label-bearing JSX attributes (label/title/sectionLabel/aria-label) and label:/title: object properties. Fix the residual violations it surfaces (API key, Custom headers, User OIDC identity, Force on, Default on, Default off) and document the convention in site/AGENTS.md.
matifali
commented
Jun 2, 2026
Comment on lines
+9
to
+10
| "src/pages/AgentsPage/**/*.ts", | ||
| "src/pages/AgentsPage/**/*.tsx", |
Member
Author
There was a problem hiding this comment.
Scoping this to a single area for now, and we can expand this to the full frontend in a follow-up.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#25941 converted AgentsPage UI labels to sentence case by hand. Nothing stops Title Case from creeping back in. This adds a lint gate so the linter catches it instead of reviewers.
It's a Biome GritQL plugin scoped to
src/pages/AgentsPage(non-test files) that flags Title Case in label-bearing JSX attributes (label/title/sectionLabel/aria-label) andlabel:/title:object properties. It rides the existingbiome lint, so there's no new lint step or dependency, and it shows up in-editor too.Note
This is a deliberate gate, not full coverage. It catches the attribute/property-shaped labels (~75% of what #25941 fixed) with near-zero false positives. Labels rendered as JSX text (
<label>API Key</label>) or built from variables/ternaries are not caught: distinguishing those from ordinary prose needs matching all text, which floods false positives (measured below). Treat it as defense-in-depth, not a guarantee.Changes
Add
site/biome-rules/use-sentence-case-labels.grit(diagnostic-only; Biome plugins can't autofix yet).Wire it into
site/biome.jsoncviaoverrides, scoped to AgentsPage non-test files (verified: 0 leakage elsewhere).Fix the residual violations the gate surfaces:
ProviderForm,MCPServerAdminPanel(×2)MCPServerAdminPanelMCPServerAdminPanelMCPServerAdminPanelAllowlist one false positive (the
Cmd/Ctrl+Entershortcut label).Document the convention in
site/AGENTS.md.Labels are display-only (
value/htmlForare separate), and no story/test asserts the changed strings, so nothing downstream breaks.Validation
Ran the rule against the exact before/after commits of #25941:
biome lint --error-on-warnings src/pages/AgentsPagetsc -p .Decision log: why gate-only, and what full coverage would cost
I prototyped both the scoped structural rule and a max-coverage variant and measured them against #25941's before/after commits.
Coverage vs. noise
The casing regex looks at characters, not meaning, so it can't tell a UI label from a sentence that legitimately contains a proper noun (
OpenAI,WebSocket), a CSSfont-familyvalue, or an error message. Pushing to 100% recall means gating CI on legitimate prose and maintaining an allowlist of most English sentences. That's a precision-vs-recall wall, so this PR picks precision.The 6 misses are all JSX children text (
<TableHead>Cache read</TableHead>) or computed strings (cond ? "Edit model" : "Add model") — shapes a cheap structural rule can't target without matching all text.Perf (
--profile-rules): the GritQL plugin is the single most expensive rule (~5.1s summed across 1733 files vs ~176ms for the next rule). Scoping it to AgentsPage keeps the real cost small; it's diagnostic-only and beta, so scope matters. Note: capturing-group regex(a|b)silently matches nothing in Biome's GritQL; non-capturing(?:a|b)is required.Follow-ups (not in this PR):
TableHead,TooltipContent,SettingsHeader) to lift coverage toward ~90%.Test plan
cd site && pnpm exec biome lint --error-on-warnings src/pages/AgentsPageis cleanlabel="Foo Bar"under AgentsPage and confirmbiome lintflags it*.stories.tsx/*.test.tsxRelated to #25941.