← Back to Pull requests

Port the appearance switcher to the base shell distributions #10727

Closed
unknown closed this pull request without merging on Nov 23, 2026 08:32 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 20:11 UTC
Author

Closes: https://redhat.atlassian.net/browse/RHAI-23072
Closes: https://redhat.atlassian.net/browse/RHAI-19116

Problem

The host dashboard ships the masthead appearance switcher (color scheme + contrast mode) with Felt + Glass as the default contrast, but the base shell distributions (MaaS Portal, RHAII) only had a light/dark toggle and deliberately stayed solid until they had a way to turn Glass off (RHAI-23072).

Solution

Ports the switcher from the host's HeaderTools to the base shell's ShellHeader - the same Select with Color scheme (System/Light/Dark) and Contrast mode (System/Default/High contrast/Glass) groups. The base ThemeContext gains the system color scheme with OS prefers-color-scheme tracking and a one-time derivation from the legacy app-shell.theme key. With a switcher available, the distributions' contrast default flips from solid to system, matching the host: Felt + Glass unless the OS prefers reduced transparency or more contrast. The pre-paint scripts apply the same resolution on first paint, including the dark class from the color scheme.

Evidence

  • Unit tests: 10 across the base ThemeContext - system color scheme resolution, legacy theme derivation, Glass default with OS overrides, persistence + change events, live OS media changes.

  • Verified end to end in the MaaS Portal mock build: the switcher renders with both groups, toggles light/dark and Glass/solid correctly (screenshots in the thread).

  • Type-check and lint clean.
  • Screenshots attached: switcher open, light/dark + Glass.

    <img width="2880" height="1610" alt="pr-dark-glass-full" src="https://github.com/user-attachments/assets/49f42200-134f-404d-9b03-d0930943f55d" />
    <img width="2880" height="1610" alt="pr-light-glass-full" src="https://github.com/user-attachments/assets/6e613422-b3bf-4c09-9e06-43911287a9cf" />
    <img width="2880" height="1610" alt="pr-switcher-open-full" src="https://github.com/user-attachments/assets/6259f83b-e983-40c2-beb1-d39c8a738e73" />

    [RHAI-23072]: https://redhat.atlassian.net/browse/RHAI-23072?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

    Diff: 276 lines (+207 / -69) across 3 files Reviewer: jenny-s51 Review duration: 15141m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 276 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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
    Diff Size diff_size
    0.336
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10727"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 39.6% (MEDIUM) · Higher = larger blast radius
    39.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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.6% · Safe to merge
    15.6%