← Back to Pull requests

Mocks: Backport mock user switcher from v19 #24487

Open
unknown opened this pull request with 183 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 05, 2026 14:40 UTC
Author

Description

Backports the mock user switcher from v19/dev, so it isn't lost when v17/dev is merged up to v18 and v19.

In the mocked backoffice, the current user was always the first user of the mock data set. A mock set can now opt in to userSwitcher, and when it does, a User button appears in the header next to the mock set switcher. Pick a user from it and the backoffice reloads as that user, with their own permissions, sections and start nodes. The choice is remembered, and it falls back to the first user if the remembered one isn't in the current set.

It's turned on for the default and kitchenSink sets, which are the two v17 sets with several users. The v19-only sets that use it (blocksReusableContent and languagePermissions) don't exist on v17.

[!NOTE]

Once this is in place, we can update #24149 _(Mock Examples header-app)_ accordingly.

How to test?

1. Run npm run dev in src/Umbraco.Web.UI.Client and open the backoffice with the mocked API.
2. With the Default mock set, click the User button in the header and pick a different user. The page reloads and the user button, the current user's name in the user menu and the visible sections should match the user you picked.
3. Switch to the Kitchen Sink set from the Mock button and repeat step 2.
4. Switch to the Documents set. The User button should not be shown, and the current user is the first user of the set.

Diff: 183 lines (+137 / -46) across 2 files Reviewer: claude[bot] Review duration: 9m
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 183 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.312
Real PR Conversation Timeline
1 comments
"Review active on #24487"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.6% (MEDIUM) · Higher = larger blast radius
35.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19% · Safe to merge
19%