label: Skip highlights while masked - #3142
Merged
huacnlee merged 4 commits intoSep 20, 2026
Merged
Conversation
huacnlee
previously approved these changes
Sep 20, 2026
huacnlee
enabled auto-merge (squash)
September 20, 2026 13:14
huacnlee
disabled auto-merge
September 20, 2026 13:14
huacnlee
enabled auto-merge (squash)
September 20, 2026 13:15
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.
Description
Masked labels replace source text with bullets. Applying secondary-text or matching highlight ranges to the masked string can reuse source byte offsets, including offsets that are not valid UTF-8 boundaries in the displayed bullet string and can panic during rendering. Styled ranges can also reveal information about the structure of concealed text.
Skip highlight measurement entirely while a Label is masked. This keeps every bullet visually uniform, avoids unnecessary matching and range conversion work, and leaves unmasked highlighting behavior unchanged.
The Label Story now includes a Mask toggle in the Highlighting section so the interaction can be tested directly. The existing balance example is restored to its original content.
Public API
No API signatures change. Label::masked(true) now suppresses all highlight styles, including matching highlights and primary/secondary color segmentation.
Behavior Change
Masked labels no longer preserve visible highlight colors. This is intentional: concealed text should not expose matching or segment boundaries. Unmasking restores the configured highlights.
How to Test
AI-assisted implementation with Codex; diff reviewed and regression checks run.