[1227E] - #8858
Conversation
WalkthroughThe path navigator now carries request paths through asynchronous actions and validates them in reducers. Stale successes, failures, and parent-item responses are ignored. Refresh and parent-item 404 recovery only resets to the root when the requested path remains active. ChangesPath-aware navigation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PathRequest
participant pathNavigatorEpics
participant pathNavigatorReducer
PathRequest->>pathNavigatorEpics: request navigation or refresh
pathNavigatorEpics->>pathNavigatorReducer: start fetch with requested path
pathNavigatorEpics->>pathNavigatorReducer: complete or fail with path
pathNavigatorReducer->>pathNavigatorReducer: compare requested path with current path
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
studio-ui/ui/app/src/state/reducers/pathNavigator.ts (1)
152-172: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
pathNavigatorConditionallySetPathis the one flow left out of the new stale-result protection. Every other completion/failure action in this PR now discards results when the navigator has moved on;pathNavigatorConditionallySetPath's round-trip does not, even though it is the action used to recover from a 404 during navigation.
studio-ui/ui/app/src/state/reducers/pathNavigator.ts#L152-L172: addpathtopathNavigatorConditionallySetPathFailed's payload, movecurrentPathimmediately in thepathNavigatorConditionallySetPathcase (mirroringpathNavigatorFetchPath), and guardpathNavigatorConditionallySetPathComplete/FailedwithisStaleResult, as shown in the per-file proposed fix.studio-ui/ui/app/src/state/epics/pathNavigator.ts#L138-L148: once the reducer guard exists, forward the request path throughpathNavigatorConditionallySetPath's completion/failure so this fallback benefits from it.studio-ui/ui/app/src/state/epics/pathNavigator.ts#L384-L387: same change for the secondpathNavigatorConditionallySetPathdispatch site.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@studio-ui/ui/app/src/state/reducers/pathNavigator.ts` around lines 152 - 172, Update studio-ui/ui/app/src/state/reducers/pathNavigator.ts lines 152-172: include path in pathNavigatorConditionallySetPathFailed, set currentPath immediately in pathNavigatorConditionallySetPath, and guard pathNavigatorConditionallySetPathComplete and pathNavigatorConditionallySetPathFailed with isStaleResult. Update studio-ui/ui/app/src/state/epics/pathNavigator.ts lines 138-148 and 384-387 to forward the request path through both pathNavigatorConditionallySetPath completion and failure dispatches.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@studio-ui/ui/app/src/state/reducers/pathNavigator.ts`:
- Around line 152-172: Update
studio-ui/ui/app/src/state/reducers/pathNavigator.ts lines 152-172: include path
in pathNavigatorConditionallySetPathFailed, set currentPath immediately in
pathNavigatorConditionallySetPath, and guard
pathNavigatorConditionallySetPathComplete and
pathNavigatorConditionallySetPathFailed with isStaleResult. Update
studio-ui/ui/app/src/state/epics/pathNavigator.ts lines 138-148 and 384-387 to
forward the request path through both pathNavigatorConditionallySetPath
completion and failure dispatches.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 13a7e10b-be56-4cd7-9307-5647eb3e9b3f
📒 Files selected for processing (3)
studio-ui/ui/app/src/state/actions/pathNavigator.tsstudio-ui/ui/app/src/state/epics/pathNavigator.tsstudio-ui/ui/app/src/state/reducers/pathNavigator.ts
|
@coderabbitai about the outside diff range comment, pathNavigatorFetchPath can move currentPath immediately because navigation is committed. ConditionallySetPath is different: it probes a candidate and only adopts it on success when parent.childrenCount > 0. |
|
Tip For best results, initiate chat on the files or code changes.
I withdraw the outside-diff-range comment. 🐇 ✏️ Learnings added
You are interacting with an AI system. |
https://github.com/craftersoftware/craftercms-e/issues/1227
Summary by CodeRabbit