Skip to content

fix(web): restore biome compliance in the documents view - #1671

Merged
MODSetter merged 1 commit into
MODSetter:devfrom
Yigtwxx:fix/web-biome-format
Aug 8, 2026
Merged

fix(web): restore biome compliance in the documents view#1671
MODSetter merged 1 commit into
MODSetter:devfrom
Yigtwxx:fix/web-biome-format

Conversation

@Yigtwxx

@Yigtwxx Yigtwxx commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

biome-check-web runs npx @biomejs/biome@2.4.6 check --diagnostic-level=error . over the entire surfsense_web tree, so the twelve diagnostics currently sitting in the documents view fail Frontend Quality on every PR that touches anything under surfsense_web/, regardless of what that PR changed. This restores a clean run.

On current dev (339fe12):

$ npx @biomejs/biome@2.4.6 check --diagnostic-level=error .
components/documents/DocumentsEmptyState.tsx:12:4     lint/a11y/useAriaPropsSupportedByRole
components/documents/DocumentsEmptyState.tsx:37:4     lint/a11y/useSemanticElements
components/documents/DocumentsEmptyState.tsx          format
components/documents/DocumentsSearchResults.tsx:3:1   assist/source/organizeImports
components/documents/DocumentsSearchResults.tsx:26:77 lint/a11y/useSemanticElements
components/documents/DocumentsSearchResults.tsx       format
components/documents/DocumentsView.tsx                format
components/documents/FolderPickerDialog.tsx:3:1       assist/source/organizeImports
components/documents/HighlightedText.tsx              format
hooks/use-documents-view-model.ts:3:1                 assist/source/organizeImports
lib/documents/documents-view-model.ts                 format
tests/helpers/ui/connector-popup.ts                   format
Found 12 errors.

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 configured lineWidth: 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 carried aria-label on a role-less <div>, which useAriaPropsSupportedByRole rejects.
  • DocumentsEmptyState.tsx:37 and DocumentsSearchResults.tsx:26role="status", which useSemanticElements wants expressed as <output>.

<output> has the implicit status role and accepts aria-label / aria-busy / aria-live, so what a screen reader announces is unchanged. role="status" is dropped where it became redundant, and block is added on the two that replaced block-level elements (<output> is inline by default) so layout is untouched.

Testing

$ cd surfsense_web && npx @biomejs/biome@2.4.6 check --diagnostic-level=error .
Checked 1066 files in 797ms. No fixes applied.

Clean across the whole tree — the exact command the pre-commit hook runs.

npx tsc --noEmit reports 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/server codegen, ElectronAPI globals, and similar) and CI does not run tsc, 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 via biome check --write, and three accessibility improvements that replace non-semantic elements with the native <output> element to satisfy a11y rules (useAriaPropsSupportedByRole and useSemanticElements). The accessibility changes maintain the same screen reader behavior while achieving Biome compliance.

⏱️ Estimated Review Time: 15-30 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/components/documents/DocumentsEmptyState.tsx
2 surfsense_web/components/documents/DocumentsSearchResults.tsx
3 surfsense_web/components/documents/DocumentsView.tsx
4 surfsense_web/components/documents/HighlightedText.tsx
5 surfsense_web/components/documents/FolderPickerDialog.tsx
6 surfsense_web/hooks/use-documents-view-model.ts
7 surfsense_web/lib/documents/documents-view-model.ts
8 surfsense_web/tests/helpers/ui/connector-popup.ts

Need help? Join our Discord

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
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3222d192-b7c7-41d4-9030-862ccff07f1f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@MODSetter
MODSetter merged commit dad74d9 into MODSetter:dev Aug 8, 2026
6 of 9 checks passed
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.

2 participants