Skip to content

Findings in a shared page region name the region ("site footer") instead of listing every page #846

Closed

Description

@nc9

A finding that sits in a shared page region (the site footer, header, navigation or a sidebar) is reported as a list of every page it was found on. The same "Sign in" link in the header of a 53-page site produces "49 pages affected" and a 49-row list, which hides the real message: there is one thing to fix, in one place.

The section classifier (#2307) now labels where each link sits, and link findings already carry per-page sections (sources, #837). Use that to say where the problem is.

Change: when the same item occurs in the same template region on most of the pages that have that region, report it once, scoped to the region: "In the site footer, on 49 of 53 pages: 'Sign in'". No page list in the compact formats; html keeps the list collapsed; json keeps the bounded list for tools. When an item sits in the page content, or in a region on only a few pages, it keeps its page list.

Region scope is computed at report time from data already stored: the item's section (from sources[].sections, or a new section on the item for page-scope rules such as a11y/link-text) and the number of pages that have that region (structure.sections). The denominator is the pages that have the region, not all pages, so a footer missing on some pages does not hide the finding.

First slice of rules: a11y/link-text, links/broken-links, links/broken-external-links, links/weak-internal-links, links/redirect-chains, links/anchor-text, links/tel-mailto and content/stale-copyright (footer). Others follow. No detection, severity or score change: only how a finding is located and displayed.

Acceptance Criteria

  • An item found in a template region (header, footer, navigation, sidebar) on at least the documented share of the pages that have that region is shown once as scoped to the region ("In the site footer, on 49 of 53 pages"), with no per-page list in markdown, text, llm and console, and a collapsed list in html
  • The share is a named, documented constant (start at 80% of pages that contain the region) and is the same in every format
  • An item in the page content, or in a region present on few pages, keeps its page list and its section phrase
  • Rules in the first slice record the section of the offending element, and a11y/link-text (a page-scope rule) does too, matching the element to the classifier's placement
  • Different faulty items in the same region stay separate; the same item in two different regions stays separate
  • json carries the scope (region, pages with the item, pages with the region) next to the bounded page list; detections, severities and scores are unchanged on the golden baseline
  • Reports without section data (older stored crawls, classifier off) show today's page lists
  • docs/reports.mdx, docs/configuration/output.mdx and each changed rule page describe the wording and the threshold, and the CHANGELOG has an entry
  • A private issue covers the cloud publish schema for the new item fields

Activity

  1. added
    enhancement
    size: L
    rules
    on Oct 16, 2026
  2. added theissue type on Oct 28, 2026
  3. nc9 commented on Oct 31, 2026

    @nc9
    ContributorAuthor

    Closing, with one change to the first slice. Checked against main (5387823):

    • Met, with code and tests: the region line ("In the site footer, on 49 of 53 pages") with no page list in markdown, text, llm and console and a collapsed list in html, the named 80% share (REGION_SCOPE_MIN_SHARE) with a two page minimum, the same share in every format, items in page content or in a region on few pages keeping their list and section phrase, separate items staying separate, scope beside the bounded list in json and xml, today's lists without section data, and the docs (docs/reports.mdx, docs/configuration/output.mdx, the rule pages) and CHANGELOG entry (packages/report/src/region-scope.ts, region-scope-846.test.ts and region-sections-846.test.ts, 41 tests).
    • Golden baseline: the Audit engine golden tests job is green on main at 5387823 (CI run 41154915491).
    • Spec note: links/weak-internal-links is taken out of the first slice. Its item is the target page ("this page has one inbound link"), so every item is a different page and there is no repeated item to scope to a region. It keeps recording where the one link sits (meta.sections), and its page list stays. The other rules of the slice record the section of the offending element and are scoped (a11y/link-text, links/broken-links, links/broken-external-links, links/redirect-chains, links/anchor-text, links/tel-mailto, content/stale-copyright).
    • The cloud publish schema for the new fields is covered by the private issues squirrelscan/repo#2921 (item sources, closed) and #2923 (the structure block the region wording needs).

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: L

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions