Skip to content

feat(desktop): support searching project names in global search (#2033) - #2035

Merged
NanmiCoder merged 1 commit into
mainfrom
feat/desktop-search-projects
Nov 26, 2026
Merged

NanmiCoder merged 1 commit into
mainfrom
feat/desktop-search-projects

Conversation

@NanmiCoder

Copy link
Copy Markdown
Owner

Summary

Fixes #2033

Adds project name search to the desktop global search palette (Cmd+K / Ctrl+K / sidebar search trigger) and locates/expands the chosen project in the sidebar:

  • Project matching (projectSearch.ts): Indexes non-archived workspace projects and archive-only projects consistently with Sidebar.groupByProject, matching case-insensitively across custom display names, original folder names, and normalized paths (/ and \), ranked by exact > prefix > title substring > folder name > path match > recency, with highlight ranges for both title and path excerpts.
  • Global Search Modal (GlobalSearchModal.tsx): Displays matching projects immediately in a Projects section above Chats without waiting for debounced full-text session search, preserves project results when chat search has zero hits or fails, supports unified keyboard navigation across both sections, and resolves custom project display names / Windows paths on session rows.
  • Sidebar Locate (Sidebar.tsx): Selecting a project closes the modal, expands a collapsed sidebar, exits archive/task views, restores a hidden project and merges preference persistence atomically in a single write, expands a collapsed project group, scrolls the project header button into view, and focuses + briefly highlights it.
  • i18n: Updated search.global.placeholder and added projectsTitle, chatsTitle, projectSessionCountOne, projectSessionCount, and projectArchivedOnly across all 5 locale files (en, zh, zh-TW, jp, kr).

Feature Quality Contract

  • Changed surface: desktop
  • Tests added or updated:
    • desktop/src/components/search/projectSearch.test.ts (6 unit tests covering aggregation, archive-only projects, stale projectSessionTotals exclusion, ranking, highlights, Windows/CJK paths, and limits)
    • desktop/src/components/search/GlobalSearchModal.test.tsx (26 component tests including 5 new tests for instant project matching, custom/original/archive-only matching, cross-section keyboard navigation, error resilience, and standalone fallback)
    • desktop/src/components/layout/Sidebar.test.tsx (139 tests including 3 new end-to-end sidebar search-to-locate tests covering task-view exit + hidden-project restore atomic persistence, collapsed project/sidebar expansion, and header scroll/focus)
  • Coverage evidence:
    • bun run check:coverage: passed (5 passed, 0 failed)
  • E2E / live-model evidence:
    • bun run check:agent-flow: passed (9 passed, 0 failed)
    • bun run check:agent-e2e: passed (mock-llm 34 passed / 0 failed, replay 21 passed / 0 failed)
    • Live-model smoke: not run (UI-only search/navigation change; no provider/runtime changes)
  • Known risk / rollback:
    • Pure desktop renderer/sidebar UI change; safe to revert via a single commit revert with no persisted schema changes.

Verification

  • I ran the relevant local checks, or explained why they do not apply.
  • I added or updated same-area tests for every production behavior change.
  • I ran the checks selected by bun run check:impact; if I claim PR-ready/full validation, I also ran bun run verify.
  • New or changed executable production lines meet the changed-line coverage threshold, or the blocker/maintainer override is documented.
  • I attached or summarized the quality report path, JUnit/log artifact path, and pass/fail/skip counts.
  • I ran deterministic E2E/contract checks for cross-boundary changes. Live-model evidence is attached when a trusted maintainer ran it, otherwise it is explicitly marked not run.

Risk

  • This PR does not touch CLI core paths, is authored by a CODEOWNER, or has maintainer approval for allow-cli-core-change.
  • Production code changes include matching tests, or have maintainer approval for allow-missing-tests.
  • Coverage baseline/threshold changes have maintainer approval for allow-coverage-baseline-change.
  • Any quarantine-policy change has maintainer approval; deterministic provider/chat contract tests were not quarantined.
  • Provider/runtime changes are covered by offline mock/fixture contract tests; live smoke was run by a trusted maintainer or explicitly deferred.

@github-actions

Copy link
Copy Markdown

PR quality triage

Changed areas: area:desktop

CLI core policy: No CLI-core policy block detected.

Missing-test policy: No missing-test policy block detected.

Coverage baseline policy: No coverage-baseline policy block detected.

CLI core files:

  • none

Coverage policy files:

  • none

Required check plan:

  • See PR Quality / scope-plan; it is the single source of truth for selected jobs.

Test coverage signals:

  • No obvious missing-test signal from changed paths.

Risk notes:

  • No special risk notes from changed paths.

Hard merge gates come from the deterministic GitHub Actions contract lanes above.

@NanmiCoder
NanmiCoder merged commit f9cdd70 into main Nov 26, 2026
20 checks passed
@NanmiCoder
NanmiCoder deleted the feat/desktop-search-projects branch November 26, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[功能] 桌面端搜索时只能搜索会话的内容,能否支持搜索项目名

1 participant