Skip to content

Peer review pages and the Reviews tab on house components (#2658) - #2706

Merged
jh-RLI merged 4 commits into
developfrom
feature-2658-peer-review-pages
Oct 13, 2026
Merged

jh-RLI merged 4 commits into
developfrom
feature-2658-peer-review-pages

Conversation

@jh-RLI

@jh-RLI jh-RLI commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2658. Closes #2674.

Part of the stage-2 design spec #2632. No migration, no deploy step.

What changes

Reviewer and contributor pages (dataedit:peer_review_reviewer / _create / _contributor)

  • Both <style> blocks are gone, and so is the stylesheet summary.js injected into the head. All three were copies of one sheet in BS3/Material colours. The rules now live in theming/scss/layouts/_review.scss and read only tokens: --bs-success/--bs-warning/--bs-danger for the review states, plus --oep-text-muted, --oep-border-strong, --oep-surface and --oep-surface-hover.
  • The Summary tab's state pills are house badges (success, warning, danger, neutral). The "NEW" mark on a suggestion and the suggested value use the badge's warning mix.
  • Every action carries btn and a role on itself. The container rules in _review.scss (.review__btn button, .review__description button, .review__btn-nav button, .review-bar__action--* button) are deleted.
    • Primary: Submit, and Finish, which the script shows only while Submit is disabled.
    • Secondary: Save Progress, Quit, Accept, Suggest, Deny, the field arrows, and the two field saves.
    • Link: the "Open Peer Review process" opener and the history toggle.
  • The field saves were btn-warning and the script flipped them between yellow and red with the chosen state. updateSubmitButtonColor() is deleted, so the saves keep one role.
  • The arrow buttons are named "Previous field" and "Next field" through aria-label, invisible text. The phase-2 notice uses the alert include's markup (role="status", no inline width).
  • The contributor page's progress ring uses the reviewer's SVG markup (viewBox + cx/cy/r), so one rule draws both. Before, the contributor page set r/cx/cy in its own CSS.
  • The tabs were already Underline tabs and house dropdowns #2648's underline tabs, and the alert()s were already toasts after One confirm dialog and one toast region replace every native dialog #2643. Neither needed work here.

Reviews tab (login:reviews)

  • Profile Reviews tab: the Delete button on the active review does nothing #2674:
    • Delete asks the house confirm dialog (data-confirm*, danger) and posts from a small inline module on the tab. The tab no longer loads opr_reviewer.js, which never bound the button and logged five errors here.
    • The module sends the page's own CSRF token, because nothing else on the tab sets the cookie. My first version reused sendJson and got 403 "CSRF cookie not set" in Chrome.
    • It deletes the review the card shows (latest_active), not latest_review_id, which was the last review of any status. That context variable is removed.
    • A refused request or a network failure shows a danger toast.
  • "All reviews" was always empty. Since Refactor user groups into organizations #2261 renamed groups to organizations, ReviewsView passed *_organizationed keys while the template read *_grouped. The view's keys are restored. The contributor waiting line read contributor_reviewed_active.latest.table, which does not exist, and now reads contributor_reviewed.latest_active.table.
  • Statuses are badges: neutral and still lowercase for the active state, success for Completed, info for Ongoing. They used to be pills.
  • The two empty lists use the empty_state component (compact).
  • "Show history" is a disabled btn-secondary btn-sm. Its placeholder menus ("Action / Another action") are deleted rather than restyled as house dropdowns: the trigger is disabled, so they could never open. The spec names "peer-review history" among the dropdowns, which is the one departure from a spec line here.
  • The info popover loses its inline styles, gains an aria-label, and uses Bootstrap 5's data-bs-trigger.
  • _profile.scss loses the pill rule and the .profile-rvw__item-history button { btn-light dropdown-toggle } rule.

Lint and scans

  • The three peer review pages join RESTYLED_PAGES, and the comment line that kept them off is removed. PageFixture now carries an open review by the fixture user, with the table's metadata as a real review holds it. Without that metadata the reviewer route 500s, the trap Underline tabs and house dropdowns #2648 hit. This is also what gives the Reviews tab, already on the list, buttons to lint at all; before, it passed with nothing on it.
  • The template and theme status-colour scans now cover all five colours. Peer review held the last btn-warning and the last @extend .btn-light.

Tests

  • dataedit/tests/test_peer_review_pages.py (4):
    • no <style> in either template;
    • the field saves are secondary;
    • each bar action carries its role;
    • the arrows have names.
  • login/tests/test_reviews_tab.py (5). It used to assert Fix six develop defects found by the design census #2634's "the reviewer script is a module" and now asserts the tab loads none of the review page's scripts. Also covered:
    • Delete carries the dialog attributes and the active review's id;
    • the response sets the CSRF cookie;
    • "All reviews" lists the review;
    • statuses are badges.
  • base + login + dataedit: 1,361 tests. The first run found two failures. One was the Fix six develop defects found by the design census #2634 test above, rewritten. The other: the new fixture's self.review shadowed MovedPagesTest's own empty review and changed a develop-captured snapshot. The fixture's attribute is now peer_review, and the snapshot is unchanged. The touched modules are green after the review fixes (test_page_lint, test_page_header_moved, test_reviews_tab, test_peer_review_delete, test_peer_review_pages, test_tabs_and_dropdowns, test_confirm_dialog). I did not run the whole suite again after the last commit.
  • vitest: the three dataedit/static/peer_review suites pass (12 tests). They ran under a scratch vitest 3 on Node 20, because the repo's vitest needs Node 22. The happy-dom suites fail to load under that runner on develop's checkout too, so that failure is the runner.

Checks

  • Homepage benchmarks/homepage/compare.mjs: 8/8 byte-identical, whole page, nothing masked, before the branch and after the last theme rebuild.
  • check_catalogue: complete, 19 entries. theming/literal_scan.mjs: 0.
  • The theme is rebuilt with pinned sass@1.77.0 + bootstrap@5.2.0. Develop's sources rebuild develop's bootstrap.min.css byte for byte, and stock_tokens.css is unchanged.
  • In headless Chrome against a dev copy:
    • reviewer, contributor and Summary tab render with no console errors;
    • the Reviews tab's Delete opens the dialog, confirming posts 200, the page reloads and the review is gone.

Left alone, for the maintainer

  • At 390 px the reviewer page is 571 px wide on develop too. The .review grid is 50/50 at every width (measured on develop by stashing the branch). That is layout work, not this ticket's.
  • Accept / Suggest / Deny show no chosen state and have no aria-pressed, the same as on develop. They are a choice; the segmented control (btn-check + btn-outline-primary) would fit if that is wanted.
  • The buttons the script builds (Finish, history toggle, Summary badges) are not pinned by a test. The page lint reads server HTML only.
  • The review-state colour map exists three times: .opr-history__item--*, the Summary dots, and STATUS_META. The "NEW" mark repeats the badge's warning mix instead of extending it, because it is a pseudo-element.
  • .reviewer-item is dead and is Delete the legacy theme layer and dead code #2660's.

Took develop after #2704 (33bc40f25)

  • The only conflict was the changelog; both entries are kept.
  • bootstrap.min.css merged cleanly, and the merged sources rebuild it byte for byte.
  • On the merged tree, base plus the touched login/dataedit modules pass (276 tests).

🤖 Generated with Claude Code

jh-RLI and others added 4 commits October 13, 2026 14:15
The reviewer and contributor pages lose their duplicated <style> blocks,
and the Summary tab the stylesheet its script injected: the styles move
into theming/scss/layouts/_review.scss on tokens, and the Summary tab's
states render as house badges. Every action carries btn + a role on
itself; the container-selector rules in _review.scss and _profile.scss
are deleted. The field saves are primary (no more yellow/red toggle,
updateSubmitButtonColor is gone). The arrow buttons get names.

Reviews tab (login:reviews): Delete asks the confirm dialog and posts
from the tab's own small script with the page's CSRF token, instead of
loading the whole reviewer module, which never bound it (#2674).
"All reviews" lists again: ReviewsView passed *_organizationed keys
since the groups -> organizations rename while the template read
*_grouped. Statuses are badges, empty lists the empty state, the
placeholder history menus are gone.

The peer review pages join RESTYLED_PAGES with a review in the
fixture; the status-colour scans now cover all five colours.

Closes #2674

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The field saves are secondary: Submit (or Finish, which replaces it
  while Submit is disabled) is the page's one primary action.
- The Reviews tab's Delete toasts a network failure too, not only a
  refused request.
- The Summary's suggested value keeps a warning-tinted colour, mixed
  from tokens as the badge does.
- The info popover uses Bootstrap 5's data-bs-trigger.
- The Reviews tab's tests live in login/tests/test_reviews_tab.py; the
  CSRF check reads the response's cookie, not the script's text; the
  duplicate opening-tag helper is element_with_id; summary.js drops an
  import its deleted function was the only user of.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…review-pages

# Conflicts:
#	versions/changelogs/current.md
@jh-RLI jh-RLI self-assigned this Oct 13, 2026
@jh-RLI
jh-RLI merged commit 4b3195a into develop Oct 13, 2026
6 of 7 checks passed
@jh-RLI
jh-RLI deleted the feature-2658-peer-review-pages branch October 13, 2026 12:33
@jh-RLI jh-RLI mentioned this pull request Oct 13, 2026
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.

Profile Reviews tab: the Delete button on the active review does nothing Peer review pages on house components

1 participant