Skip to content

fix(vscode): localize untitled session search - #10580

Open
dvd233 wants to merge 7 commits into
QwenLM:mainfrom
dvd233:fix/vscode-localized-untitled-search
Open

dvd233 wants to merge 7 commits into
QwenLM:mainfrom
dvd233:fix/vscode-localized-untitled-search

Conversation

@dvd233

@dvd233 dvd233 commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

This change makes session-history search use the same localized fallback label that each untitled row displays. Missing and empty display names keep the existing falsy fallback behavior, and the label is now derived in one place for both filtering and rendering. The regression test verifies both the matching sessions and the localized text visible in each result.

Why it's needed

In a localized UI, untitled sessions render with the translated label, but search previously compared a missing title against the hard-coded English string Untitled. As a result, searching for the exact label visible in the UI, such as 未命名, returned no matches. Sharing the label derivation also prevents the filter and rendered row from drifting apart again.

Reviewer Test Plan

How to verify

Use the VS Code companion in the Chinese locale with one session whose display name is missing, one whose display name is an empty string, and one named session. Open session history and search for 未命名. Confirm that both untitled sessions remain visible, both rows display 未命名, and the named session is excluded.

The focused regression test also checks these three outcomes. As a mutation check, changing the fallback from falsy to nullish makes the empty-name assertion fail, while changing only the rendered fallback to Untitled makes the visible-text assertion fail.

Evidence (Before & After)

Before: searching 未命名 returns no matches. After: both untitled sessions are returned and display 未命名.

The before/after image uses the actual session-history component with the same Chinese locale and session fixtures as the regression scenario.

Tested on

OS Status
🍏 macOS ⚠️ not tested
🪟 Windows ✅ tested
🐧 Linux ⚠️ not tested

Environment (optional)

Windows 11, Node.js 24.15.0, Vitest 3.2.7. After syncing upstream main, the VS Code companion workspace passed all 606 tests and ESLint. The local type check could not complete because this worktree\u0027s shared dependencies lack the VS Code API module; GitHub checks are running on the pushed head.

Risk & Scope

  • Main risk or tradeoff: Low. The change preserves the row's existing fallback semantics and reuses that same label for search.
  • Not validated / out of scope: Manual extension-host verification on macOS and Linux; unrelated session-history behavior.
  • Breaking changes / migration notes: None.

Linked Issues

Related to #10382, specifically the localized session-history search finding recorded in its follow-up comment. This PR does not close the umbrella issue, which tracks several independent findings.

中文说明

本 PR 的改动

本改动让会话历史搜索使用每个未命名行实际展示的同一个本地化回退标签。缺失与空字符串显示名称继续保持既有的假值回退语义,并且过滤与渲染现在只在一处派生标签。回归测试同时验证匹配到的会话和每条结果实际显示的本地化文本。

为什么需要此改动

在本地化界面中,未命名会话会显示翻译后的标签,但搜索此前会把缺失标题与硬编码英文字符串 Untitled 比较。因此,搜索界面中实际可见的标签(例如 未命名)不会返回任何结果。共享标签派生也可以防止过滤逻辑与行渲染再次发生漂移。

Reviewer 测试计划

如何验证

在中文语言环境的 VS Code companion 中准备三个会话:一个缺少显示名称、一个显示名称为空字符串、一个有正常名称。打开会话历史并搜索 未命名。确认两个未命名会话都保持可见、两行都显示 未命名,且有名称的会话被排除。

聚焦回归测试也会检查这三个结果。突变验证中,把假值回退改成空值回退会使空名称断言失败;只把渲染侧回退改成 Untitled 会使可见文本断言失败。

证据(修改前与修改后)

修改前:搜索未命名没有结果;修改后:两个未命名会话都会返回并显示未命名。

修改前后对比图使用真实的会话历史组件,并采用与回归场景相同的中文语言环境和会话夹具。

已测试平台

操作系统 状态
macOS ⚠️ 未测试
Windows ✅ 已测试
Linux ⚠️ 未测试

环境(可选)

Windows 11、Node.js 24.15.0、Vitest 3.2.7。同步上游 main 后,VS Code companion workspace 的 606 项测试与 ESLint 均通过。本地类型检查因当前共享依赖缺少 VS Code API 模块未能完成;GitHub checks 正在针对已推送的 head 运行。

风险与范围

  • 主要风险或取舍:低。本改动保留行渲染既有的回退语义,并让搜索复用同一个标签。
  • 未验证或超出范围:未在 macOS 与 Linux 上进行扩展宿主手工验证;其他无关的会话历史行为不在本 PR 范围内。
  • 破坏性变更或迁移说明:无。

关联 Issue

关联 #10382,具体对应其后续评论中记录的本地化会话历史搜索问题。本 PR 不会关闭这个汇总 issue,因为其中还跟踪了多个彼此独立的问题。

@dvd233
dvd233 dismissed a stale review via c083c1b September 30, 2026 10:05
@dvd233

dvd233 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

The remaining Ubuntu test failure at c083c1b is the core cold-scan latency assertion in recall-scan-latency.test.ts (for example, 134 ms against a 100 ms ceiling). This PR changes only the VS Code session-history component and its tests; the entire packages/core tree is identical to the main commit incorporated by the merge.

I attempted to rerun only the failed Ubuntu job, but GitHub returned 403: Must have admin rights to Repository. Could a maintainer rerun that job when available? I have kept the test thresholds unchanged and have not claimed that CI passed.

Failed job: https://github.com/QwenLM/qwen-code/actions/runs/36700296056/job/109837948773

@qwen-code-review-bot qwen-code-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Downgraded from Approve to Comment: CI still running. Reviewed.

Not explored to full depth (tool budget reached): "agent 2": none — no check was cut short.; "agent 1b": none — the walk finished inside the tool budget..

中文说明

⚠️ 已从批准降级为评论:CI still running。 已审查。

未探索到全部深度(达到工具调用预算):"agent 2":none — no check was cut short.;"agent 1b":none — the walk finished inside the tool budget.。

— deepseek-v4.1-flash-1017 via Qwen Code /review (v0.26.4)

This branch has not been deployed

No deployments
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.

3 participants