← Back to Pull requests

fix: stop lightning css from lowering logical properties in prod builds #10277

Closed
unknown closed this pull request without merging on Oct 19, 2026 11:56 UTC
View on GitHub
unknown unknown commented on Oct 15, 2026 20:15 UTC
Author

<!-- Tracker (linked, not auto-closing): https://redhat.atlassian.net/browse/RHOAIENG-100823 -->

Problem

In production builds, PatternFly card titles nested inside a card header regain their 24px inline padding, so any layout that places the title beside other content (e.g. the home page "Task shortcuts" cards, where the title sits next to the section icon and description in one column) shows the title indented relative to its description. The deployed CSS is byte-identical to this repo's production build, so the defect is fully reproducible locally. Notably, only the dev server is unaffected — the bug exists solely in minimized production output.

https://redhat.atlassian.net/browse/RHOAIENG-100823

Solution

rspack.LightningCssMinimizerRspackPlugin() with no options defaults to targets: ['fully supports es6'], which makes Lightning CSS lower every CSS logical property (padding-inline-start, …) into physical padding-left/padding-right plus :lang(rtl…) fallback pairs. The lowering inflates the selector specificity of PatternFly's card child padding rule from (0,1,0) to (0,2,0), so it ties with — and, by later source order, beats — PatternFly's contextual .pf-v6-c-card__header .pf-v6-c-card__title { padding: 0 } rule.

This disables the logicalProperties transform in every production rspack config that still had the bare minimizer (the host frontend plus the agent-ops, data-connect-hub, data-registry, eval-hub, gen-ai, maas, mlflow, and model-serving modules). automl and autorag already carry the identical setting from #9860, which fixed the same symptom for those two modules; this change extends it to the remaining build pipelines so the whole product ships consistent CSS. Logical properties are kept as-is in the output, which is safe for the browsers RHOAI supports (Chrome 87+, Edge 88+, Firefox 66+, Safari 15+).

No markup, component, or SCSS changes are involved — the affected components render correctly as authored once the minimizer stops rewriting their stylesheets.

Evidence

  • Built the host with the production pipeline and inspected the output: before the change, the PatternFly chunk contained ~5,200 :lang() fallback rules and a headless-Chrome computed-style check on the task-group card DOM reported padding-left: 24px on the card title; after the change, the whole build contains zero :lang() rules and the same check reports padding-left: 0px, while the card header and body keep their designed 24px padding.

  • Added a Cypress mock regression test (home.cy.ts) asserting the task-group card title's computed padding-left/padding-right are 0px. The mock CI pipeline builds with the production rspack config (cypress:server:build), so the assertion runs against the minimized CSS where the bug lives (it cannot be caught by dev-server runs, which skip the minimizer). Ran it against the full production pipeline (all 12 workspace builds + federation mock servers): home.cy.ts — 3 passing, including the new padding assertion.

  • turbo run lint passes for the frontend, cypress, and all touched package workspaces (0 new errors).

  • All 12 production workspace builds succeed with the changed configs (the test:cypress-ci build phase completed with 0 errors).
  • 🤖 Generated with Claude Code

    Manual testing confirmed the fix for the task title alignment:

    <img width="1340" height="850" alt="image" src="https://github.com/user-attachments/assets/4d383135-0c1d-4a06-8528-13fec37c5b43" />

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Bug Fixes
    Production styling now preserves directional spacing rules, helping task-group cards and other layouts retain consistent padding after optimization.
    Tests
    Added a home-page check that verifies task-group card titles keep the expected horizontal spacing.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 501 lines (+375 / -126) across 6 files Reviewer: lucferbux Review duration: 5260m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 501 lines diff across 6 files
    0.48
    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.372
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10277"
    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: 47.5% (MEDIUM) · Higher = larger blast radius
    47.5%
    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: 18.8% · Safe to merge
    18.8%