Skip to content

fix(ui): refresh edit page state on route changes#311

Merged
mpaulosky merged 5 commits into
devfrom
sprint/19-squad-memory-sync
May 12, 2026
Merged

fix(ui): refresh edit page state on route changes#311
mpaulosky merged 5 commits into
devfrom
sprint/19-squad-memory-sync

Conversation

@mpaulosky

Copy link
Copy Markdown
Owner
  • reset loading state at parameter changes so route updates fetch and render correctly
  • add bUnit coverage for post ID parameter switch regression

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com## Summary

Closes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ Feature (non-breaking change that adds functionality)
  • ♻️ Refactor (no behavior change, code cleanup/restructure)
  • 🧪 Tests (new or updated tests only)
  • 📝 Docs (README, XML docs, comments)
  • ⚙️ Infra/CI (GitHub Actions, Aspire, NuGet, deployment)
  • 🔒 Security (auth, permissions, secrets, headers)
  • 💥 Breaking change (existing behavior changes)

Domain Affected

  • 🏗️ Architecture / domain logic / CQRS → Aragorn required
  • 🔧 Backend (handlers, repositories, API endpoints, MediatR) → Sam required
  • ⚛️ Frontend (Blazor components, Razor pages, CSS, JS) → Legolas required
  • 🧪 Unit / bUnit / integration tests → Gimli required
  • 🧪 E2E / Playwright / Aspire integration tests → Pippin required
  • ⚙️ CI/CD / GitHub Actions / NuGet / Aspire AppHost → Boromir required
  • 🔒 Auth0 / authorization / security-relevant changes → Gandalf required
  • 📝 Docs / README / XML docs → Frodo required

Self-Review Checklist

Code Quality

  • I ran dotnet build MyBlog.slnx --configuration Release — 0 errors, 0 warnings
  • I ran dotnet test MyBlog.slnx --configuration Release --no-build — all pass
  • No TODO/FIXME left unless tracked in a follow-up issue (link it)
  • No secrets, API keys, or credentials committed

Architecture

  • New handlers follow the Command/Query/Handler/Validator naming conventions
  • New handlers are sealed
  • Domain layer has no references to Web or Persistence.* projects
  • Result<T> / ResultErrorCode used for expected failures (no exception-driven control flow)
  • DTOs are records in Domain.DTOs; Models are in Domain.Models
  • No DTO types embedded in Model classes

Tests

  • New code has corresponding unit tests
  • Integration tests use domain-specific collections ([Collection("XxxIntegration")])
  • No test compares two IssueDto.Empty / CommentDto.Empty instances directly

Security (check if security-relevant)

  • New endpoints have appropriate RequireAuthorization / policy applied
  • No MarkupString used with user-supplied content
  • No user input reflected in MongoDB queries without sanitization

Merge Readiness

  • Branch is up to date with main (no merge conflicts)
  • CI checks are green (do not request review while checks are pending/failing)
  • PR description is complete — reviewers should not have to ask what this does

Screenshots / Evidence

Notes for Reviewers

Boromir and others added 4 commits May 11, 2026 17:42
- reset loading state at parameter changes so route updates fetch and render correctly
- add bUnit coverage for post ID parameter switch regression

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eter changes

Before this fix, OnParametersSetAsync only reset _isLoading. If a first
load succeeded (populating _model), then a second route-parameter change
triggered a fetch that failed or returned null, the old _model data
remained visible alongside the new error message.

Changes:
- Edit.razor: add _model = null, _error = null, _concurrencyError = false
  at the top of OnParametersSetAsync so all display state is clean before
  every fetch cycle
- EditAclTests: add two regression tests covering the stale-content paths:
  • EditClearsStaleContentOnErrorAfterSuccessfulLoad
  • EditClearsStaleContentOnNullAfterSuccessfulLoad

All 92 bUnit tests pass (was 90 before). Gate 4 fully green.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 01:01
@github-actions github-actions Bot added the squad Squad triage inbox — Lead will assign to a member label May 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ PR Added to Squad Triage Queue

This PR has been labeled with squad and added to the triage queue.

Next steps:

  • The squad Lead will review and assign to an appropriate team member
  • A squad:member label will be added after triage

If you know which squad member should handle this, you can add the appropriate squad:member label yourself.

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.

Pull request overview

Fixes a Blazor Edit page stale-state regression when navigating between routes that reuse the same component instance (same page, different {Id}), and adds bUnit coverage to prevent regressions.

Changes:

  • Reset _model, _error, _concurrencyError, and _isLoading at the start of OnParametersSetAsync() so route parameter changes always trigger a clean fetch/render cycle.
  • Add bUnit regression tests covering parameter-switching, error-after-success, and null-after-success behaviors.
  • Consolidate/remove Squad decision/history documentation (but the PR currently includes future-dated entries and a large unrelated decision-log block).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Web/Features/BlogPosts/Edit/Edit.razor Resets edit page UI state on route parameter changes before fetching the new post.
tests/Web.Tests.Bunit/Features/EditAclTests.cs Adds bUnit regression coverage for parameter changes and stale-content clearing scenarios.
.squad/decisions/inbox/legolas-pr295-review-fixes.md Removes an inbox decision file (content appears consolidated elsewhere).
.squad/decisions/decisions.md Adds a large block of decision-log content; currently includes future-dated entries.
.squad/agents/sam/history.md Adds a learning entry related to Blazor component reuse/loading state.
.squad/agents/legolas/history.md Adds a historical entry related to the stale-state fix and tests.
.squad/agents/gimli/history.md Adds historical verification notes for Edit redirect/parameter-change coverage.
.squad/agents/boromir/history.md Adds historical notes related to prior routing/review context.
.squad/agents/aragorn/history.md Adds review/triage history; currently includes a future-dated entry.

Comment on lines +2379 to +2385
---

### 2026-05-11T18:48:17Z: Architecture — PostAuthor value object for #296

**By:** Aragorn
**Issue:** #296

@github-actions

Copy link
Copy Markdown
Contributor

Test Results Summary

365 tests  ±0   364 ✅ ±0   20s ⏱️ ±0s
  6 suites ±0     1 💤 ±0 
  6 files   ±0     0 ❌ ±0 

Results for commit 7b795db. ± Comparison against base commit a1ad0c9.

@mpaulosky
mpaulosky merged commit dc34ce9 into dev May 12, 2026
17 checks passed
@mpaulosky
mpaulosky deleted the sprint/19-squad-memory-sync branch May 12, 2026 01:11
@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.67%. Comparing base (a1ad0c9) to head (7b795db).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #311   +/-   ##
=======================================
  Coverage   83.67%   83.67%           
=======================================
  Files          47       47           
  Lines        1256     1256           
  Branches      152      152           
=======================================
  Hits         1051     1051           
  Misses        146      146           
  Partials       59       59           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mpaulosky added a commit that referenced this pull request May 12, 2026
#313)

## Summary\n- align Blog Post author claim extraction to
nameidentifier/emailaddress claims with safe fallbacks\n- add
IsPublished checkbox behavior (default false) through Create/Edit forms,
commands, and handlers\n- fix AppHost seed author field names to match
Mongo EF mapping and prevent missing Id document errors\n- add handler
tests for publish/unpublish paths\n\nCloses #311

---------

Co-authored-by: Boromir <boromir@squad.dev>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Boromir <lead-organizer@squad.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

squad Squad triage inbox — Lead will assign to a member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants