Skip to content

feat(accessibility): about 3x more issues per call, and the whole report's counts first - #526

Open
Aaryan430 wants to merge 2 commits into
fix/a11y-report-tags-page-linkfrom
feat/a11y-more-issues-per-call
Open

Aaryan430 wants to merge 2 commits into
fix/a11y-report-tags-page-linkfrom
feat/a11y-more-issues-per-call

Conversation

@Aaryan430

Copy link
Copy Markdown
Collaborator

Stacked on #525 (fix/a11y-report-tags-page-link): this PR's diff shows only its own changes.

Why

fetchAccessibilityIssues handed out 10–17 web issues per call, so a mid-size report took a dozen calls and a large one about 30. There were three reasons:

  • The page held 10,000 characters of issue JSON, about 3k tokens.
  • Each issue repeated its rule's text. The rule's description and fix were more than half of every issue.
  • Some HTML snippets were huge. One was 5,882 characters, which took 60% of a page by itself.

Also, nothing gave the whole report at a glance. To answer "how bad is it?", an agent had to page through everything.

What

A. Bigger pages

  • A page holds 30,000 characters of issues, about 8k tokens.
  • That's under Claude Code's 10k-token warning, and under its 50,000-character limit, above which a result is saved to a file instead of shown.

B. Compact issues

  • Each rule's name, description, WCAG criteria, best-practice mark and usual fix are given once per page under rules.
  • An issue keeps its own fix or description only where it differs (colour contrast writes each element's values into its fix). needs_review stays on the issue.
  • A rule's text counts against the page the first time the page names it.
  • Within a severity, issues are listed rule by rule, most common rule first.
  • HTML snippets over 400 characters are cut, with a note of how many more characters the CSV has.
  • Issues are sent as compact JSON, with a note on how to read issues, rules and needs_review.

C. The whole report first

  • The first page, and a scan's answer, start with counts for the whole report:
    • by severity;
    • needing review (excluding issues a person has already confirmed);
    • best practices;
    • by rule (top 20);
    • by page (top 10).
  • Later pages skip the counts.
  • The CSV line says it holds every issue, and to download it when every issue is needed at once.

#525's tags (needs_review, best practice, WCAG criteria) and its dashboard link are kept. Best practice and WCAG criteria now sit on the rule. The tag note keeps #525's correction: only an issue with no needs_review and no best-practice rule is a confirmed WCAG failure. App Accessibility answers are unchanged.

Verified

  • npm run build passes: lint, prettier, 1,615 tests, tsc.
  • Live against production, reading three real scans' full reports through the built code, page by page as an agent would. Each reply is about 24–34k characters.
Scan Issues main / #525 This PR Issues per call (min–max, avg, first call)
a page with one issue for nearly every rule 527 ~31 calls (~17 per call) 8 calls 14–104, avg 66, first 63
storablewebsitedemo.com 125 12 calls 3 calls 8–59, avg 42, first 58
browserstack.com 49 5 calls 1 call the whole report
  • The 527-issue scan's overview matches the dashboard: 61 critical, 225 serious, 193 moderate, 48 minor; 161 need review; 191 best practices. Its page counts (304, 149, 40, 21, 13) match the run summary's counts by URL.
  • The first reply there is about 33.6k characters, roughly 9.6k tokens (estimated at 3.5 characters per token). That's close to Claude Code's 10k-token warning, but under its 50k-character limit.
  • Tests use made-up ids.

🤖 Generated with Claude Code

Aaryan430 and others added 2 commits October 27, 2026 17:22
…ort's counts first

- A page of a web report now holds 30,000 characters of issues (about 8k tokens, under
  Claude Code's 10k-token warning and 50,000-character limit) instead of 10,000.
- Each rule's name, description, WCAG criteria, best-practice mark and usual fix are said
  once per page under rules; an issue keeps its own fix or description only where it
  differs, and needs_review stays on the issue. The rule text counts against the page the
  first time the page names the rule, a severity's issues are listed rule by rule (most
  common rule first), HTML snippets over 400 characters are cut (saying how much the CSV
  has), and the issues are compact JSON.
- The first page (and a scan's answer) starts with the whole report's counts: by
  severity, needing review, best practices, by rule (top 20) and by page (top 10). The CSV
  line says it holds every issue.

Ported from feat/a11y-issues-per-call (99ff7dd), onto #525's per-issue tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into feat/a11y-more-issues-per-call

# Conflicts:
#	src/tools/accessibility.ts
#	tests/tools/accessibilityIssueRules.test.ts
#	tests/tools/accessibilityScanOutput.test.ts
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited), Workspace UI (inherited); Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 9fde34c9-21e1-4f29-a4f4-951b315ee57e

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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.

1 participant