From f75de838cae18a5877c902158d1e4d6c39069226 Mon Sep 17 00:00:00 2001 From: "lithe-support[bot]" <356900028+lithe-support[bot]@users.noreply.github.com> Date: Mon, 23 Nov 2026 03:37:49 +0000 Subject: [PATCH] fix(workbench): preserve result tree selection when focus clears --- .../2026-11-20-primary-click-selection.md | 4 + desktop/internal/treelist/treelist.go | 20 +- desktop/internal/workbench/problems_view.go | 12 +- .../workbench/problems_visual_test.go | 15 ++ desktop/internal/workbench/references_view.go | 12 +- .../workbench/references_visual_test.go | 15 ++ .../workbench/result_tree_focus_test.go | 194 ++++++++++++++++++ .../features/diagnostics-workspace.json | 8 +- .../features/references-pane.json | 8 +- 9 files changed, 264 insertions(+), 24 deletions(-) create mode 100644 desktop/internal/workbench/result_tree_focus_test.go diff --git a/.agents/notes/implemented/bug-fix/2026-11-20-primary-click-selection.md b/.agents/notes/implemented/bug-fix/2026-11-20-primary-click-selection.md index d23a257fd3..b0ceeaa8db 100644 --- a/.agents/notes/implemented/bug-fix/2026-11-20-primary-click-selection.md +++ b/.agents/notes/implemented/bug-fix/2026-11-20-primary-click-selection.md @@ -17,6 +17,7 @@ Core 的第一次 toggle(增减一行选择)只把点击目标加入标记 - 没有批量标记和范围锚点时,Core 先把可见的、非根的当前行纳入,再切换点击行。已有批量继续只切换一行;隐藏旧行不因首次点击被意外加入。 - 文件树与 Git 分支列表有批量状态时只用批量标记呈现选中底色;取消选中的当前行不继续显示为已选。 - 文件树记录已观察的焦点,指针焦点先交给点击处理,键盘焦点仍更新当前行。窗口失焦和恢复不清除批量。焦点清空时只记录焦点变化,行匹配要求焦点 ID 非空。目录列表刚加入的行在首次绘制前也使用空 ID,两者相等会把原选中项误移到新行。 +- 引用和问题树复用 `treelist.FocusedRow` 匹配 Viva 行身份,只在非空焦点命中已声明行时更新选择。焦点清空仍写入已观察状态,因此重新聚焦同一行能够响应;工具栏定位保留原来的滚动和预览行为。这个适配只解释 Viva 的焦点 ID,不改变 Core 的结果排序或业务选择规则。 - macOS Command 和 Windows Control 由 Viva 已有的主修饰键定义提供,不新增系统按键适配。 ## 考虑过的备选方案 @@ -34,6 +35,7 @@ Core 的第一次 toggle(增减一行选择)只把点击目标加入标记 - Core 共享 row-selection fixture 修改后先红后绿,覆盖首次追加保留、点击当前行取消、隐藏标记、范围选择和根保护。 - `desktop/internal/workbench/filetree_test.go` 的真实驱动点击先复现旧选择丢失,修复后覆盖追加、取消、全部选中底色、普通点击清除及键盘焦点回归。 - `TestProjectTreeKeepsSelectionWhenFocusClearsBeforeNewRowsPaint` 控制焦点清空与目录行首次绘制的顺序,修复前选中新增行,修复后保留原选中行。`TestProjectTreeLocateGivesUpOnAFileThatIsGone` 覆盖删除活跃文件后定位的完整流程,`TestVisualProjectTreeMissingFile` 采集明暗主题的结果。 +- `desktop/internal/workbench/result_tree_focus_test.go` 用真实 Viva Tree 定序控制引用和问题结果刷新、清空焦点、重新聚焦及方向键。新行在第一次绘制前没有行 ID,旧实现会误选它;修复后保留原行,失焦时定位不抢键盘,回到原焦点后继续更新选择。`references_visual_test.go` 与 `problems_visual_test.go` 在未声明行时清空焦点,再采集保留选择及预览的中英文明暗主题截图。 - `desktop/internal/workbench/branch_delete_test.go` 混合批量从普通点击开始,再用平台主修饰键追加,验证实际删除集合。 - 通过 `scripts/desktop/desktop-go.sh` 执行定向无头测试,`desktop/internal/workbench/branch_delete_visual_test.go` 生成中英文明暗主题的文件树多选截图。Windows 原生交互验证仍待目标平台执行。 @@ -42,4 +44,6 @@ Core 的第一次 toggle(增减一行选择)只把点击目标加入标记 - `desktop/internal/workbench/filetree.go` - `desktop/internal/workbench/filetree_view.go` - `desktop/internal/workbench/gitlog_view.go` +- `desktop/internal/treelist/treelist.go` +- `desktop/internal/workbench/references_view.go` 与 `desktop/internal/workbench/problems_view.go` - 外部 Lithe-core-rust 的 `rust/crates/row-selection/src/lib.rs` 与共享 fixture。 diff --git a/desktop/internal/treelist/treelist.go b/desktop/internal/treelist/treelist.go index dfd188b091..f42970631c 100644 --- a/desktop/internal/treelist/treelist.go +++ b/desktop/internal/treelist/treelist.go @@ -1,9 +1,12 @@ -// Package treelist holds the measures and the text color of the desktop's tree rows: the +// Package treelist holds the measures, text color and focus lookup of desktop tree rows: the // Project tool window's tree and the lists of files in the Git tool windows share them, so // a name looks the same wherever it is listed. The rows themselves are Viva's Tree and List. package treelist -import "github.com/vivaui/viva/gfx" +import ( + "github.com/vivaui/viva/gfx" + "github.com/vivaui/viva/ui" +) // The sizes of a row, the same in every tree list. const ( @@ -39,3 +42,16 @@ func Text(dark bool) gfx.Color { func Width(depth int, content float32) float32 { return 2*Gutter + float32(depth*Indent) + Disclosure + Gap + content + Trailing } + +// FocusedRow finds the row whose Viva identity holds the keyboard focus. Cleared focus +// cannot match a row: a row added since the last paint can also have the zero identity. +func FocusedRow(view *ui.TreeState, count int, focused gfx.ID) (int, bool) { + if !focused.IsZero() { + for i := range count { + if view.RowID(i) == focused { + return i, true + } + } + } + return -1, false +} diff --git a/desktop/internal/workbench/problems_view.go b/desktop/internal/workbench/problems_view.go index 1009def6d3..7b0b0fdb20 100644 --- a/desktop/internal/workbench/problems_view.go +++ b/desktop/internal/workbench/problems_view.go @@ -197,14 +197,10 @@ func (a *App) syncProblemsSelection(canvas *gfx.Canvas) { focused := canvas.Focused() inTree := false if focused != v.focus || v.reveal { - for i := range rows { - if v.view.RowID(i) == focused { - inTree = true - if focused != v.focus { - v.selected, v.selectedRow = rows[i].Key, i - } - break - } + i, found := treelist.FocusedRow(&v.view, len(rows), focused) + inTree = found + if found && focused != v.focus { + v.selected, v.selectedRow = rows[i].Key, i } v.focus = focused } diff --git a/desktop/internal/workbench/problems_visual_test.go b/desktop/internal/workbench/problems_visual_test.go index 7f52f0ad9e..9068d01b64 100644 --- a/desktop/internal/workbench/problems_visual_test.go +++ b/desktop/internal/workbench/problems_visual_test.go @@ -11,7 +11,9 @@ import ( "github.com/1lck/Lithe-IDEA/desktop/internal/plugindiag" "github.com/1lck/Lithe-IDEA/desktop/internal/store" "github.com/vivaui/viva/app" + "github.com/vivaui/viva/gfx" "github.com/vivaui/viva/headless" + "github.com/vivaui/viva/ui" ) // TestVisualProblemsToolWindow captures the Problems tool window over two files' diagnostics: @@ -95,6 +97,19 @@ func TestVisualProblemsToolWindow(t *testing.T) { h.clickNamed(problemsRowNamed(t, h, problemsDiagnosticRow(t, h, "The value of the local variable count is not used"))) h.await("the diagnostic's preview", func() bool { return v.preview.view != nil && v.preview.path == service }) h.settleChain() + // A refreshed tree has yet to declare its rows when focus clears. Keep + // the chosen diagnostic and the preview captured below. + selected := v.selected + v.focus = v.view.RowID(v.selectedRow) + if v.focus.IsZero() { + t.Fatal("the selected diagnostic has no painted identity") + } + v.view = ui.TreeState{} + h.app.syncProblemsSelection(new(gfx.Canvas)) + if v.selected != selected { + t.Fatalf("cleared focus selected %q, want %q", v.selected, selected) + } + h.settleChain() if err := session.Screenshot(filepath.Join(out, "problems-project-"+look.theme+"-"+look.language+".png")); err != nil { t.Fatal(err) } diff --git a/desktop/internal/workbench/references_view.go b/desktop/internal/workbench/references_view.go index 79e20a083b..5bb2cdbf7e 100644 --- a/desktop/internal/workbench/references_view.go +++ b/desktop/internal/workbench/references_view.go @@ -142,14 +142,10 @@ func (a *App) syncReferenceSelection(canvas *gfx.Canvas) { focused := canvas.Focused() inTree := false if focused != s.focus || s.reveal { - for i := range s.rows { - if s.view.RowID(i) == focused { - inTree = true - if focused != s.focus { - s.selected, s.selectedRow = s.rows[i].Key, i - } - break - } + i, found := treelist.FocusedRow(&s.view, len(s.rows), focused) + inTree = found + if found && focused != s.focus { + s.selected, s.selectedRow = s.rows[i].Key, i } s.focus = focused } diff --git a/desktop/internal/workbench/references_visual_test.go b/desktop/internal/workbench/references_visual_test.go index db2294fcfa..5c8f6def72 100644 --- a/desktop/internal/workbench/references_visual_test.go +++ b/desktop/internal/workbench/references_visual_test.go @@ -12,6 +12,7 @@ import ( "github.com/vivaui/viva/app" "github.com/vivaui/viva/gfx" "github.com/vivaui/viva/headless" + "github.com/vivaui/viva/ui" ) // TestVisualReferencesToolWindow captures the References tool window after Find Usages on a @@ -91,6 +92,20 @@ func TestVisualReferencesToolWindow(t *testing.T) { h.settleChain() h.await("the usage's preview", func() bool { return visualReferencesReady(h.app) }) h.settleChain() + // Keep the chosen usage while the refreshed tree has not declared any + // rows and focus clears. The screenshot must still show its preview. + s := &h.app.editor.refs + selected := s.selected + s.focus = s.view.RowID(s.selectedRow) + if s.focus.IsZero() { + t.Fatal("the selected usage has no painted identity") + } + s.view = ui.TreeState{} + h.app.syncReferenceSelection(new(gfx.Canvas)) + if s.selected != selected { + t.Fatalf("cleared focus selected %q, want %q", s.selected, selected) + } + h.settleChain() if err := session.Screenshot(filepath.Join(out, "references-"+look.theme+"-"+look.language+".png")); err != nil { t.Fatal(err) } diff --git a/desktop/internal/workbench/result_tree_focus_test.go b/desktop/internal/workbench/result_tree_focus_test.go new file mode 100644 index 0000000000..03f04a84b8 --- /dev/null +++ b/desktop/internal/workbench/result_tree_focus_test.go @@ -0,0 +1,194 @@ +package workbench + +import ( + "testing" + "time" + + "github.com/1lck/Lithe-IDEA/desktop/internal/core" + "github.com/vivaui/viva/app" + "github.com/vivaui/viva/gfx" + "github.com/vivaui/viva/ui" +) + +// resultTreeFocus drives Viva's real tree and each panel's selection adapter without +// background queries: the test controls when a result arrives relative to a paint. +type resultTreeFocus struct { + view *ui.TreeState + selected *string + selectedRow *int + focus *gfx.ID + reveal *bool + sync func(*gfx.Canvas) + setRows func(...string) + row func(int) string + count func() int + driver *app.Driver + invalidator *app.Invalidator +} + +func newResultTreeFocus(t *testing.T, panel string) *resultTreeFocus { + t.Helper() + a := new(App) + f := &resultTreeFocus{invalidator: new(app.Invalidator)} + switch panel { + case "references": + s := &a.editor.refs + f.view, f.selected, f.selectedRow, f.focus, f.reveal = &s.view, &s.selected, &s.selectedRow, &s.focus, &s.reveal + f.sync = a.syncReferenceSelection + f.setRows = func(keys ...string) { + s.rows = nil + for _, key := range keys { + s.rows = append(s.rows, core.ReferenceRow{Key: key}) + } + } + f.row = func(i int) string { return s.rows[i].Key } + f.count = func() int { return len(s.rows) } + case "problems": + v := &a.problems + f.view, f.selected, f.selectedRow, f.focus, f.reveal = &v.view, &v.selected, &v.selectedRow, &v.focus, &v.reveal + f.sync = a.syncProblemsSelection + f.setRows = func(keys ...string) { + v.result.Rows = nil + for _, key := range keys { + v.result.Rows = append(v.result.Rows, core.ProblemsRow{Key: key}) + } + } + f.row = func(i int) string { return v.result.Rows[i].Key } + f.count = func() int { return len(v.result.Rows) } + default: + t.Fatalf("unknown result tree %q", panel) + } + f.setRows("first", "original") + *f.selected, *f.selectedRow = "original", 1 + f.view.Node = func(i int) ui.TreeNode { return ui.TreeNode{Selected: i == *f.selectedRow} } + f.view.RowHeight = 24 + theme := ui.LightTheme() + page := ui.NewPage(ui.PageConfig{ + Theme: &theme, Invalidator: f.invalidator, + View: func(c ui.C) { + f.sync(c.Canvas()) + ui.Tree(c, f.view, f.count(), f.row, func(i int) { ui.Text(c, f.row(i)) }).Scrollbars().Fill() + }, + }) + var err error + f.driver, err = app.NewDriver(ui.Configure(page, app.Config{Width: 300, Height: 120, Invalidator: f.invalidator}), nil) + if err != nil { + t.Fatal(err) + } + t.Cleanup(f.driver.Close) + f.paint(t) + return f +} + +func (f *resultTreeFocus) paint(t *testing.T) { + t.Helper() + f.invalidator.Invalidate() + if err := f.driver.Advance(20 * time.Millisecond); err != nil { + t.Fatal(err) + } +} + +func (f *resultTreeFocus) wantSelection(t *testing.T, key string, row int) { + t.Helper() + if *f.selected != key || *f.selectedRow != row || f.view.Selected() != row { + t.Fatalf("selection = %q at %d (tree %d), want %q at %d", *f.selected, *f.selectedRow, f.view.Selected(), key, row) + } +} + +func TestResultTreesKeepSelectionWhenFocusClearsBeforeNewRowsPaint(t *testing.T) { + for _, panel := range []string{"references", "problems"} { + t.Run(panel, func(t *testing.T) { + f := newResultTreeFocus(t, panel) + *f.focus = f.view.RowID(0) + if f.focus.IsZero() { + t.Fatal("the painted row has no identity") + } + // A result arrives before the frame that observes cleared focus. The new + // row has no Viva identity yet; it must not match the cleared focus. + f.setRows("first", "original", "new") + if !f.view.RowID(2).IsZero() { + t.Fatal("the new row already has an identity") + } + canvas := new(gfx.Canvas) + f.sync(canvas) + f.wantSelection(t, "original", 1) + if !f.focus.IsZero() { + t.Fatal("cleared focus was not recorded") + } + + // With focus unchanged at zero, a toolbar reveal must also preserve the + // selection and must not give the keyboard to an unpainted row. + *f.reveal = true + f.sync(canvas) + f.wantSelection(t, "original", 1) + if *f.reveal || !canvas.FocusRequest().IsZero() { + t.Fatal("reveal did not finish without taking focus") + } + + // Returning to the same identity used before focus cleared is a new + // focus change and must select it, even though another row was kept. + canvas.SetInteraction(gfx.ID{}, gfx.ID{}, f.view.RowID(0), true) + f.sync(canvas) + f.wantSelection(t, "first", 0) + }) + } +} + +func TestResultTreesSelectionFollowsArrowKeys(t *testing.T) { + for _, panel := range []string{"references", "problems"} { + t.Run(panel, func(t *testing.T) { + f := newResultTreeFocus(t, panel) + // Tab enters the currently selected row; arrows then use Viva's own + // navigation and the panel observes the focused row on the next frame. + for _, key := range []gfx.Key{gfx.KeyTab, gfx.KeyUp} { + if err := f.driver.Key(key, 0); err != nil { + t.Fatal(err) + } + f.paint(t) + } + f.wantSelection(t, "first", 0) + if err := f.driver.Key(gfx.KeyDown, 0); err != nil { + t.Fatal(err) + } + f.paint(t) + f.wantSelection(t, "original", 1) + }) + } +} + +func TestResultTreesRevealKeepsTheSelectionMadeOutsideTheTree(t *testing.T) { + for _, panel := range []string{"references", "problems"} { + t.Run(panel, func(t *testing.T) { + f := newResultTreeFocus(t, panel) + canvas := new(gfx.Canvas) + canvas.SetInteraction(gfx.ID{}, gfx.ID{}, f.view.RowID(0), true) + f.sync(canvas) + f.wantSelection(t, "first", 0) + + // A toolbar action changed the selection while the first row still has + // focus. Revealing it transfers focus without reverting the selection. + *f.selected, *f.selectedRow, *f.reveal = "original", 1, true + f.sync(canvas) + f.wantSelection(t, "original", 1) + if *f.reveal || canvas.FocusRequest() != f.view.RowID(1) { + t.Fatal("reveal did not hand focus to the selected row") + } + + // An unrelated control's focus cannot change the selection, including + // after the result becomes empty while a stale focus identity remains. + canvas = new(gfx.Canvas) + canvas.SetInteraction(gfx.ID{}, gfx.ID{}, gfx.Item(99), true) + *f.reveal = true + f.sync(canvas) + f.wantSelection(t, "original", 1) + if !canvas.FocusRequest().IsZero() { + t.Fatal("reveal took focus from another control") + } + f.setRows() + f.sync(canvas) + if f.view.Selected() != -1 { + t.Fatal("the empty tree still selects a row") + } + }) + } +} diff --git a/shared/platform-feature-matrix/features/diagnostics-workspace.json b/shared/platform-feature-matrix/features/diagnostics-workspace.json index 18f12fb3e7..3671a5b6d6 100644 --- a/shared/platform-feature-matrix/features/diagnostics-workspace.json +++ b/shared/platform-feature-matrix/features/diagnostics-workspace.json @@ -15,7 +15,8 @@ "desktop/internal/workbench/documents_tabless.go", "desktop/internal/workbench/shell_view.go", "desktop/internal/workbench/problems_test.go", - "desktop/internal/workbench/problems_visual_test.go" + "desktop/internal/workbench/problems_visual_test.go", + "desktop/internal/workbench/result_tree_focus_test.go" ] }, "windows": { @@ -30,11 +31,12 @@ "desktop/internal/workbench/documents_tabless.go", "desktop/internal/workbench/shell_view.go", "desktop/internal/workbench/problems_test.go", - "desktop/internal/workbench/problems_visual_test.go" + "desktop/internal/workbench/problems_visual_test.go", + "desktop/internal/workbench/result_tree_focus_test.go" ] }, "owner": "Diagnostics", - "verification": "制造多个来源、多个文件的错误和警告,验证 Problems 的 File 随编辑器切换、关闭而更新,非文本编辑器显示打开文件提示,Project Errors 保留全部文件问题;检查无问题与严重程度过滤空状态,并按文件显示名称、路径和数量,紧凑问题行保留描述、行列和完整提示;在深浅主题及窄面板中检查标题、图标和悬停,并验证筛选、排序、定位和清除。检查左侧 View Options 与 Show Editor Preview;开启后单击及方向键更新右侧可编辑源码,双击和 Enter 定位主编辑器;拖动分栏、关闭再打开、切换文件和清空诊断,确认不抢焦点、不移动主编辑器 WebView、不接管保存屏障且会话随预览关闭释放。 在系统语言与应用语言不同时切换 English / 简体中文,检查 File、Project Errors、带文件名的空状态、过滤提示和预览失败文案跟随应用语言。 使用 Debug 的 --problems-demo,确认默认 File 显示 Main.java 的 8 条问题,切换 Project Errors 显示两个文件共 10 条问题;检查全部五种诊断级别、废弃与未使用标签、关联信息、长多行文案及 Unicode;点击后用上下键切换,确认只有行选择样式且没有列表外围蓝色焦点框,右侧不出现空查找浮层。退出后检查演示临时目录、进程清理,并比较 bundle 文件哈希不变。 检查 File 与 Project Errors 的全部级别图标使用 IDEA Community SVG,提示使用 intentionBulbGrey,未知级别使用 questionMark;在明暗主题核对对应变体。 文件分组复用 JavaFileIconResolver 显示类或接口图标;问题行的错误和警告使用 inspections 16×16 原始画布与内部留白,右上角统计继续使用 status 图标。 检查已有 Java 启动配置 sourcePath/mainClass 对应的文件显示原始 runnableMark 角标,普通类不显示;演示 Main.java 显示该角标。YAML 与 Java 类图标按主题加载上游明暗变体,application.yml 使用 YAMLFileType 的通用图标。 关闭源码预览后行选择背景仍保留,方向键选择离屏问题时列表自动滚动。 在文本文件、Agent Conversation 编辑器标签与原文本文件之间切换,确认 File 问题先清空再恢复;预览中不出现 Run/Debug 角标和动作,旧动作引用及原生 javaRunMarkerAction 不能启动进程。 #1662 LSP-17:两端的过滤、排序、分组和计数统一由 Core 的 lsp.problems.query 决定。默认按文件分组、文件内先按严重程度再按行列;文件按工作区相对路径的自然顺序排列(File2 在 File10 之前,大小写不敏感),未知严重程度排在最后。macOS 不再在文件内只按行列排序,Windows 不再用 localeCompare 比较绝对路径。在两端制造同名数字文件和多种严重程度的问题,确认顺序、计数、严重程度过滤、仅当前文件和搜索结果一致。 Viva:工具窗口标题栏显示“文件 N”和“项目 N”两个标签,默认打开文件标签;N 按显示选项统计当前编辑器文件和整个项目的问题,没有问题时只显示标签名,没有打开的文件时文件标签显示提示。左侧操作列依次为视图选项(显示错误、警告、信息与分组方式的菜单)、全部展开、全部收起和编辑器预览开关;树中文件节点显示文件图标、文件名、灰色目录和问题数,问题行显示严重程度图标、描述、来源和行号。折叠选中问题所在的文件节点后选中移到该节点,诊断消失后选中移到所在文件;树行、展开状态和选中移动全部由 Core 的 lsp.problems.query 计算。 Viva:预览按所选问题的严重程度给所在行着色(错误红、警告黄、信息与提示蓝),选中行使用主题选中蓝;预览是该文件文档的第二个编辑器,可直接输入、撤销、保存,标签页和预览的修改立即互相同步,未打开的文件以无标签文档打开、离开且无未保存修改时释放;预览中显示诊断波浪线,补全、悬停、跳转定义、查找用法、重命名和格式化按预览的光标工作;预览持有键盘焦点时诊断刷新只更新行颜色,不移动光标也不切换文件。", + "verification": "制造多个来源、多个文件的错误和警告,验证 Problems 的 File 随编辑器切换、关闭而更新,非文本编辑器显示打开文件提示,Project Errors 保留全部文件问题;检查无问题与严重程度过滤空状态,并按文件显示名称、路径和数量,紧凑问题行保留描述、行列和完整提示;在深浅主题及窄面板中检查标题、图标和悬停,并验证筛选、排序、定位和清除。检查左侧 View Options 与 Show Editor Preview;开启后单击及方向键更新右侧可编辑源码,双击和 Enter 定位主编辑器;拖动分栏、关闭再打开、切换文件和清空诊断,确认不抢焦点、不移动主编辑器 WebView、不接管保存屏障且会话随预览关闭释放。 在系统语言与应用语言不同时切换 English / 简体中文,检查 File、Project Errors、带文件名的空状态、过滤提示和预览失败文案跟随应用语言。 使用 Debug 的 --problems-demo,确认默认 File 显示 Main.java 的 8 条问题,切换 Project Errors 显示两个文件共 10 条问题;检查全部五种诊断级别、废弃与未使用标签、关联信息、长多行文案及 Unicode;点击后用上下键切换,确认只有行选择样式且没有列表外围蓝色焦点框,右侧不出现空查找浮层。退出后检查演示临时目录、进程清理,并比较 bundle 文件哈希不变。 检查 File 与 Project Errors 的全部级别图标使用 IDEA Community SVG,提示使用 intentionBulbGrey,未知级别使用 questionMark;在明暗主题核对对应变体。 文件分组复用 JavaFileIconResolver 显示类或接口图标;问题行的错误和警告使用 inspections 16×16 原始画布与内部留白,右上角统计继续使用 status 图标。 检查已有 Java 启动配置 sourcePath/mainClass 对应的文件显示原始 runnableMark 角标,普通类不显示;演示 Main.java 显示该角标。YAML 与 Java 类图标按主题加载上游明暗变体,application.yml 使用 YAMLFileType 的通用图标。 关闭源码预览后行选择背景仍保留,方向键选择离屏问题时列表自动滚动。 在文本文件、Agent Conversation 编辑器标签与原文本文件之间切换,确认 File 问题先清空再恢复;预览中不出现 Run/Debug 角标和动作,旧动作引用及原生 javaRunMarkerAction 不能启动进程。 #1662 LSP-17:两端的过滤、排序、分组和计数统一由 Core 的 lsp.problems.query 决定。默认按文件分组、文件内先按严重程度再按行列;文件按工作区相对路径的自然顺序排列(File2 在 File10 之前,大小写不敏感),未知严重程度排在最后。macOS 不再在文件内只按行列排序,Windows 不再用 localeCompare 比较绝对路径。在两端制造同名数字文件和多种严重程度的问题,确认顺序、计数、严重程度过滤、仅当前文件和搜索结果一致。 Viva:工具窗口标题栏显示“文件 N”和“项目 N”两个标签,默认打开文件标签;N 按显示选项统计当前编辑器文件和整个项目的问题,没有问题时只显示标签名,没有打开的文件时文件标签显示提示。左侧操作列依次为视图选项(显示错误、警告、信息与分组方式的菜单)、全部展开、全部收起和编辑器预览开关;树中文件节点显示文件图标、文件名、灰色目录和问题数,问题行显示严重程度图标、描述、来源和行号。折叠选中问题所在的文件节点后选中移到该节点,诊断消失后选中移到所在文件;树行、展开状态和选中移动全部由 Core 的 lsp.problems.query 计算。 Viva:预览按所选问题的严重程度给所在行着色(错误红、警告黄、信息与提示蓝),选中行使用主题选中蓝;预览是该文件文档的第二个编辑器,可直接输入、撤销、保存,标签页和预览的修改立即互相同步,未打开的文件以无标签文档打开、离开且无未保存修改时释放;预览中显示诊断波浪线,补全、悬停、跳转定义、查找用法、重命名和格式化按预览的光标工作;预览持有键盘焦点时诊断刷新只更新行颜色,不移动光标也不切换文件。 #2237:结果刷新加入尚未绘制的新行时清空键盘焦点,确认保留原选中项;失焦时工具栏定位不抢焦点,重新聚焦之前的同一行仍更新选择,上下方向键继续选择与滚动。引用和问题预览继续显示选中项;用无头回归控制事件顺序,原生窗口仍需在目标平台验收。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": { diff --git a/shared/platform-feature-matrix/features/references-pane.json b/shared/platform-feature-matrix/features/references-pane.json index f5a326d201..d9ab6fc608 100644 --- a/shared/platform-feature-matrix/features/references-pane.json +++ b/shared/platform-feature-matrix/features/references-pane.json @@ -15,7 +15,8 @@ "desktop/internal/workbench/pluginsemantics_test.go", "desktop/internal/workbench/pluginsemantics_e2e_test.go", "desktop/internal/core/references.go", - "desktop/internal/core/references_test.go" + "desktop/internal/core/references_test.go", + "desktop/internal/workbench/result_tree_focus_test.go" ] }, "windows": { @@ -30,11 +31,12 @@ "desktop/internal/workbench/pluginsemantics_test.go", "desktop/internal/workbench/pluginsemantics_e2e_test.go", "desktop/internal/core/references.go", - "desktop/internal/core/references_test.go" + "desktop/internal/core/references_test.go", + "desktop/internal/workbench/result_tree_focus_test.go" ] }, "owner": "Language Tooling", - "verification": "Viva(2026-11-10):Shift+F12 查找引用,以光标处弹出的可键盘导航列表(虚拟化窗口,上限 500)呈现,点击或回车打开所在文件位置;按文件分组与专用面板尚未接入。 从符号发起引用查询,验证结果分组、文件定位、关闭和重新查询。 Viva(2026-11-10):用测试内联的合成语言服务器插件服务的文件(如调用系统 clangd 的 C 文件)发起引用查询,核对分组、行预览、文件定位、关闭与重新查询。 Viva(2026-11-17):无头截图(references_visual_test.go,深浅主题 × 中英)核对结果树、竖排工具栏、搜索标签与预览;待在原生窗口核对单击预览、双击或回车打开、上一个/下一个用法、全部展开/折叠、拖动分隔条、关闭预览和关闭搜索标签。 Viva(2026-11-17):引用结果的分组排序、可见行、步进和行文本改由 Core 计算,Core 契约 fixture(references-query-v1、references-lines-v1)经桌面端桥接测试;单元测试覆盖右键点在其他位置后菜单“查找用法”按点击处请求,无头截图核对右键菜单里的“查找用法”与快捷键。", + "verification": "Viva(2026-11-10):Shift+F12 查找引用,以光标处弹出的可键盘导航列表(虚拟化窗口,上限 500)呈现,点击或回车打开所在文件位置;按文件分组与专用面板尚未接入。 从符号发起引用查询,验证结果分组、文件定位、关闭和重新查询。 Viva(2026-11-10):用测试内联的合成语言服务器插件服务的文件(如调用系统 clangd 的 C 文件)发起引用查询,核对分组、行预览、文件定位、关闭与重新查询。 Viva(2026-11-17):无头截图(references_visual_test.go,深浅主题 × 中英)核对结果树、竖排工具栏、搜索标签与预览;待在原生窗口核对单击预览、双击或回车打开、上一个/下一个用法、全部展开/折叠、拖动分隔条、关闭预览和关闭搜索标签。 Viva(2026-11-17):引用结果的分组排序、可见行、步进和行文本改由 Core 计算,Core 契约 fixture(references-query-v1、references-lines-v1)经桌面端桥接测试;单元测试覆盖右键点在其他位置后菜单“查找用法”按点击处请求,无头截图核对右键菜单里的“查找用法”与快捷键。 #2237:结果刷新加入尚未绘制的新行时清空键盘焦点,确认保留原选中项;失焦时工具栏定位不抢焦点,重新聚焦之前的同一行仍更新选择,上下方向键继续选择与滚动。引用和问题预览继续显示选中项;用无头回归控制事件顺序,原生窗口仍需在目标平台验收。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": {