diff --git a/desktop/internal/settingswindow/general_view_test.go b/desktop/internal/settingswindow/general_view_test.go index 4cd8847ba..4914c405f 100644 --- a/desktop/internal/settingswindow/general_view_test.go +++ b/desktop/internal/settingswindow/general_view_test.go @@ -34,8 +34,8 @@ func (d *windowDriver) showsHelp(help string) bool { } // helpBeside fails unless the first line of help shows to the right of trigger, starting -// no higher than trigger's top and no lower than its bottom: the info tip and its pinned -// popover open beside the glyph, not over the rows under it. +// no higher than trigger's top and no lower than its bottom: the info tip opens beside the +// glyph, not over the rows under it. func (d *windowDriver) helpBeside(help string, trigger gfx.Rect, what string) { d.t.Helper() for _, text := range d.driver.Snapshot().Texts { @@ -117,7 +117,10 @@ func TestGeneralLanguageChangeRepaintsOpenWindow(t *testing.T) { } } -func TestGeneralInfoHoverClickAndKeyboard(t *testing.T) { +// TestGeneralInfoShowsHelpOnlyInItsTip covers the ⓘ: its help is the glyph's description +// for assistive technology and shows beside it while the pointer rests on it, and pressing +// it opens no second card that stays after the pointer leaves. +func TestGeneralInfoShowsHelpOnlyInItsTip(t *testing.T) { w := newWindow(NewController(Options{Language: func() i18n.Language { return i18n.English }}), Values{}) d := openWindow(t, w) help := w.text.Settings.AppearanceHelp @@ -138,40 +141,26 @@ func TestGeneralInfoHoverClickAndKeyboard(t *testing.T) { t.Fatal("hover did not display the help") } d.helpBeside(help, trigger.Bounds, "hover") + // A press hides the tip until the pointer leaves the glyph, as on every other control. if err := d.driver.Click(x, y); err != nil { t.Fatal(err) } - if err := d.driver.Move(2, 2); err != nil { - t.Fatal(err) - } - if !d.showsHelp(help) { - t.Fatal("moving away dismissed pinned help") - } - d.helpBeside(help, trigger.Bounds, "pinned") - d.key(gfx.KeyEscape) - if d.showsHelp(help) || w.sess.finished.Load() { - t.Fatal("Escape did not close help without closing settings") - } - if err := d.driver.Click(x, y); err != nil { - t.Fatal(err) - } - if !d.showsHelp(help) { - t.Fatal("click did not pin the help") + if d.showsHelp(help) { + t.Fatal("pressing the ⓘ opened its help in a second card") } - d.key(gfx.KeyEnter) if err := d.driver.Move(2, 2); err != nil { t.Fatal(err) } if d.showsHelp(help) || w.sess.finished.Load() { - t.Fatal("keyboard activation did not toggle help") + t.Fatal("the help stayed on screen after the pointer left the ⓘ") } - if err := d.driver.Click(x, y); err != nil { + if err := d.driver.Move(x, y); err != nil { t.Fatal(err) } - d.click("Search settings") - if d.showsHelp(help) || w.sess.finished.Load() { - t.Fatal("outside click did not dismiss help without closing settings") + if !d.showsHelp(help) { + t.Fatal("the tip did not come back when the pointer returned to the ⓘ") } + d.helpBeside(help, trigger.Bounds, "hover again") } func TestSettingsSearchUsesPlatformShortcutAndClears(t *testing.T) { diff --git a/desktop/internal/settingswindow/toolchains_view_test.go b/desktop/internal/settingswindow/toolchains_view_test.go index 49d509e35..2862eb441 100644 --- a/desktop/internal/settingswindow/toolchains_view_test.go +++ b/desktop/internal/settingswindow/toolchains_view_test.go @@ -433,18 +433,18 @@ func TestProjectToolchainTrustSwitchGrantsAndRevokesImmediately(t *testing.T) { t.Fatal("missing untrusted status label") } - // Verify ⓘ help popover explains consequences and local storage scope. + // Verify the ⓘ tip explains consequences and local storage scope. help := i18n.Shared(i18n.English, "desktop.toolchains.trustProjectHelp") infoBounds := d.hintHit(help).Bounds - if err := d.driver.Click(infoBounds.X+infoBounds.Width/2, infoBounds.Y+infoBounds.Height/2); err != nil { + if err := d.driver.Move(infoBounds.X+infoBounds.Width/2, infoBounds.Y+infoBounds.Height/2); err != nil { t.Fatal(err) } d.pump() if !d.showsHelp(help) { - t.Fatal("project trust ⓘ button did not open its help popover") + t.Fatal("resting on the project trust ⓘ did not show its help") } - // Close popover before toggling the switch. - if err := d.driver.Click(infoBounds.X+infoBounds.Width/2, infoBounds.Y+infoBounds.Height/2); err != nil { + // Leave the ⓘ before toggling the switch. + if err := d.driver.Move(2, 2); err != nil { t.Fatal(err) } d.pump() diff --git a/desktop/internal/settingswindow/visual_capture_test.go b/desktop/internal/settingswindow/visual_capture_test.go index 8de599e6b..db70c393e 100644 --- a/desktop/internal/settingswindow/visual_capture_test.go +++ b/desktop/internal/settingswindow/visual_capture_test.go @@ -47,7 +47,7 @@ func TestVisualSettings(t *testing.T) { {"27-settings-terminal", pageTerminal}, {"28-plugins-installed", pagePlugins}, {"29-marketplace-empty", pagePlugins}, {"31-settings-updates", pageUpdates}, {"33-settings-toolchains", pageBuild}, {"m44-toolchain-directory-menu", pageBuild}, {"m45-toolchain-custom-directory", pageBuild}, - {"m47-toolchain-project-untrusted", pageBuild}, {"m48-toolchain-project-trusted", pageBuild}, {"m49-toolchain-project-trust-help", pageBuild}, + {"m47-toolchain-project-untrusted", pageBuild}, {"m48-toolchain-project-trusted", pageBuild}, {"m49-toolchain-project-trust-click", pageBuild}, {"m50-toolchain-project-trust-tip", pageBuild}, {"fonts", pageFonts}, {"21-settings-language-popup", pageGeneral}, {"30-settings-history", pageGeneral}, {"m46-history-default-rules-help", pageGeneral}, {"35-settings-search", pageEditor}, @@ -129,16 +129,12 @@ func TestVisualSettings(t *testing.T) { if err := d.driver.Move(x, y); err != nil { t.Fatal(err) } - if err := d.driver.Click(x, y); err != nil { + // Resting on the ⓘ shows its tip; move the frame clock past the hover delay. + if err := session.Advance(time.Second); err != nil { t.Fatal(err) } - d.pump() if !d.showsHelp(help) { - t.Fatal("the ⓘ did not pin its help open") - } - // The popover fades in; move the frame clock past it. - if err := session.Advance(time.Second); err != nil { - t.Fatal(err) + t.Fatal("resting on the ⓘ did not show its help") } case "35-settings-search": query := "编辑器" @@ -168,7 +164,7 @@ func TestVisualSettings(t *testing.T) { d.click("Compiler") d.click(text("desktop.toolchains.custom")) d.pump() - case "m47-toolchain-project-untrusted", "m48-toolchain-project-trusted", "m49-toolchain-project-trust-help", "m50-toolchain-project-trust-tip": + case "m47-toolchain-project-untrusted", "m48-toolchain-project-trusted", "m49-toolchain-project-trust-click", "m50-toolchain-project-trust-tip": d.click(text("desktop.toolchains.project")) status := text("desktop.toolchains.trustStatusTrusted") if scenario.id == "m47-toolchain-project-untrusted" { @@ -176,7 +172,7 @@ func TestVisualSettings(t *testing.T) { } // The load result can arrive during painting, before the trust controls appear. d.until("the visible project trust status", func() bool { return d.text(status) }) - if scenario.id != "m49-toolchain-project-trust-help" && scenario.id != "m50-toolchain-project-trust-tip" { + if scenario.id != "m49-toolchain-project-trust-click" && scenario.id != "m50-toolchain-project-trust-tip" { break } help := text("desktop.toolchains.trustProjectHelp") @@ -187,7 +183,7 @@ func TestVisualSettings(t *testing.T) { } if scenario.id == "m50-toolchain-project-trust-tip" { // Resting on the ⓘ without pressing it shows the help in the client's - // shared hover tip rather than the pinned popover. + // shared hover tip. if err := session.Advance(time.Second); err != nil { t.Fatal(err) } @@ -196,16 +192,17 @@ func TestVisualSettings(t *testing.T) { } break } + // Pressing the ⓘ hides its tip and opens no card in its place. if err := d.driver.Click(x, y); err != nil { t.Fatal(err) } d.pump() - if !d.showsHelp(help) { - t.Fatal("the project trust ⓘ did not pin its help open") - } if err := session.Advance(time.Second); err != nil { t.Fatal(err) } + if d.showsHelp(help) { + t.Fatal("pressing the project trust ⓘ left its help on screen") + } } if err := session.Screenshot(filepath.Join(out, scenario.id+"-"+theme+".png")); err != nil { t.Fatal(err) @@ -287,7 +284,7 @@ func visualToolchainLoader(scenarioID string) ToolchainLoader { switch scenarioID { case "m47-toolchain-project-untrusted": return &trustToolchainLoader{globalSnapshot: global, untrusted: untrusted, trustedSnapshot: trusted} - case "m48-toolchain-project-trusted", "m49-toolchain-project-trust-help", "m50-toolchain-project-trust-tip": + case "m48-toolchain-project-trusted", "m49-toolchain-project-trust-click", "m50-toolchain-project-trust-tip": return &trustToolchainLoader{globalSnapshot: global, untrusted: untrusted, trustedSnapshot: trusted, trusted: true} default: return &scopedToolchainLoader{fakeToolchainLoader{snapshot: global}} diff --git a/desktop/internal/settingswindow/window_view.go b/desktop/internal/settingswindow/window_view.go index 731a10404..60413ec4f 100644 --- a/desktop/internal/settingswindow/window_view.go +++ b/desktop/internal/settingswindow/window_view.go @@ -6,7 +6,6 @@ import ( "github.com/1lck/Lithe-IDEA/desktop/internal/i18n" "github.com/1lck/Lithe-IDEA/desktop/internal/icons" "github.com/vivaui/viva/app" - "github.com/vivaui/viva/components" "github.com/vivaui/viva/gfx" "github.com/vivaui/viva/ui" ) @@ -320,21 +319,16 @@ func (w *window) settingsRow(c ui.C, title, help string, body func()) { }) } -// infoButton is the information glyph: hovering it shows help in a tip, and pressing it -// pins the help open in a popover until a press elsewhere or Escape. Both open to the right -// of the glyph, beside the label it ends, so they cover neither the label nor the rows -// under it; without room there they open on the left. +// infoButton is the information glyph. Resting the pointer on it shows help in the client's +// shared tip, as every ⓘ in the workbench does; pressing it opens nothing else, so the help +// never turns into a second, differently drawn card. The tip opens to the right of the +// glyph, beside the label it ends, so it covers neither the label nor the rows under it; +// without room there it opens on the left. Assistive technology reads the help as the +// glyph's description. func (w *window) infoButton(c ui.C, help string) { ui.Row(c).Size(18, 18).Shrink(0).Center().Children(func() { - open := ui.State[bool](c, "info") - button := ui.Button(c, i18n.Shared(w.marketLanguage(), "native.moreInformation")).Icon(icons.Info).IconOnly().Ghost().Size(18, 18). + ui.Button(c, i18n.Shared(w.marketLanguage(), "native.moreInformation")).Icon(icons.Info).IconOnly().Ghost().Size(18, 18). Tooltip(help).TooltipOn(ui.TooltipRight) - if button.Clicked() { - *open = !*open - } - ui.PopoverWith(c, button, ui.PopoverSpec{Side: components.PopoverRight, Align: ui.Start}, open, func() { - ui.Wrap(c, help).FontSize(12).Color(w.pal.text).MaxWidth(320).Pad(8) - }) }) } diff --git a/docs/assets/tooltip-unified-style/after/settings-click-dark.png b/docs/assets/tooltip-unified-style/after/settings-click-dark.png new file mode 100644 index 000000000..a46504bf0 Binary files /dev/null and b/docs/assets/tooltip-unified-style/after/settings-click-dark.png differ diff --git a/docs/assets/tooltip-unified-style/after/settings-click-light.png b/docs/assets/tooltip-unified-style/after/settings-click-light.png new file mode 100644 index 000000000..fa5a19bb8 Binary files /dev/null and b/docs/assets/tooltip-unified-style/after/settings-click-light.png differ diff --git a/docs/assets/tooltip-unified-style/before/settings-click-dark.png b/docs/assets/tooltip-unified-style/before/settings-click-dark.png new file mode 100644 index 000000000..3508028a7 Binary files /dev/null and b/docs/assets/tooltip-unified-style/before/settings-click-dark.png differ diff --git a/docs/assets/tooltip-unified-style/before/settings-click-light.png b/docs/assets/tooltip-unified-style/before/settings-click-light.png new file mode 100644 index 000000000..0f3bf7920 Binary files /dev/null and b/docs/assets/tooltip-unified-style/before/settings-click-light.png differ diff --git a/shared/platform-feature-matrix/features/application-settings.json b/shared/platform-feature-matrix/features/application-settings.json index 4edc8599f..958386002 100644 --- a/shared/platform-feature-matrix/features/application-settings.json +++ b/shared/platform-feature-matrix/features/application-settings.json @@ -50,8 +50,8 @@ ] }, "owner": "Settings", - "notes": "Viva 设置窗口的每个侧栏页都已接入:外观、常规、更新、网络、编辑器、字体、快捷键、进程终止、插件、版本控制、构建与工具链、语言(插件贡献的动态页)、终端、AI 生成与 IDE API;外观与语言选择后立即应用。尚未完成原版界面像素级对照或跨平台实机验收。 本次按 main-macos-live-baseline(源提交 a824bd5c)校准 900×700 初始窗口、234pt 侧栏、24pt 导航行、深浅色页面/卡片/下拉层级和页边距;已检查 macOS 原生通用页及语言下拉,仍不代表所有设置页逐像素验收。 本轮全页对照将自动保存入口移回通用页,终端 Shell 改为共享下拉并保留检测/缺失/自动生效值,退出策略按原版合并同行,更新页拆开版本与操作。 编辑器标签的滚动、压缩和多行布局统一为共享下拉,选择多行时保留先前单行溢出偏好。TestVisualSettings 以离线事实采集深浅色页面和菜单;工具真实来源与未实现设置项仍按既有状态记录,不能把截图覆盖当原生验收。 正式版与 AutoBuild 共用同一份设置:读到当前版本不认识的键,或字段在、但存的形状读不了的值时,照常用默认行为运行,保存时把这些值原样写回,不删除;不认识的键每组只通知一次,形状读不了的值记 app.settings.decode_failed(编辑器会话记 editor_session_load)。当前版本改过或清空的字段以当前版本为准。 Viva 2026-11-16:侧栏“构建、执行、部署”“语言与框架”在有插件贡献子页时与“工具”一样可折叠,选中子页时自动展开所属分组。自动化:TestContributedPagesGoUnderBuildOrLanguages。原生验收仍 pending。 2026-11-16 #1943:偏好文件读取或 JSON 解码失败后,下一次 Save 先把原文件改名为 <名称>.unreadable- 另存,再写入新值,原内容不被默认值覆盖;启动时提示另存位置仍待补齐。macOS/Windows 共用 Go 实现,实机验收保持 pending。", - "verification": "无头窗口覆盖说明悬停延迟、点击固定、Escape、键盘操作,以及 ⓘ 悬停提示和点击固定的说明都显示在图标右侧(右侧放不下时换到左侧)、窄窗口实际值,外观和语言即时应用、恢复默认、关闭不回滚,以及日志窗口重绘和跟随系统外观;分别生成常规设置截图、与原版 macOS 布局对照。完整设置页、真实窗口与真实配置读写仍待验收,Windows 尚未运行本次测试。运行 scripts/desktop/desktop-go.sh test -race ./internal/logwindow ./internal/settingswindow ./internal/workbench -run 'TestOpenWindowRepaintsWhenLanguageAndAppearanceChange|TestGeneral|TestSettingsChangesUpdateSharedStateAndPersist|TestSystemAppearanceChangesSharedStateWhenFollowingSystem' -count=3。 store 的 keep_test.go 覆盖保存保留新版本写的键、不复活当前版本清空的键、保留读不了形状的值并由 Unread 报出、键名按 encoding/json 规则匹配;workbench 的 settings_kept_test.go 覆盖新版本写的设置只通知一次并保留,标题栏布局和编辑器会话中读不了的值会记日志。运行 scripts/desktop/desktop-go.sh test -race ./internal/store ./internal/workbench -run 'TestSave|TestLoad|TestUnread|TestSettingsANewerVersion|TestALayoutPart|TestAnEditorSession'。 #1943:TestSaveAfterAFailedLoadSetsTheUnreadableFileAside、TestSaveSetsNothingAsideOnceTheUnreadableFileIsGone 与 TestSaveAfterAFailedLoadWritesWhenTheFileIsAlreadyGone 覆盖读不出的文件在保存前另存且内容不变、同一次失败只另存一次、其他文件不受影响、文件已删除或被 Remove 后不另存;运行 scripts/desktop/desktop-go.sh test ./internal/store -run 'TestSave|TestLoad|TestUnread' -count=1。", + "notes": "Viva 设置窗口的每个侧栏页都已接入:外观、常规、更新、网络、编辑器、字体、快捷键、进程终止、插件、版本控制、构建与工具链、语言(插件贡献的动态页)、终端、AI 生成与 IDE API;外观与语言选择后立即应用。尚未完成原版界面像素级对照或跨平台实机验收。 本次按 main-macos-live-baseline(源提交 a824bd5c)校准 900×700 初始窗口、234pt 侧栏、24pt 导航行、深浅色页面/卡片/下拉层级和页边距;已检查 macOS 原生通用页及语言下拉,仍不代表所有设置页逐像素验收。 本轮全页对照将自动保存入口移回通用页,终端 Shell 改为共享下拉并保留检测/缺失/自动生效值,退出策略按原版合并同行,更新页拆开版本与操作。 编辑器标签的滚动、压缩和多行布局统一为共享下拉,选择多行时保留先前单行溢出偏好。TestVisualSettings 以离线事实采集深浅色页面和菜单;工具真实来源与未实现设置项仍按既有状态记录,不能把截图覆盖当原生验收。 正式版与 AutoBuild 共用同一份设置:读到当前版本不认识的键,或字段在、但存的形状读不了的值时,照常用默认行为运行,保存时把这些值原样写回,不删除;不认识的键每组只通知一次,形状读不了的值记 app.settings.decode_failed(编辑器会话记 editor_session_load)。当前版本改过或清空的字段以当前版本为准。 Viva 2026-11-16:侧栏“构建、执行、部署”“语言与框架”在有插件贡献子页时与“工具”一样可折叠,选中子页时自动展开所属分组。自动化:TestContributedPagesGoUnderBuildOrLanguages。原生验收仍 pending。 2026-11-16 #1943:偏好文件读取或 JSON 解码失败后,下一次 Save 先把原文件改名为 <名称>.unreadable- 另存,再写入新值,原内容不被默认值覆盖;启动时提示另存位置仍待补齐。macOS/Windows 共用 Go 实现,实机验收保持 pending。 2026-11-18:设置窗口的 ⓘ 和工作台、日志窗口一致,只用悬停提示;点击不再弹出会固定的白色说明卡片,因此 Escape 关闭卡片、键盘 Space/Return 打开说明也一并取消。键盘聚焦不显示提示(Viva ui 层未开放 ShowOnFocus),辅助技术仍能读出说明。", + "verification": "无头窗口覆盖 ⓘ 说明只在指针停留时以客户端共享提示气泡显示在图标右侧(右侧放不下时换到左侧)、点击图标只收起提示而不再固定白色说明卡片、辅助技术把说明读作图标描述,窄窗口实际值,外观和语言即时应用、恢复默认、关闭不回滚,以及日志窗口重绘和跟随系统外观;分别生成常规设置截图、与原版 macOS 布局对照。完整设置页、真实窗口与真实配置读写仍待验收,Windows 尚未运行本次测试。运行 scripts/desktop/desktop-go.sh test -race ./internal/logwindow ./internal/settingswindow ./internal/workbench -run 'TestOpenWindowRepaintsWhenLanguageAndAppearanceChange|TestGeneral|TestSettingsChangesUpdateSharedStateAndPersist|TestSystemAppearanceChangesSharedStateWhenFollowingSystem' -count=3。 store 的 keep_test.go 覆盖保存保留新版本写的键、不复活当前版本清空的键、保留读不了形状的值并由 Unread 报出、键名按 encoding/json 规则匹配;workbench 的 settings_kept_test.go 覆盖新版本写的设置只通知一次并保留,标题栏布局和编辑器会话中读不了的值会记日志。运行 scripts/desktop/desktop-go.sh test -race ./internal/store ./internal/workbench -run 'TestSave|TestLoad|TestUnread|TestSettingsANewerVersion|TestALayoutPart|TestAnEditorSession'。 #1943:TestSaveAfterAFailedLoadSetsTheUnreadableFileAside、TestSaveSetsNothingAsideOnceTheUnreadableFileIsGone 与 TestSaveAfterAFailedLoadWritesWhenTheFileIsAlreadyGone 覆盖读不出的文件在保存前另存且内容不变、同一次失败只另存一次、其他文件不受影响、文件已删除或被 Remove 后不另存;运行 scripts/desktop/desktop-go.sh test ./internal/store -run 'TestSave|TestLoad|TestUnread' -count=1。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": { diff --git a/shared/platform-feature-matrix/features/macos-shared-hover-tooltip-style.json b/shared/platform-feature-matrix/features/macos-shared-hover-tooltip-style.json index a00bdb165..000a4f67c 100644 --- a/shared/platform-feature-matrix/features/macos-shared-hover-tooltip-style.json +++ b/shared/platform-feature-matrix/features/macos-shared-hover-tooltip-style.json @@ -53,5 +53,5 @@ ] } }, - "notes": "Viva:放弃迁移(见 docs/viva-migration.md 对应行),不再按旧客户端行为对齐。 2026-11-12:viva 新增 gfx.TooltipStyle(Lithe-IDEA/viva#10),workbench 明暗两套主题写入 IDEA 表面:4pt 圆角、12/8 内边距、13pt 文字、各自背景/文字/1pt 边框色。 2026-11-18:此前只有工作台设置了提示样式(浅色是 IDEA Editor.ToolTip 的白底描边气泡),设置窗口和日志窗口沿用 Viva 默认反色气泡,同一客户端有两种提示;白底气泡的描边在箭头处断开。改为 uistyle.Tooltip 一份样式,三个窗口的主题都使用它:浅色改为 IDEA ToolTip 的深底白字,深色保留 #33353B,都不描边。Viva 箭头描边缺陷另行修复(Lithe-IDEA/Lithe-viva#42,上游 vivaui/viva#305),当前样式不描边,不依赖该修复。原生窗口验收保持 pending。" + "notes": "Viva:放弃迁移(见 docs/viva-migration.md 对应行),不再按旧客户端行为对齐。 2026-11-12:viva 新增 gfx.TooltipStyle(Lithe-IDEA/viva#10),workbench 明暗两套主题写入 IDEA 表面:4pt 圆角、12/8 内边距、13pt 文字、各自背景/文字/1pt 边框色。 2026-11-18:此前只有工作台设置了提示样式(浅色是 IDEA Editor.ToolTip 的白底描边气泡),设置窗口和日志窗口沿用 Viva 默认反色气泡,同一客户端有两种提示;白底气泡的描边在箭头处断开。改为 uistyle.Tooltip 一份样式,三个窗口的主题都使用它:浅色改为 IDEA ToolTip 的深底白字,深色保留 #33353B,都不描边。Viva 箭头描边缺陷另行修复(Lithe-IDEA/Lithe-viva#42,上游 vivaui/viva#305),当前样式不描边,不依赖该修复。设置窗口的 ⓘ 原来点击后还会固定一张白色说明卡片(Viva Popover),现已去掉,三个窗口的 ⓘ 都只用这份悬停提示。原生窗口验收保持 pending。" }