fix(web): restore biome compliance in the documents view - #1671
Conversation
The biome-check-web pre-commit hook runs `biome check .` over the whole surfsense_web tree, not just the files a PR touches, so the twelve diagnostics sitting in the documents view fail Frontend Quality for every unrelated PR that happens to change anything under surfsense_web. Six files were formatted at a narrower line width than the configured lineWidth of 100 and three had unsorted imports; both are pure `biome check --write` output. The remaining three are a11y rules with no automatic fix. Two elements carried `role="status"` where useSemanticElements wants the native `<output>`, and the loading skeleton had an `aria-label` on a role-less `<div>`, which useAriaPropsSupportedByRole rejects. All three become `<output>`, which has the implicit status role and accepts the labels, so the announced behaviour is unchanged; `block` keeps the two that replaced block-level elements laid out as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CpY4T39RzhWyUV9qQpPWw7
|
@Yigtwxx is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Summary
biome-check-webrunsnpx @biomejs/biome@2.4.6 check --diagnostic-level=error .over the entiresurfsense_webtree, so the twelve diagnostics currently sitting in the documents view fail Frontend Quality on every PR that touches anything undersurfsense_web/, regardless of what that PR changed. This restores a clean run.On current
dev(339fe12):The same twelve show up in the Frontend Quality logs of unrelated PRs — for example #1648, which touches three other web files and inherits all of them.
Changes
Nine mechanical (
biome check --write). Six files were formatted at a narrower line width than the configuredlineWidth: 100, and three had unsorted imports. No hand edits.Three a11y rules with no automatic fix. All three resolve to the native
<output>element:DocumentsEmptyState.tsx:12— the loading skeleton carriedaria-labelon a role-less<div>, whichuseAriaPropsSupportedByRolerejects.DocumentsEmptyState.tsx:37andDocumentsSearchResults.tsx:26—role="status", whichuseSemanticElementswants expressed as<output>.<output>has the implicitstatusrole and acceptsaria-label/aria-busy/aria-live, so what a screen reader announces is unchanged.role="status"is dropped where it became redundant, andblockis added on the two that replaced block-level elements (<output>is inline by default) so layout is untouched.Testing
Clean across the whole tree — the exact command the pre-commit hook runs.
npx tsc --noEmitreports the same 38 pre-existing errors before and after; none of them are in the eight files touched here. They are unrelated to this change (missing@/.source/servercodegen,ElectronAPIglobals, and similar) and CI does not runtsc, so they are left alone.High-level PR Summary
This PR fixes 12 Biome linting errors in the documents view that were blocking Frontend Quality checks across all PRs touching the
surfsense_web/directory. The changes include nine mechanical formatting and import organization fixes applied viabiome check --write, and three accessibility improvements that replace non-semantic elements with the native<output>element to satisfy a11y rules (useAriaPropsSupportedByRoleanduseSemanticElements). The accessibility changes maintain the same screen reader behavior while achieving Biome compliance.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
surfsense_web/components/documents/DocumentsEmptyState.tsxsurfsense_web/components/documents/DocumentsSearchResults.tsxsurfsense_web/components/documents/DocumentsView.tsxsurfsense_web/components/documents/HighlightedText.tsxsurfsense_web/components/documents/FolderPickerDialog.tsxsurfsense_web/hooks/use-documents-view-model.tssurfsense_web/lib/documents/documents-view-model.tssurfsense_web/tests/helpers/ui/connector-popup.ts