Anchor decisions review to next row and use a fixed flash toast #132

Merged
hannah-vernon merged 1 commit from feature/decisions-review-scroll-ux into dev 2026-09-23 18:35:17 -05:00
Owner

What does this PR do?

Two friction points in rapid sequential decision review, reported from operating the /decisions queue.

  1. Scroll retention. After an approve/reject the full-page redirect returned the viewport to the top of a long queue, so the operator had to scroll back to their place. Each decision row now carries id="decision-{id:N}" and the inline review forms' returnTo anchors to the next still-reviewable row (self when it is the last, no fragment when none), so the redirect lands on the row acted on next. The fragment passes SafeReturnPath (leading /, no // or CRLF) and survives the step-up redirect. scroll-margin-top keeps the anchored row clear of the top so the just-reviewed badge stays visible; a prefers-reduced-motion-gated tr:target highlight marks it.

  2. Layout shift. The success banner shifted the list when it collapsed its box after a few seconds. FlashBanner is now a fixed, out-of-flow .flash-toast (top-centre, role="status"), so neither its appearance nor its dismissal moves content. Success toasts fade on opacity only after 6s and pause on hover/focus; errors persist; a manual dismiss button and a reduced-motion variant are included. The shared global .message used by inline notices across Configuration, DecisionDetail, and Account is left unchanged; the toast overrides its animation locally.

Progressive enhancement lives in wwwroot/js/list-review.js (focus the anchored row with preventScroll, wire the dismiss button, guard against a double submit). Everything degrades to server behaviour with scripting off, consistent with the static-SSR posture and the script-src 'self' CSP.

This is UX polish over the prior inline-review change; no new decision record.

How was this tested?

  • dotnet build Viegard.slnx - 0 errors, 0 warnings
  • dotnet test (AdminApi) - 225 pass, including a new test asserting a fragment-bearing returnTo survives the review redirect
  • Manually tested on a local admin instance

Checklist

  • I have read the Contributing Guide
  • Changes are focused - one logical change per PR
  • Documentation updated (README.md / DECISIONS.md / TODO.md / AGENT-README.md, if applicable)
  • New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md
  • No secrets, credentials, or real infrastructure identifiers in the diff
  • No commented-out code or debug leftovers
## What does this PR do? Two friction points in rapid sequential decision review, reported from operating the `/decisions` queue. 1. **Scroll retention.** After an approve/reject the full-page redirect returned the viewport to the top of a long queue, so the operator had to scroll back to their place. Each decision row now carries `id="decision-{id:N}"` and the inline review forms' `returnTo` anchors to the **next** still-reviewable row (self when it is the last, no fragment when none), so the redirect lands on the row acted on next. The fragment passes `SafeReturnPath` (leading `/`, no `//` or CRLF) and survives the step-up redirect. `scroll-margin-top` keeps the anchored row clear of the top so the just-reviewed badge stays visible; a `prefers-reduced-motion`-gated `tr:target` highlight marks it. 2. **Layout shift.** The success banner shifted the list when it collapsed its box after a few seconds. `FlashBanner` is now a fixed, out-of-flow `.flash-toast` (top-centre, `role="status"`), so neither its appearance nor its dismissal moves content. Success toasts fade on opacity only after 6s and pause on hover/focus; errors persist; a manual dismiss button and a reduced-motion variant are included. The shared global `.message` used by inline notices across Configuration, DecisionDetail, and Account is left unchanged; the toast overrides its animation locally. Progressive enhancement lives in `wwwroot/js/list-review.js` (focus the anchored row with `preventScroll`, wire the dismiss button, guard against a double submit). Everything degrades to server behaviour with scripting off, consistent with the static-SSR posture and the `script-src 'self'` CSP. This is UX polish over the prior inline-review change; no new decision record. ## How was this tested? - [x] `dotnet build Viegard.slnx` - 0 errors, 0 warnings - [x] `dotnet test` (AdminApi) - 225 pass, including a new test asserting a fragment-bearing `returnTo` survives the review redirect - [ ] Manually tested on a local admin instance ## Checklist - [x] I have read the [Contributing Guide](../CONTRIBUTING.md) - [x] Changes are focused - one logical change per PR - [x] Documentation updated (README.md / DECISIONS.md / TODO.md / AGENT-README.md, if applicable) - [x] New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md - [x] No secrets, credentials, or real infrastructure identifiers in the diff - [x] No commented-out code or debug leftovers
Rapid sequential decision review had two friction points.  After an
approve/reject the full-page redirect returned the viewport to the top of
a long queue, and the success banner shifted the list when it collapsed
its box after a few seconds.

Scroll retention: each decision row now carries id="decision-{id:N}" and
the inline review forms' returnTo anchors to the next still-reviewable row
(self when last, no fragment when none), so the redirect lands on the row
the operator acts on next.  The fragment passes SafeReturnPath and survives
the step-up redirect.  scroll-margin-top keeps the anchored row clear of the
top; a reduced-motion-gated tr:target highlight marks it.

Layout shift: FlashBanner is now a fixed, out-of-flow .flash-toast
(top-centre, role=status), so neither its appearance nor its dismissal moves
content.  Success toasts fade on opacity only after 6s and pause on
hover/focus; errors persist; a manual dismiss button and a reduced-motion
variant are included.  The shared global .message used by inline notices
elsewhere is left unchanged.

Progressive enhancement in wwwroot/js/list-review.js focuses the anchored row
with preventScroll, wires the dismiss button, and guards against a double
submit; everything degrades to server behaviour with scripting off.

Docs updated (AGENT-README Changes, ARCHITECTURE admin description).  Added a
test asserting a fragment-bearing returnTo survives the review redirect.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hannah-vernon/viegard-sentinel!132
No description provided.