Feat(RHAI-59554):Added project switch modal changes #10870
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.47) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 485 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.370
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10870"
general
weight: 0.35
lucferbux
Closes RHAI-59554
Problem
Changing the dashboard working project while a feature has unsaved state can discard the user's progress without giving the feature an opportunity to reset its state, reload project-scoped data, or navigate to the new project.
The shared project selector also needs to support feature-owned confirmation behavior without assuming how the project change should be completed. The feature must control the reset, project selection, and navigation sequence.
The selector also had issues with project creation and invalid project routes. Users needed a reliable recovery path when the current route referenced an unavailable project or when no projects were available.
Solution
Extend the shared working-project context and selector contract to support optional feature-owned project-change confirmation handlers.
The shared working-project flow now supports:
The selector UI also fixes the Create project action so that it:
The shared API leaves the actual project transition to the feature-specific callback.
onConfirmis responsible for completing the project change, including any feature reset, project selection, and navigation required by that feature.No API, persistence, RBAC, or data migration changes are included.
Evidence
Focused unit tests were run with:
1. When we have an invalid project in Url and no project
_Before_
<img width="2546" height="1759" alt="image" src="https://github.com/user-attachments/assets/20f08676-ab35-4b55-b2c8-4f4e827b79aa" />
_After_
<img width="2536" height="1764" alt="image" src="https://github.com/user-attachments/assets/a6990e90-06f4-4925-aa0c-0b0bf435051f" />
2. When we have invalid project in url and the create project button was not visible.
_Before_
<img width="2544" height="1764" alt="image" src="https://github.com/user-attachments/assets/ca403efc-7f14-4dbe-9686-4755704a3d01" />
_After_
<img width="2552" height="1756" alt="image" src="https://github.com/user-attachments/assets/68875bfe-6a21-41b8-a351-a9402f3ee824" />
3. Switch modal example of how it would in a component model serving implementation scenario
https://github.com/user-attachments/assets/6081ab72-0e02-4920-97e5-72da2520ca17
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Project changes can now require confirmation, with a description and error details shown before the change is applied. Confirmation can be retried after an error, and the selector cannot be dismissed while confirmation is in progress.
* The Create project action is available on invalid routes. When no projects exist, the selector displays the empty state, including on an invalid route.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->