fix(components): reach every typographic component with the cascade - #266
Merged
Merged
Conversation
53 tasks
LeadcodeDev
force-pushed
the
fix/table-column-widths
branch
from
September 22, 2026 06:12
14fbbe3 to
5b62def
Compare
LeadcodeDev
force-pushed
the
fix/cascade-all-typographic
branch
from
September 22, 2026 06:12
e17149b to
2fecd21
Compare
LeadcodeDev
force-pushed
the
fix/table-column-widths
branch
from
September 22, 2026 08:36
5b62def to
19e4361
Compare
LeadcodeDev
force-pushed
the
fix/cascade-all-typographic
branch
from
September 22, 2026 08:36
2fecd21 to
ce65750
Compare
LeadcodeDev
force-pushed
the
fix/table-column-widths
branch
from
September 22, 2026 08:46
19e4361 to
575be98
Compare
LeadcodeDev
force-pushed
the
fix/cascade-all-typographic
branch
from
September 22, 2026 08:46
ce65750 to
2216be2
Compare
LeadcodeDev
changed the base branch from
fix/table-column-widths
to
chantier/audit-2026-09
September 22, 2026 08:54
The first pass at making `cascade::inherit_from` reach painters special-cased `Component::Text` inside `LegacyPaintDispatcher::dispatch`. That left the other seventeen components that read `color`/`font-*` off their own un-cascaded `self.style` still blind to inherited typography — `gradient_text`, `caption`, `rich_text`, `badge`, `callout`, `counter`, `divider`, `icon`, `kbd`, `list`, `marquee`, `notification`, `number_wheel`, `pill_nav`, `table`, `terminal`, `tooltip`. Worse than the missing coverage, a per-variant `match` arm means the cascade applies to exactly the variants someone remembered to list: the next component added would silently miss it. That is the same defect class the audit reported elsewhere in this crate, reintroduced by the fix for it. Refs #220
LeadcodeDev
force-pushed
the
fix/cascade-all-typographic
branch
from
September 22, 2026 09:09
2216be2 to
b4ede56
Compare
LeadcodeDev
added a commit
that referenced
this pull request
Sep 22, 2026
…266) The first pass at making `cascade::inherit_from` reach painters special-cased `Component::Text` inside `LegacyPaintDispatcher::dispatch`. That left the other seventeen components that read `color`/`font-*` off their own un-cascaded `self.style` still blind to inherited typography — `gradient_text`, `caption`, `rich_text`, `badge`, `callout`, `counter`, `divider`, `icon`, `kbd`, `list`, `marquee`, `notification`, `number_wheel`, `pill_nav`, `table`, `terminal`, `tooltip`. Worse than the missing coverage, a per-variant `match` arm means the cascade applies to exactly the variants someone remembered to list: the next component added would silently miss it. That is the same defect class the audit reported elsewhere in this crate, reintroduced by the fix for it. Refs #220
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Severity Medium, category correctness. Location:
crates/rustmotion-components/src/lib.rs:727Impact
The first pass at making
cascade::inherit_fromreach painters special-casedComponent::TextinsideLegacyPaintDispatcher::dispatch. That left the other seventeen components that readcolor/font-*off their own un-cascadedself.stylestill blind to inherited typography —gradient_text,caption,rich_text,badge,callout,counter,divider,icon,kbd,list,marquee,notification,number_wheel,pill_nav,table,terminal,tooltip. Worse than the missing coverage, a per-variantmatcharm means the cascade applies to exactly the variants someone remembered to list: the next component added would silently miss it. That is the same defect class the audit reported elsewhere in this crate, reintroduced by the fix for it.Fix
Replace the special case with
Component::with_cascaded_style, an exhaustive match over all sixty variants with no wildcard arm, so adding a variant without classifying it is a compile error.dispatchandcomponent_intrinsiccall it uniformly with no per-variant knowledge. The clone goes through a serde round-trip rather thanClone, becauseCaption's inner types are notCloneand live in another crate. A membership test pins the classification so an existing variant cannot be silently reclassified either.Evidence the audit read
Part of the September 2026 audit remediation chantier. Refs #220 (RM-07B).