Repository navigation
Read the descender guard's class list wherever it is written - #8765
Merged
Merged
Conversation
Repo tests (CPU) is red on main: test_model_selector_trigger_label_uses_leading_tight fails with "could not find ModelSelectorTrigger model-name span". The component is fine. #8445 gave the trigger label a caller override, so the span went from className="..." to className={cn("...", triggerLabelClassName)}. The class list itself did not change: it still carries truncate with leading-tight and no leading-none, which is exactly what the guard exists to require. What broke is the guard. It matched on the JSX attribute syntax, so wrapping the same string in cn() made it find nothing, and its only reaction to finding nothing was to say so. A guard that goes quiet the moment a label grows an override is not guarding much, since taking an override is a normal thing for a label to do. It now reads the class literals wherever they are written and matches on the token set, so both the attribute form and the cn() argument form are covered. The pre-#8445 literal is still matched, so this is not a narrowing.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
added 2 commits
August 14, 2026 02:33
The account-block check next to it keyed on `<div className="...">` for the same reason and would go quiet the same way the moment that div takes an override, so it now shares the one matcher. Selecting on its four specific tokens is what makes reading every literal safe. Behaviour is unchanged: the same single div matches.
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.
Repo tests (CPU)is red on main.test_model_selector_trigger_label_uses_leading_tightfails withcould not find ModelSelectorTrigger model-name span, which blocks every open PR.The component is not the problem
#8445 gave the trigger label a caller override, so the span changed shape:
The class list is byte for byte the same. It still pairs
truncatewithleading-tightand carries noleading-none, which is exactly what this guard exists to require. Nothing regressed in the UI.The guard is
It matched on the JSX attribute syntax:
r'<span\s+className="[^"]*\bmin-w-0\b...'so wrapping the identical string in
cn()made it match nothing, and its only response to matching nothing was to say it could not find the span. A guard that falls silent the moment a label grows an override is not guarding much, since taking an override is an ordinary thing for a label to do.It now collects the class literals wherever they are written and matches on the token set, so both the attribute form and the
cn()argument form are covered.Attribution
Bisected across the eight most recent commits to
model-selector.tsx:Proof the guard can still fail
model-selector.tsxleading-tighttoleading-noneon the labelexpected leading-tight, got: ... truncate font-heading text-ui-16 font-medium leading-none ...text-ui-16totext-ui-15so the label no longer matchescould not find ModelSelectorTrigger model-name span3 passedThe second mutation matters: without it the first would pass vacuously on a file where the label had simply been renamed away.
Not a narrowing: run against the pre-#8445 source at
8d0edc1a4, the new matcher still finds the literal.The sibling check had the same hole
test_sidebar_account_block_uses_leading_tightkeyed on<div className="...">for the same reason, so it would go quiet the moment that div takes an override. Both checks now share one matcher and select on their own token set.Behaviour is unchanged: the same single div matches.
app-sidebar.tsxhas twogroup-data-[collapsible=icon]:hiddendivs and only the account block carriesflex-1, which is what the original required set already selected on.app-sidebar.tsxleading-tighttoleading-noneon the account blockleading-*at allno leading-* class on sidebar account-block parentflex-colso the block no longer matchescould not find sidebar account-block parent div3 passed