Restore search-result row highlight in CmuxSettingsUI

Merged
AZ
6mo ago
+687-146

What

When you search in Settings and click a result, the navigated-to row should flash an accent-colored rounded border (the "find me" pulse). The legacy in-app settings window did this; the SPM reimplementation (CmuxSettingsUI) kept the search-to-scroll path but dropped the highlight, and the rows were never anchored, so even the scroll-to-center quietly no-oped.

How

Ports the legacy affordance into the package:

  • SettingsSearchHighlight.swift adds SettingsSearchHighlightState, its environment key, the settingsSearchAnchor(s) view modifiers, and the pulsing-border TimelineView modifier (same fade curve as legacy).
  • SettingsSearchIndex.anchorID(forSettingsPath:) maps a row's dotted cmux.json path to the sidebar/search anchor id. The map is built automatically from the curated entries' dotted synonym tokens, so there's no second hand-maintained id table.
  • SettingsCardRow resolves the path it already declares via configurationReview into that anchor id, tags itself with .id(...), and pulses when it's the active target.
  • SettingsWindowRoot injects the index and arms the highlight (anchor + token + start time) on every highlighting navigation request, mirroring legacy applySettingsNavigation.

No new keyboard shortcuts, no app-target changes; the behavior lives entirely in the settings package.

Test

swift test on CmuxSettingsUI covers the new resolver: the "Show Branch + Directory in Sidebar" path resolves to its sidebar hit anchor, resolved anchors always correspond to a real indexed entry, and unknown paths resolve to nil.

Visual one-to-one parity with the legacy highlight is verified by dogfooding a tagged build (search a query, click a hit, confirm the row scrolls into view and pulses the accent border).

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.


Summary by cubic

Restores the search-result highlight in CmuxSettingsUI so clicking a result scrolls to and pulses the exact row or section. Also fixes the Settings window not reopening after close.

  • Bug Fixes

    • Search shows only real, reachable rows; headers/custom blocks highlight; duplicate anchors resolved; navigation uses an eager detail stack and a single scroll for reliable centering/pinning.
    • Rows map cmux.json paths to stable anchors; explicit anchors for action/picker/custom rows; fixed the "Sidebar Branch Layout" synonym; restored anchors for Terminal Config, Desktop Notifications, Browsing History, and Reset Palette; titles match row labels.
    • Settings window reliably reopens after close; removed temporary DEBUG window-state probes; ignored local artifacts/.
  • Refactors

    • Removed unused settingsSearchAnchor(_:); highlight state/index symbols are internal to avoid app-target clashes.
    • Tests: added bidirectional SettingsRowAnchorResolutionTests with anchor-uniqueness checks; extended SettingsSearchIndexTests; added DEBUG-only ':all' search sentinel; lazy-loaded the keyboard-shortcuts list for faster open.

Summary by CodeRabbit

  • New Features

    • Rows now expose search anchors (explicit or derived) so search results can scroll to and momentarily highlight rows with a pulsing accent.
    • Section headers carry section identifiers so headers can be targeted/highlighted.
    • When no search index is present, rows opt out gracefully.
  • Tests

    • Added tests validating path→anchor resolution, anchor reachability, and unknown-path handling.
  • Content

    • Expanded searchable synonym terms for several curated settings.

Review Change Stack