Repository navigation
fix(staged): underline search matches instead of filling them - #1063
Merged
Merged
Conversation
Match highlighting was drawn by three unrelated rules in three different yellows. In project search the matched word sat in the faint label colour under a mustard wash, which made it the least readable text on the row. The diff viewer's light values followed the operating system's colour scheme rather than the diff theme. Implement the "Underline" option from the search highlighting note. A match now keeps its surface and gains a solid amber line beneath it, and only the current match carries a fill. - Replace the `--search-match-bg` token with `--search-match-accent` (`theme.search.matchBg` becomes `matchAccent`). The current-match background becomes a wash of the same amber. - Project search draws the matched word in the primary text colour over the line. - Note and session find, and the diff viewer, read the theme tokens instead of hard-coded yellows. The diff viewer's `prefers-color-scheme` override is removed. - Update the differ app's static defaults to the renamed token. It shares the diff viewer and the theme module. The command palette from #1061 is not on this branch. It still reads `--search-match-bg` and needs to adopt the new token once this branch meets main. Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…search Signed-off-by: Matt Toohey <contact@matttoohey.com>
The command palette from #1061 filled its matches with `--search-match-bg`. The underline restyle of search highlighting removed that token, so once the two met, a palette match in a project name, repo path or repo alias had no styling at all. Give those matches the treatment project search uses in `ProjectMatchReason.svelte`: no fill, the matched run in the primary text colour, and a solid line in `--search-match-accent` beneath it. The repo path and alias sit in muted colours, so the primary colour lifts the match out of them the same way it does for the match reason on the same line. The project name is already primary and only gains the line. No other reader of `--search-match-bg` or `search.matchBg` remains after merging main. `--search-current-match-bg` is still defined and still drives the current match in note find, session find and the diff viewer. Not rendered: the change was made without running the tests or the screenshot harness. Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… rule The underline restyle of search highlighting (#1063) wrote the match underline as `text-decoration: underline 2px var(--search-match-accent)`. WebKit before Safari 26.2 rejects a thickness inside that shorthand, and because the value carries a `var()` the build passes it through unchanged, so on those engines the whole declaration is dropped and a match has no styling at all. The desktop app runs on the system WebKit and the Tauri config sets no minimum macOS version. - Write the underline as `text-decoration-line`, `-thickness` and `-color` longhands in every rule. Safari has accepted these since 12.1. - Replace the two identical scoped rules in `ProjectMatchReason.svelte` and `CommandPaletteRow.svelte` with one global `mark.label-match` rule in `app.css`, next to `mark.search-match`. The branch exists because three highlight rules drifted apart; two more copies could drift the same way. - Pull the palette's alias-pill underline up to a 0.5px offset. At 1.5px it sat flush on the pill's bottom border and read as part of it. - Size the diff viewer's underline offset in `em`. At small `--code-font-size` values in differ the fixed 3px offset put the line into the row below. - Tighten the palette tests to `mark.label-match`, since the class is now the only thing that styles a palette match. Verified with `pnpm -s check`, Prettier, and the palette, project search and text highlight test files (263 tests). Not rendered in the app. Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
After the underline restyle, the current match differs from the others only by a 30 percent amber wash. In the diff viewer that wash replaces the changed-character tint, which is also amber at nearly the same strength, so on a modified line the current match and its changed neighbours are almost the same colour (contrast ratio 1.05 in the light theme). In the light theme the wash is faint on plain lines and in notes too. Add a 1px `box-shadow` ring in `--search-match-accent` around the current match, in note find, session find and the diff viewer. The accent stays readable over every surface, which is why a ring works where a stronger wash would not. The radius becomes uniform so the ring closes cleanly. Separate commit so it can be dropped without touching the longhand and shared-rule change before it. Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Summary
Search matches were drawn by three unrelated rules in three different yellows. In project search the matched word sat under a mustard wash on dimmed text and was the least readable word on the row.
This replaces the filled highlight with an underline everywhere matches are marked:
Details
--search-match-bgis replaced by--search-match-accent.--search-current-match-bgis kept and recoloured.prefers-color-schememedia query, so a light diff theme on a dark-mode Mac gets the right colours.Testing
🤖 Generated with Claude Code