Aller au contenu
login
arrow_backRetour aux issues
Youth-Research-Center/PandaPlot #182

Add a real text_disabled theme token instead of borrowing text_hint

ecoDébutant enhancement good first issue

descriptionDescription

## Background `SectionHeader` (`pandaplot/gui/components/common/section_header.py`) needs a color for its disabled/greyed-out appearance, used when a style-tab section (Marker/Fill/Confidence Band) is toggled off. It originally looked up `tokens.get("text_disabled", "#C4C7CE")`, but no `text_disabled` token exists in `theme_manager.py`'s light or dark palettes, so the hardcoded fallback always won — and in dark theme that fallback (`#C4C7CE`) was actually *lighter* than the enabled color (`text_muted`), inverting the intended greyed-out look. As a quick fix (commit `44ecc21`), the lookup was changed to reuse the existing `text_hint` token, which happens to be dimmer than `text_muted` in both themes. This resolves the visual bug but is a borrowed token, not a purpose-built one — if disabled-appearance styling is needed elsewhere later, reusing `text_hint` again would conflate two different semantic meanings ("hint text" vs. "disabled"). ## Proposed follow-up - Add a proper `text_disabled` token to both the light and dark palettes in `pandaplot/services/theme/theme_manager.py`, with an explicit value distinct from (dimmer than) `text_muted` in each theme. - Update `SectionHeader.set_tokens()` to use the new `text_disabled` token instead of `text_hint`. - Add a regression test (extending `tests/gui/components/common/test_section_header.py`) that verifies the disabled color is actually distinct from the enabled color, e.g.: ```python def test_disabled_color_is_visually_distinct_from_enabled_color(): """The existing test only checks that a `:disabled` CSS rule is present in the stylesheet string -- it doesn't verify the color it sets is actually different from the enabled color. This gap let a real bug (disabled color lighter than enabled color in dark theme) ship undetected until a final whole-branch review caught it by inspection.""" header = SectionHeader("Marker") tokens = {"text_muted": "#9AA0AB", "text_disabled": "#5B6270"} header.set_tokens(tokens) assert tokens["text_disabled"] in header.styleSheet() assert tokens["text_disabled"] != tokens["text_muted"] ``` ## Context Surfaced during the final whole-branch review of the chart-type-compatibility-and-UX-polish phase (branch `worktree-chart-series-type-phase-1`, following PR #180). Not fixed as part of that phase since it requires a small theming decision (the actual token values) rather than a pure bug fix.
codeOuvre sur GitHub