zai-org / zai-org/feedback

[建议 / Feature] 会话搜索增加「仅按标题」匹配模式,降低全文搜索噪音 (title-only search for sessions)

Open
#628 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

功能描述 / Feature description

会话(任务)搜索目前是全文匹配,希望能增加**"仅按标题"的匹配模式**,让用户可以按名字快速定位目标会话。

现状 / Current behavior

在桌面版的历史/任务搜索框中输入关键词时,搜索同时匹配标题和会话内容。实测(桌面版 3.11.2,从应用代码确认)底层查询为:

LOWER(title) LIKE ? OR LOWER(searchable_text) LIKE ?   -- searchable_text ≈ 正文前 200K 字符

由于正文内容远多于标题,一个常见词会命中大量会话正文,结果列表被内容匹配淹没,很难按名字找到目标会话。设置面板里对该功能的描述也是 "Search recent tasks by title or content"。

期望 / Expected behavior

提供一种仅匹配会话标题的搜索方式,任一形式均可:

  • 搜索框内的作用域前缀或操作符,例如 title:重构t:重构(现有的 # / @ / > 前缀已用于区分 Tasks / Files / Actions,可在此基础上扩展);
  • 或搜索框旁的"仅标题"开关(类似编辑器的 "Match case" 切换);
  • 或至少在结果排序上让标题命中排在内容命中之前。

为什么有用 / Motivation

  • 会话数量增多后,按名字找会话是高频操作;全文搜索噪音太大,经常需要翻好几页。
  • 现在 Command Center 的 # 前缀只能限定范围,仍会搜正文;聊天输入框 # 弹出的会话选择器虽然只匹配标题,但仅限最近会话,无法覆盖全部历史。

实现建议(供参考) / Implementation hint

  • 后端 queryTaskList 的查询已同时访问 titlesearchable_text 两列,增加一个 matchTitleOnly 查询参数并跳过第二个 LIKE 条件即可;UI 侧在 Command Center 的 scope parser 中加一个前缀(如 title:)即可打通。
  • 另外,CLI 侧的 RPC 目前只有 session/list(参数为 workspace / includeArchived / limit),若能加上 search 参数(或 searchIn: "title" | "title+content"),桌面端和 CLI 用户都能受益。

环境 / Environment

  • ZCode Desktop 3.11.2,Linux (Manjaro)
  • 仓库反馈给 zai-org/feedback,针对 ZCode 桌面版

English summary: Session/task search currently matches title OR message content (LIKE on both columns), so common keywords flood the results with content matches. Please add a title-only match mode — e.g. a title: scope prefix in Command Center, or a "match title only" toggle. Backend hint: queryTaskList already queries both columns; a matchTitleOnly flag skipping the searchable_text LIKE would suffice. Optionally expose search/searchIn params on the session/list RPC.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the mentioned queryTaskList implementation, the Command Center scope parser, and the session/list RPC definition. Trace how search terms reach the title and searchable_text conditions, then define the selected title-only behavior and verify that it works through the relevant desktop or CLI search path.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
api, search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.