Skip to content

Reports: one Actions menu per site; Scan again on Issues - #54

Merged
rayraycodes merged 2 commits into
mainfrom
reports-actions-menu
Oct 20, 2026
Merged

rayraycodes merged 2 commits into
mainfrom
reports-actions-menu

Conversation

@rayraycodes

@rayraycodes rayraycodes commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

Reports (routes/Scans.tsx)

  • The "Report" column is now Actions. Each site row has an "Actions" button that opens two links: "Open latest scan" and "Scan again".
  • A site with no completed scan gets the same button with only "Scan again", which starts from its latest scan.
  • "Scan again" no longer sits next to the site name in the sticky Site column.

New RowActionsMenu component

  • Uses the APG disclosure pattern with plain links, the same pattern as ExportMenu (no role="menu").
  • The button's visible text is "Actions"; screen-reader-only text adds the site name. No aria-label.
  • The panel uses position: fixed, so the table's sideways-scrolling area can't clip it.
  • The panel opens upward when there isn't room below. It closes on scroll, resize, a click outside, or when focus leaves.
  • Keyboard:
    • Escape closes the panel and returns focus to the button.
    • ArrowDown on the button opens the panel on the first link.
    • Arrow keys, Home and End move between the links.

ScanAgainLink (new) and Issues

  • ScanAgainLink opens New scan with a report's settings filled in. It is used in the Reports Actions menu and next to "Export report" on Issues.
  • Sign-in (protected) reports don't show it on Issues.

Why

The aim was to put a row's actions in one place, at the end of the row.

For reviewers

  • Design tradeoff (recorded in the rationale comments): "Two links shown in the cell" was offered instead, because the dropdown puts opening the report one extra click away (W3C COGA). The dropdown was chosen. The Issues count link earlier in each row still opens the same report in one click.
  • At 320 px, a few pixels at the left of the Actions button can sit under the sticky Site column when the table is scrolled fully sideways. The Site column (208 px wide) leaves too little room for any action control at that width. The old "Open latest scan" link had the same limit.

Testing

  • Ran make frontend-build, make lint and make typecheck: all clean.
  • uv run pytest tests/ui/test_reports_table.py tests/ui/test_accessibility_axe.py tests/ui/test_control_text_purpose.py: all passing.
  • test_reports_table.py now covers:
    • the "Actions" header;
    • opening the menu with the keyboard;
    • ArrowDown and Tab focus order;
    • axe with the panel open;
    • Escape returning focus to the button;
    • the "Scan again"-only menu for a site with no completed scan.
  • Checked by hand in the browser at 1280 px and 320 px: the panel is not clipped, opens upward near the bottom, and the page does not scroll sideways.

Reports replaces its "Report" column with "Actions": a disclosure
button per site row that opens "Open latest scan" and "Scan again".
A site with no completed scan gets only "Scan again", from its latest
scan. The panel is position: fixed so the table's scroll region cannot
clip it, opens upward near the bottom, and supports Escape, arrow keys,
Home and End like the Export menu.

ScanAgainLink opens New scan with a report's settings filled in. It is
used in the Reports Actions menu and beside Export report on Issues
(not for sign-in reports).
Copilot AI balanced review requested due to automatic review settings October 19, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Scroll and resize dismissal hide focused links without restoring visible keyboard focus.

1 open issue
What changed in this PR

Groups site actions on Reports and adds a reusable Scan again link to Issues.

Changes:

  • Adds a keyboard-accessible Actions disclosure with viewport-aware positioning.
  • Adds Scan again beside export on unprotected reports.
  • Extends Reports tests for menu behavior and accessibility.
File Description
tests/​ui/​test_reports_table.py Tests Actions links, keyboard navigation, and accessibility.
src/​audit/​web/​frontend/​src/​routes/​Scans.tsx Integrates Actions menus into site rows.
src/​audit/​web/​frontend/​src/​routes/​Issues.tsx Adds Scan again for unprotected reports.
src/​audit/​web/​frontend/​src/​components/​ScanAgainLink.tsx Shares the settings-prefilled scan link.
src/​audit/​web/​frontend/​src/​components/​RowActionsMenu.tsx Implements action links, positioning, and dismissal.

Review effort: Balanced

Comment thread src/audit/web/frontend/src/components/RowActionsMenu.tsx
- Scrolling or resizing closes the Actions panel; if focus was on one
  of its links, it now goes back to the Actions button (preventScroll),
  as Escape does, instead of staying on a hidden link.
- Scan again's screen-reader text says "report #N" mid-sentence, the
  sentence case the other controls use (test_control_label_case).
- test_reports_refresh finds the site toggle by its own name; the row's
  "Actions for <site>" button also matched the bare site name.
Copilot AI balanced review requested due to automatic review settings October 20, 2026 16:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review found no unresolved blocking issues; runtime tests were not independently executed.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@rayraycodes
rayraycodes merged commit 6d237bd into main Oct 20, 2026
8 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