Skip to content

fix(staged): underline search matches instead of filling them - #1063

Merged
matt2e merged 5 commits into
mainfrom
ugly-highlighting-in-search
Nov 13, 2026
Merged

matt2e merged 5 commits into
mainfrom
ugly-highlighting-in-search

Conversation

@matt2e

@matt2e matt2e commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

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:

  • Project search (sidebar rows and home grid cards): matches get an amber underline and switch to the primary text colour.
  • Find in a note and in a session chat: matches get the same underline. Only the current match is tinted.
  • Find in a diff: same treatment, so matched tokens keep their syntax colour.
  • Command palette: matches in the project name, repo path and repo alias follow the same rule.

Details

  • All four surfaces now read theme tokens. --search-match-bg is replaced by --search-match-accent. --search-current-match-bg is kept and recoloured.
  • The diff viewer no longer picks its highlight colours from a prefers-color-scheme media query, so a light diff theme on a dark-mode Mac gets the right colours.
  • The differ app's static defaults are updated to the renamed token.

Testing

  • The underline was rendered for project search, note find and diff find in headless WebKit against a fixture backend, in dark and light themes. Match positions were measured before and after and nothing moved.
  • Not run in the Tauri desktop window. The test suite was not run on the final tree.
  • The command palette and differ changes were never rendered. The underline on the palette's alias pill may sit close to the pill's bottom border.

🤖 Generated with Claude Code

matt2e and others added 3 commits November 12, 2026 17:40
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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T06:44:57.238085Z 9b2379a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

matt2e and others added 2 commits November 13, 2026 11:03
… 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>
@matt2e
matt2e merged commit 4cc7a04 into main Nov 13, 2026
9 checks passed
@matt2e
matt2e deleted the ugly-highlighting-in-search branch November 13, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant