diff --git a/desktop/internal/settingswindow/controller.go b/desktop/internal/settingswindow/controller.go index 952236a34..2fd8fc00a 100644 --- a/desktop/internal/settingswindow/controller.go +++ b/desktop/internal/settingswindow/controller.go @@ -63,6 +63,10 @@ type Values struct { Theme string // MarketplaceWidth is a layout preference, applied on completed resize, not a draft setting. MarketplaceWidth float32 + // WindowWidth and WindowHeight are the size the window opens at, the one the user last + // gave it (Options.WindowResized); zero opens it at its default size. Like + // MarketplaceWidth they are a layout preference, not a draft setting. + WindowWidth, WindowHeight int // EditorTabRows is TabRowsMultiple when an editor group's tabs wrap onto more rows; empty // keeps them in one row. EditorTabOverflow says what one row does with tabs that do not // fit: TabOverflowSqueeze makes them narrower, and empty scrolls them sideways. @@ -406,6 +410,12 @@ type Options struct { MarketplaceRejected func(int) // MarketplaceResized persists a completed splitter gesture or keyboard step. MarketplaceResized func(float32) + // WindowResized keeps the size the user gave the window, for Values.WindowWidth and + // WindowHeight of the next one. It runs once, on the settings window's thread, when the + // window closes at a size other than the one it opened at, so it must hand the size to + // its owner. An owner that closes the window as it closes itself takes the size from + // Controller.ResizedWindow first, because this report comes after the close. + WindowResized func(width, height int) // PluginState reports what the plugin page shows about one plugin. It is read // while painting, so it must answer from memory rather than from disk. Nil // treats every plugin as not installed and hides the plugin actions. @@ -740,6 +750,20 @@ func (c *Controller) Close() { } } +// ResizedWindow is the size the user gave the open window since it opened, with ok false +// when no window is open or it still has the size it opened at. It is for an owner that +// closes the window as it closes itself: Options.WindowResized reports the size only after +// the close. It is safe from any goroutine. +func (c *Controller) ResizedWindow() (width, height int, ok bool) { + c.mu.Lock() + defer c.mu.Unlock() + if c.current == nil { + return 0, 0, false + } + size, resized := c.current.resized() + return size.width, size.height, resized +} + // Invalidate repaints the open settings window after shared application state changes. func (c *Controller) Invalidate() { c.mu.Lock() diff --git a/desktop/internal/settingswindow/ui_baseline_test.go b/desktop/internal/settingswindow/ui_baseline_test.go index 6b3210b04..3006dceb2 100644 --- a/desktop/internal/settingswindow/ui_baseline_test.go +++ b/desktop/internal/settingswindow/ui_baseline_test.go @@ -25,12 +25,12 @@ func TestBaselineSettingsControlsFitReferenceWindow(t *testing.T) { w := newWindow(NewController(Options{}), Values{Theme: "dark", Language: "en"}) d := openWindow(t, w) shot := d.driver.Snapshot() - if shot.Width != 900 || shot.Height != 700 { - t.Fatalf("initial window=%dx%d, want 900x700", shot.Width, shot.Height) + if shot.Width != 1270 || shot.Height != 700 { + t.Fatalf("initial window=%dx%d, want 1270x700", shot.Width, shot.Height) } for _, label := range []string{"Search settings", "Language", "Cancel", "OK"} { hit := d.hit(label) - if hit.Bounds.X < 0 || hit.Bounds.Y < 0 || hit.Bounds.X+hit.Bounds.Width > 900 || hit.Bounds.Y+hit.Bounds.Height > 700 { + if hit.Bounds.X < 0 || hit.Bounds.Y < 0 || hit.Bounds.X+hit.Bounds.Width > 1270 || hit.Bounds.Y+hit.Bounds.Height > 700 { t.Fatalf("%s outside reference window: %v", label, hit.Bounds) } } diff --git a/desktop/internal/settingswindow/window.go b/desktop/internal/settingswindow/window.go index 3d7de95c0..f0c3c8592 100644 --- a/desktop/internal/settingswindow/window.go +++ b/desktop/internal/settingswindow/window.go @@ -1,6 +1,7 @@ package settingswindow import ( + "math" "sync" "sync/atomic" @@ -16,7 +17,9 @@ import ( // The metrics of the window, after the macOS client's settings window and the log window. const ( - windowWidth, windowHeight = 900, 700 + // windowWidth and windowHeight are the size the window opens at until the user gives it + // another, which it then keeps (Values.WindowWidth, Options.WindowResized). + windowWidth, windowHeight = 1270, 700 windowMinWidth = 900 windowMinHeight = 668 @@ -89,6 +92,12 @@ type window struct { win *app.Window stopWatch func() gone bool + // openedSize is the size the window opened at and size the size of its content in the last + // frame the system reported, which is kept when it differs (closed, Controller.ResizedWindow). + // size is guarded by ctrl.mu too: the window's thread sets it, and the owner may read it + // from its own thread. + openedSize windowSize + size windowSize inv app.Invalidator page *ui.Page @@ -243,9 +252,25 @@ type labelsKey struct { systemDark bool } +// windowSize is the size of a window's content area, in logical pixels. +type windowSize struct { + width, height int +} + +// openingSize is the size a window opens at: the one the user last gave it, or the default +// when none is kept, and never under the smallest. +func openingSize(width, height int) windowSize { + if width <= 0 || height <= 0 { + width, height = windowWidth, windowHeight + } + return windowSize{width: max(width, windowMinWidth), height: max(height, windowMinHeight)} +} + // newWindow returns a window whose values start from the settings in force. func newWindow(c *Controller, current Values) *window { w := &window{ctrl: c, sess: newSession(current)} + w.openedSize = openingSize(current.WindowWidth, current.WindowHeight) + w.size = w.openedSize width := current.MarketplaceWidth if width <= 0 { width = marketListWidth @@ -288,8 +313,8 @@ func (w *window) config() app.Config { config := ui.Configure(w.page, app.Config{ Title: w.ctrl.text().Settings.Title, Icon: appicon.Window(), - Width: windowWidth, - Height: windowHeight, + Width: w.openedSize.width, + Height: w.openedSize.height, MinWidth: windowMinWidth, MinHeight: windowMinHeight, WindowMode: app.WindowCustomTitlebar, @@ -297,6 +322,7 @@ func (w *window) config() app.Config { WindowControls: func() app.WindowControlsStyle { return windowcontrols.Style(w.pal.text, w.ctrl.text()) }, Invalidator: &w.inv, OnWake: w.wake, + OnFrameChange: w.framed, OnClosed: w.closed, // Chords of printable keys reach the window as shortcuts, not as keys of the // control that has the focus; the one the Keymap page records arrives here. @@ -398,9 +424,30 @@ func (w *window) native() *app.Window { return w.win } +// framed takes the size of the window's content from a frame the system reports. It is the +// window's own size: Viva reports no frame while the window is full screen, maximized or +// minimized. A live resize reports every step, so the size is only noted here and kept when +// the window closes, never written per frame. +func (w *window) framed(frame gfx.Rect) { + size := windowSize{width: int(math.Round(float64(frame.Width))), height: int(math.Round(float64(frame.Height)))} + if size.width <= 0 || size.height <= 0 { + return + } + w.ctrl.mu.Lock() + w.size = size + w.ctrl.mu.Unlock() +} + +// resized is the size the user gave the window since it opened, if any. The caller holds +// ctrl.mu. +func (w *window) resized() (windowSize, bool) { + return w.size, w.size != w.openedSize +} + // closed runs once the native window is gone, however it was closed: the session is over, -// the system look is no longer watched and the controller forgets the window, so the next -// Open makes a new one. The Page has cancelled its effects by then. +// the system look is no longer watched, the controller forgets the window, so the next Open +// makes a new one, and a size the user gave the window is kept for that one. The Page has +// cancelled its effects by then. func (w *window) closed() { w.closeRegion() w.dismissPluginInstall() @@ -416,10 +463,14 @@ func (w *window) closed() { if c.current == w { c.current = nil } + size, resized := w.resized() c.mu.Unlock() if stop != nil { stop() } + if resized && c.opts.WindowResized != nil { + c.opts.WindowResized(size.width, size.height) + } } // accept is OK: it writes the Build pages' drafts, then closes the window (build_apply.go). diff --git a/desktop/internal/settingswindow/window_size_test.go b/desktop/internal/settingswindow/window_size_test.go new file mode 100644 index 000000000..b534ec1ad --- /dev/null +++ b/desktop/internal/settingswindow/window_size_test.go @@ -0,0 +1,114 @@ +package settingswindow + +import ( + "testing" +) + +// TestWindowOpensAtTheSizeTheUserLastGaveIt covers where a new window takes its size: the one +// kept from the last window, the default 1270×700 when none is kept or the kept one is +// unusable, and never under the smallest. +func TestWindowOpensAtTheSizeTheUserLastGaveIt(t *testing.T) { + for _, test := range []struct { + name string + width, height int + want windowSize + }{ + {"none kept", 0, 0, windowSize{1270, 700}}, + {"kept", 1100, 760, windowSize{1100, 760}}, + {"one side missing", 1100, 0, windowSize{windowWidth, windowHeight}}, + {"negative", -1, 760, windowSize{windowWidth, windowHeight}}, + {"under the smallest", 640, 480, windowSize{windowMinWidth, windowMinHeight}}, + } { + t.Run(test.name, func(t *testing.T) { + w := newWindow(NewController(Options{}), Values{WindowWidth: test.width, WindowHeight: test.height}) + d := openWindow(t, w) + shot := d.driver.Snapshot() + if shot.Width != test.want.width || shot.Height != test.want.height { + t.Fatalf("window opened at %dx%d, want %dx%d", shot.Width, shot.Height, test.want.width, test.want.height) + } + }) + } +} + +// TestClosingKeepsTheSizeTheUserGaveTheWindow covers the report a closing window makes: the +// last size of a live resize, once, and nothing when the window was only moved or ends at the +// size it opened at. +func TestClosingKeepsTheSizeTheUserGaveTheWindow(t *testing.T) { + type report struct{ width, height, count int } + open := func(t *testing.T, current Values) (*windowDriver, *report) { + t.Helper() + got := &report{} + c := NewController(Options{WindowResized: func(width, height int) { + got.width, got.height = width, height + got.count++ + }}) + return openWindow(t, newWindow(c, current)), got + } + + t.Run("resized", func(t *testing.T) { + d, got := open(t, Values{}) + for _, size := range [][2]int{{1000, 690}, {1100, 760}, {1180, 820}} { + if err := d.driver.Resize(size[0], size[1]); err != nil { + t.Fatal(err) + } + } + if got.count != 0 { + t.Fatalf("the window reported its size %d times while it was being resized", got.count) + } + d.driver.Close() + if got.count != 1 || got.width != 1180 || got.height != 820 { + t.Fatalf("closing reported %+v, want 1180x820 once", *got) + } + }) + t.Run("moved only", func(t *testing.T) { + d, got := open(t, Values{WindowWidth: 1100, WindowHeight: 760}) + if err := d.driver.MoveWindow(40, 60); err != nil { + t.Fatal(err) + } + d.driver.Close() + if got.count != 0 { + t.Fatalf("a window that was only moved reported its size: %+v", *got) + } + }) + t.Run("back to where it opened", func(t *testing.T) { + d, got := open(t, Values{WindowWidth: 1100, WindowHeight: 760}) + if err := d.driver.Resize(1000, 700); err != nil { + t.Fatal(err) + } + if err := d.driver.Resize(1100, 760); err != nil { + t.Fatal(err) + } + d.driver.Close() + if got.count != 0 { + t.Fatalf("a window back at the size it opened at reported it: %+v", *got) + } + }) +} + +// TestResizedWindowGivesTheSizeBeforeTheWindowCloses covers the owner that closes the window +// as it closes itself: it reads the size the user gave the open window before the close, +// because the window's own report comes after it. +func TestResizedWindowGivesTheSizeBeforeTheWindowCloses(t *testing.T) { + c := NewController(Options{}) + if _, _, ok := c.ResizedWindow(); ok { + t.Fatal("a controller with no window reported a size") + } + w := newWindow(c, Values{}) + d := openWindow(t, w) + c.mu.Lock() + c.current = w + c.mu.Unlock() + if _, _, ok := c.ResizedWindow(); ok { + t.Fatal("a window at the size it opened at reported a size") + } + if err := d.driver.Resize(1150, 780); err != nil { + t.Fatal(err) + } + if width, height, ok := c.ResizedWindow(); !ok || width != 1150 || height != 780 { + t.Fatalf("ResizedWindow() = %d, %d, %v, want 1150, 780, true", width, height, ok) + } + d.driver.Close() + if _, _, ok := c.ResizedWindow(); ok { + t.Fatal("a closed window still reported a size") + } +} diff --git a/desktop/internal/workbench/app.go b/desktop/internal/workbench/app.go index ceb07ab7b..5ad608b9f 100644 --- a/desktop/internal/workbench/app.go +++ b/desktop/internal/workbench/app.go @@ -341,6 +341,10 @@ type settings struct { Language string `json:"language,omitempty"` Theme themeChoice `json:"theme,omitempty"` MarketplaceWidth float32 `json:"marketplaceWidth,omitempty"` + // SettingsWindowWidth and SettingsWindowHeight are the size the user last gave the settings + // window, which the next one opens at; zero opens it at its default size. + SettingsWindowWidth int `json:"settingsWindowWidth,omitempty"` + SettingsWindowHeight int `json:"settingsWindowHeight,omitempty"` // MarketplaceSources are the custom plugin index URLs the user added, in the order they were added. MarketplaceSources []string `json:"marketplaceSources,omitempty"` // AutoUpdatePlugins lets approved marketplace plugins update with unchanged grants. @@ -1183,7 +1187,7 @@ func (a *App) closed() { a.closeClone() a.closeNewProject() a.closeProject() - a.settingsWindow.Close() + a.closeSettingsWindow() a.stopUpdates() } diff --git a/desktop/internal/workbench/app_test.go b/desktop/internal/workbench/app_test.go index 5215841d5..084c799f8 100644 --- a/desktop/internal/workbench/app_test.go +++ b/desktop/internal/workbench/app_test.go @@ -917,6 +917,35 @@ func TestMarketplaceWidthPersistsWithOtherSettings(t *testing.T) { } } +// TestSettingsWindowSizePersistsWithOtherSettings covers the size the user gave the settings +// window: it is saved with the other settings, only when it changes, and the next workbench +// reads it back for the settings window it opens. +func TestSettingsWindowSizePersistsWithOtherSettings(t *testing.T) { + h := newHarness(t, &testKernel{Client: core.NewClient()}) + h.app.setLanguage("zh-Hans") + h.app.setSettingsWindowSize(1100, 760) + var saved settings + found, err := h.store.Load(settingsFile, &saved) + if err != nil || !found { + t.Fatalf("load saved settings: found=%v err=%v", found, err) + } + if saved.SettingsWindowWidth != 1100 || saved.SettingsWindowHeight != 760 || saved.Language != "zh-Hans" || saved.Theme != themeDark { + t.Fatalf("saved settings lost values: %+v", saved) + } + if err := os.Remove(filepath.Join(h.store.Dir(), settingsFile)); err != nil { + t.Fatal(err) + } + h.app.setSettingsWindowSize(1100, 760) + if _, err := os.Stat(filepath.Join(h.store.Dir(), settingsFile)); !os.IsNotExist(err) { + t.Fatalf("an unchanged size saved the settings again: %v", err) + } + h.app.setSettingsWindowSize(1180, 820) + reloaded := newHarnessWithOptions(t, Options{Kernel: &testKernel{Client: core.NewClient()}, Store: h.store, Languages: []string{"zh-Hans"}}) + if got := reloaded.app.settings; got.SettingsWindowWidth != 1180 || got.SettingsWindowHeight != 820 { + t.Fatalf("reloaded settings window size = %dx%d, want 1180x820", got.SettingsWindowWidth, got.SettingsWindowHeight) + } +} + // TestWindowControlsFollowTheTitleBar covers the buttons Viva draws in the custom title bar on // Windows and Linux: unstyled, they took Viva's ink for its default dark clear color and were // white on the light title bar. They must take the ink of the title bar and the language of diff --git a/desktop/internal/workbench/settings.go b/desktop/internal/workbench/settings.go index 362641410..5bfb47ca8 100644 --- a/desktop/internal/workbench/settings.go +++ b/desktop/internal/workbench/settings.go @@ -96,6 +96,9 @@ func (a *App) newSettingsWindow() *settingswindow.Controller { MarketplaceResized: func(width float32) { a.post(func(a *App) { a.setMarketplaceWidth(width) }) }, + WindowResized: func(width, height int) { + a.post(func(a *App) { a.setSettingsWindowSize(width, height) }) + }, // The plugin page paints from memory and hands every action back, so the // window never installs, enables or removes anything on its own thread. PluginState: func(id string) settingswindow.PluginState { @@ -355,6 +358,32 @@ func (a *App) setMarketplaceWidth(width float32) { } } +// setSettingsWindowSize keeps the size the user gave the settings window, which the next one +// opens at. Every project tab of the window holds its own copy of the settings and saves it +// whole, so each tab takes the size: the next window opens at it whichever tab opens it, and no +// tab writes the old size back. One owner for the settings of every tab and window (#1851) +// replaces this. +func (a *App) setSettingsWindowSize(width, height int) { + if a.settings.SettingsWindowWidth == width && a.settings.SettingsWindowHeight == height { + return + } + for _, tab := range a.sessions.everyOne() { + tab.settings.SettingsWindowWidth, tab.settings.SettingsWindowHeight = width, height + } + a.settings.SettingsWindowWidth, a.settings.SettingsWindowHeight = width, height + a.saveSettings() +} + +// closeSettingsWindow closes the open settings window as this workbench closes. It keeps the +// size the user gave the window first, because the window reports it only once it has +// closed, to a queue this workbench no longer drains. +func (a *App) closeSettingsWindow() { + if width, height, ok := a.settingsWindow.ResizedWindow(); ok { + a.setSettingsWindowSize(width, height) + } + a.settingsWindow.Close() +} + // invalidateSettingsWindow repaints the open settings window after state one of its pages // reads changed off that window's thread. func (a *App) invalidateSettingsWindow() { @@ -437,6 +466,7 @@ func (a *App) openSettingsPageWith(surface actionSurface, page settingsPage, que } current := settingswindow.Values{ Language: a.settings.Language, Theme: string(a.settings.Theme), MarketplaceWidth: a.settings.MarketplaceWidth, + WindowWidth: a.settings.SettingsWindowWidth, WindowHeight: a.settings.SettingsWindowHeight, EditorTabRows: a.settings.EditorTabRows, EditorTabOverflow: a.settings.EditorTabOverflow, EditorTabLimit: settingswindow.TabLimitOf(a.settings.EditorTabLimit), EditorTabPolicy: a.settings.EditorTabPolicy, TerminalShell: a.settings.TerminalShell, TerminalScrollback: a.terminalScrollback(), diff --git a/desktop/internal/workbench/window_sessions.go b/desktop/internal/workbench/window_sessions.go index 27d95f50a..fba499721 100644 --- a/desktop/internal/workbench/window_sessions.go +++ b/desktop/internal/workbench/window_sessions.go @@ -275,7 +275,7 @@ func (s *windowSessions) leave(a *App) { a.stopWatchingDiagnostics() a.closeClone() a.closeNewProject() - a.settingsWindow.Close() + a.closeSettingsWindow() if a.root != nil { a.root.Close() } diff --git a/desktop/internal/workbench/window_sessions_test.go b/desktop/internal/workbench/window_sessions_test.go index 03f026795..d1e410ee5 100644 --- a/desktop/internal/workbench/window_sessions_test.go +++ b/desktop/internal/workbench/window_sessions_test.go @@ -140,6 +140,31 @@ func TestClosingAProjectTabShowsTheNextTab(t *testing.T) { } } +// A size the user gave the settings window from one project tab is every tab's: the next +// settings window opens at it from another tab, and a save of that tab's settings keeps it. +func TestSettingsWindowSizeIsEveryProjectTabs(t *testing.T) { + h, alpha, beta := newTabsHarness(t) + h.open(alpha) + h.app.openProject(beta) + h.settleTabs() + second := h.app.sessions.active + if second == h.app { + t.Fatal("beta did not open in a second tab") + } + h.app.setSettingsWindowSize(1100, 760) + if got := second.settings; got.SettingsWindowWidth != 1100 || got.SettingsWindowHeight != 760 { + t.Fatalf("beta's tab would open the settings window at %dx%d, want 1100x760", got.SettingsWindowWidth, got.SettingsWindowHeight) + } + second.setLanguage("zh-Hans") + var saved settings + if found, err := h.store.Load(settingsFile, &saved); err != nil || !found { + t.Fatalf("load saved settings: found=%v err=%v", found, err) + } + if saved.SettingsWindowWidth != 1100 || saved.SettingsWindowHeight != 760 || saved.Language != "zh-Hans" { + t.Fatalf("a save from beta's tab kept %dx%d, language %q; want 1100x760, zh-Hans", saved.SettingsWindowWidth, saved.SettingsWindowHeight, saved.Language) + } +} + // Closing the window closes the project of every tab, and the window closes only once all of // them have. func TestClosingTheWindowClosesEveryProjectTab(t *testing.T) { diff --git a/docs/assets/settings-window-size/general-after-dark.png b/docs/assets/settings-window-size/general-after-dark.png new file mode 100644 index 000000000..86f657991 Binary files /dev/null and b/docs/assets/settings-window-size/general-after-dark.png differ diff --git a/docs/assets/settings-window-size/general-before-dark.png b/docs/assets/settings-window-size/general-before-dark.png new file mode 100644 index 000000000..78b354bee Binary files /dev/null and b/docs/assets/settings-window-size/general-before-dark.png differ diff --git a/docs/assets/settings-window-size/plugins-after-light.png b/docs/assets/settings-window-size/plugins-after-light.png new file mode 100644 index 000000000..54479ab45 Binary files /dev/null and b/docs/assets/settings-window-size/plugins-after-light.png differ diff --git a/docs/assets/settings-window-size/plugins-before-light.png b/docs/assets/settings-window-size/plugins-before-light.png new file mode 100644 index 000000000..32fa65ce0 Binary files /dev/null and b/docs/assets/settings-window-size/plugins-before-light.png differ diff --git a/shared/platform-feature-matrix/features/application-settings.json b/shared/platform-feature-matrix/features/application-settings.json index 0342c3409..7abc0fa2b 100644 --- a/shared/platform-feature-matrix/features/application-settings.json +++ b/shared/platform-feature-matrix/features/application-settings.json @@ -27,7 +27,11 @@ "desktop/internal/settingswindow/build_directory_view.go", "desktop/internal/settingswindow/build_directory_view_test.go", "desktop/internal/settingswindow/build_search.go", - "desktop/internal/settingswindow/build_apply.go" + "desktop/internal/settingswindow/build_apply.go", + "desktop/internal/settingswindow/controller.go", + "desktop/internal/settingswindow/window_size_test.go", + "desktop/internal/workbench/app.go", + "desktop/internal/workbench/window_sessions_test.go" ] }, "windows": { @@ -50,12 +54,16 @@ "desktop/internal/store/keep_test.go", "desktop/internal/workbench/settings_kept.go", "desktop/internal/workbench/settings_kept_test.go", - "desktop/internal/store/store_test.go" + "desktop/internal/store/store_test.go", + "desktop/internal/settingswindow/controller.go", + "desktop/internal/settingswindow/window_size_test.go", + "desktop/internal/workbench/app.go", + "desktop/internal/workbench/window_sessions_test.go" ] }, "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。 2026-11-18:设置窗口的 ⓘ 和工作台、日志窗口一致,只用悬停提示;点击不再弹出会固定的白色说明卡片,因此 Escape 关闭卡片、键盘 Space/Return 打开说明也一并取消。键盘聚焦不显示提示(Viva ui 层未开放 ShowOnFocus),辅助技术仍能读出说明。 2026-11-18:删除外观与行为下的“更新”页,自动检查、更新渠道、发布源和立即检查整体迁入“关于”的更新卡片,侧栏少一行;自动化:TestDefaultSidebarListsTheTopLevelWithAppearanceExpanded、TestAboutPageNamesTheRunningVersionAsItIsReleased。 Viva 2026-11-18(构建设置重构):“构建、执行、部署”改为分组,选中时显示目录页,固定子页为“工具链”“调试器”,插件声明的页面按种类(构建工具、编译器)额外聚合到这里,插件详情的「设置」标签仍保留同一份设置和草稿;每个种类在侧栏只占一行并显示页面数,点开与“工具链”“调试器”一样分栏:左侧列出这一类的页面和提供插件,可按名称或插件筛选,右侧是选中页面的设置,再次打开回到上次看的页面;插件页只在搜索命中时单独出现在侧栏;目录页每个种类列出前 3 个名称并计数其余。只有 Build 页面或有草稿时页脚才显示“应用”,没有草稿时“好”直接关闭。自动化:TestBuildKindIsOneRowThatOpensItsPage、TestBuildKindFilterKeepsThePagesItMatchesAndTheKindRemembersOne、TestBuildPageNamesAKindAndOpensItsPage、TestSearchListsOnlyTheKindPagesItMatches,TestVisualSettings 的 32/33/34 场景生成截图。原生与 Windows 验收仍 pending。", - "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。", + "notes": "Viva 设置窗口的每个侧栏页都已接入:外观、常规、网络、编辑器、字体、快捷键、进程终止、插件、版本控制、构建与工具链、语言(插件贡献的动态页)、终端、AI 生成与 IDE API;外观与语言选择后立即应用。尚未完成原版界面像素级对照或跨平台实机验收。 本次按 main-macos-live-baseline(源提交 a824bd5c)校准初始窗口(当时 900×700,2026-11-21 起默认 1270×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),辅助技术仍能读出说明。 2026-11-18:删除外观与行为下的“更新”页,自动检查、更新渠道、发布源和立即检查整体迁入“关于”的更新卡片,侧栏少一行;自动化:TestDefaultSidebarListsTheTopLevelWithAppearanceExpanded、TestAboutPageNamesTheRunningVersionAsItIsReleased。 Viva 2026-11-18(构建设置重构):“构建、执行、部署”改为分组,选中时显示目录页,固定子页为“工具链”“调试器”,插件声明的页面按种类(构建工具、编译器)额外聚合到这里,插件详情的「设置」标签仍保留同一份设置和草稿;每个种类在侧栏只占一行并显示页面数,点开与“工具链”“调试器”一样分栏:左侧列出这一类的页面和提供插件,可按名称或插件筛选,右侧是选中页面的设置,再次打开回到上次看的页面;插件页只在搜索命中时单独出现在侧栏;目录页每个种类列出前 3 个名称并计数其余。只有 Build 页面或有草稿时页脚才显示“应用”,没有草稿时“好”直接关闭。自动化:TestBuildKindIsOneRowThatOpensItsPage、TestBuildKindFilterKeepsThePagesItMatchesAndTheKindRemembersOne、TestBuildPageNamesAKindAndOpensItsPage、TestSearchListsOnlyTheKindPagesItMatches,TestVisualSettings 的 32/33/34 场景生成截图。原生与 Windows 验收仍 pending。 2026-11-21:Viva 设置窗口默认尺寸改为 1270×700(最小仍为 900×668);用户调整后的尺寸会被记住,下次打开按该尺寸显示:窗口关闭时尺寸与打开时不同才写入应用设置(settingsWindowWidth/settingsWindowHeight),拖动过程中不写盘;工作台退出或关闭标签页连带关闭设置窗口时,先同步取走尺寸再关闭;同一窗口的各项目标签页共用这个尺寸,从哪个标签页打开都按它显示,其他标签页保存设置时也不会写回旧尺寸。全屏、最大化和最小化时的尺寸不记住(Viva 在这些状态不上报窗口帧),窗口位置不记住;记住的尺寸小于最小尺寸时按最小尺寸打开。自动化:TestWindowOpensAtTheSizeTheUserLastGaveIt、TestClosingKeepsTheSizeTheUserGaveTheWindow、TestResizedWindowGivesTheSizeBeforeTheWindowCloses、TestSettingsWindowSizePersistsWithOtherSettings、TestSettingsWindowSizeIsEveryProjectTabs,TestVisualSettings 生成 1270×700 截图。macOS 原生与 Windows 实机验收仍 pending。", + "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。 2026-11-21 设置窗口尺寸:首次打开(无已存尺寸)确认为 1270×700;拖动调整到其他尺寸后点“好”、“取消”或标题栏关闭,再打开确认按上次尺寸显示,重启应用后仍保持;调整尺寸后直接退出应用或关闭项目标签页,重开设置确认尺寸已保存;打开两个项目标签页,在一个标签页调整尺寸后关闭,从另一个标签页打开确认按新尺寸显示;只移动窗口不改尺寸、或改回打开时的尺寸,不写设置文件;全屏或最大化后关闭,确认下次按全屏前的尺寸打开。运行 scripts/desktop/desktop-go.sh test -race ./internal/settingswindow ./internal/workbench -run 'TestWindowOpensAtTheSizeTheUserLastGaveIt|TestClosingKeepsTheSizeTheUserGaveTheWindow|TestResizedWindowGivesTheSizeBeforeTheWindowCloses|TestBaselineSettingsControlsFitReferenceWindow|TestSettingsWindowSizePersistsWithOtherSettings|TestSettingsWindowSizeIsEveryProjectTabs' -count=1。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": {