fix(ui): refresh edit page state on route changes#311
Merged
Conversation
- 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>
Contributor
🏗️ PR Added to Squad Triage QueueThis PR has been labeled with Next steps:
|
There was a problem hiding this comment.
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_isLoadingat the start ofOnParametersSetAsync()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 | ||
|
|
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. 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:
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com## Summary
Closes #
Type of Change
Domain Affected
Self-Review Checklist
Code Quality
dotnet build MyBlog.slnx --configuration Release— 0 errors, 0 warningsdotnet test MyBlog.slnx --configuration Release --no-build— all passArchitecture
Command/Query/Handler/Validatornaming conventionssealedWeborPersistence.*projectsResult<T>/ResultErrorCodeused for expected failures (no exception-driven control flow)Domain.DTOs; Models are inDomain.ModelsTests
[Collection("XxxIntegration")])IssueDto.Empty/CommentDto.Emptyinstances directlySecurity (check if security-relevant)
RequireAuthorization/ policy appliedMarkupStringused with user-supplied contentMerge Readiness
main(no merge conflicts)Screenshots / Evidence
Notes for Reviewers