Return to decisions list after inline approve/reject #131

Merged
hannah-vernon merged 1 commit from feature/decisions-inline-review-return into dev 2026-09-23 17:19:54 -05:00
Owner

What does this PR do?

Improves the decisions review UX: approving or rejecting a decision from the /decisions inline actions now redirects back to the decisions list, preserving the active filters, sort, and page, with the reviewed row rebadged approved or rejected, instead of landing on the decision detail page and requiring a Back click. This makes sequential review of many decisions much faster.

  • The three inline review forms carry a returnTo hidden field set to the current list URL (CurrentListPath, which already backs the step-up prompt return path).
  • ReviewDecisionAsync validates returnTo as a local path and uses it for both the step-up-gate return path and the success/error redirect. Absent or non-local values fall back to the decision detail page, so the DecisionDetail page forms (which send no returnTo) keep their prior behaviour of staying on the detail page.
  • The list already renders reviewed rows with an approved/rejected badge (ReviewLabel/ReviewCss), so no new UI state was needed; the row simply shows its outcome once the list re-renders.
  • Local-path validation reuses AdminAuthEndpoints.SafeReturnPath, refactored to accept a caller-supplied fallback so the single validation implementation is shared rather than duplicated (guards against open redirect: rejects non-local, scheme-relative, and CR/LF values).

Fixes #

How was this tested?

  • dotnet build Viegard.slnx - 0 errors, 0 warnings
  • dotnet test (AdminApi suite) - 224 passed, including two new tests: inline review with a valid list returnTo redirects to that list URL; a non-local returnTo falls back to the decision detail page and is not honoured
  • Manually tested on ___

Checklist

  • I have read the Contributing Guide
  • Changes are focused - one logical change per PR
  • Documentation updated (ARCHITECTURE.md admin description, AGENT-README.md)
  • New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md (no new dependencies)
  • No secrets, credentials, or real infrastructure identifiers in the diff
  • No commented-out code or debug leftovers
## What does this PR do? Improves the decisions review UX: approving or rejecting a decision from the `/decisions` inline actions now redirects back to the decisions list, preserving the active filters, sort, and page, with the reviewed row rebadged approved or rejected, instead of landing on the decision detail page and requiring a Back click. This makes sequential review of many decisions much faster. - The three inline review forms carry a `returnTo` hidden field set to the current list URL (`CurrentListPath`, which already backs the step-up prompt return path). - `ReviewDecisionAsync` validates `returnTo` as a local path and uses it for both the step-up-gate return path and the success/error redirect. Absent or non-local values fall back to the decision detail page, so the DecisionDetail page forms (which send no `returnTo`) keep their prior behaviour of staying on the detail page. - The list already renders reviewed rows with an approved/rejected badge (`ReviewLabel`/`ReviewCss`), so no new UI state was needed; the row simply shows its outcome once the list re-renders. - Local-path validation reuses `AdminAuthEndpoints.SafeReturnPath`, refactored to accept a caller-supplied fallback so the single validation implementation is shared rather than duplicated (guards against open redirect: rejects non-local, scheme-relative, and CR/LF values). Fixes # ## How was this tested? - [x] `dotnet build Viegard.slnx` - 0 errors, 0 warnings - [x] `dotnet test` (AdminApi suite) - 224 passed, including two new tests: inline review with a valid list `returnTo` redirects to that list URL; a non-local `returnTo` falls back to the decision detail page and is not honoured - [ ] Manually tested on ___ ## Checklist - [x] I have read the Contributing Guide - [x] Changes are focused - one logical change per PR - [x] Documentation updated (ARCHITECTURE.md admin description, AGENT-README.md) - [x] New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md (no new dependencies) - [x] No secrets, credentials, or real infrastructure identifiers in the diff - [x] No commented-out code or debug leftovers
Approving or rejecting a decision from the /decisions inline actions now
redirects back to the decisions list, preserving the active filters, sort,
and page, with the reviewed row rebadged approved or rejected, instead of
landing on the decision detail page and requiring a Back click.  This makes
sequential review of many decisions much faster.

The inline forms carry a returnTo hidden field set to the current list URL.
ReviewDecisionAsync validates it as a local path and uses it for both the
step-up-gate return path and the success/error redirect.  Absent or
non-local returnTo values fall back to the decision detail page, so the
DecisionDetail page forms (which send no returnTo) keep their prior
behaviour.

The local-path validation is the shared AdminAuthEndpoints.SafeReturnPath,
refactored to accept a caller-supplied fallback so the single validation
implementation is reused rather than duplicated.

Docs updated: ARCHITECTURE.md (admin description), AGENT-README.md.

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!131
No description provided.