diff --git a/desktop/go.mod b/desktop/go.mod index 3eed17021..1d2b99479 100644 --- a/desktop/go.mod +++ b/desktop/go.mod @@ -9,7 +9,7 @@ toolchain go1.27.4 require ( github.com/creack/pty v1.1.24 github.com/tailscale/hujson v0.0.0-20260727124030-b80ff77dac4f - github.com/vivaui/viva v0.6.8-0.20261123124712-471ea7ab5f81 + github.com/vivaui/viva v0.6.9-0.20261125164855-ac665a8f86e4 github.com/zalando/go-keyring v0.2.8 golang.org/x/sys v0.50.0 ) @@ -21,4 +21,4 @@ require ( github.com/pelletier/go-toml/v2 v2.4.3 // indirect ) -replace github.com/vivaui/viva => github.com/Lithe-IDEA/viva v0.6.8-0.20261125075943-36cbd3ab6859 +replace github.com/vivaui/viva => github.com/Lithe-IDEA/viva v0.6.9-0.20261125212154-448b0553faf8 diff --git a/desktop/go.sum b/desktop/go.sum index 3a283a09d..88b0a7ec7 100644 --- a/desktop/go.sum +++ b/desktop/go.sum @@ -1,5 +1,5 @@ -github.com/Lithe-IDEA/viva v0.6.8-0.20261125075943-36cbd3ab6859 h1:lH0J2vPKZT8iGBTPBo1NHhfkg2ub9jmGUg92N7cEnAA= -github.com/Lithe-IDEA/viva v0.6.8-0.20261125075943-36cbd3ab6859/go.mod h1:e9In6+J77G7B9ow4enZ2FSOFh7U3q4cQ5iJr3Qn/Olk= +github.com/Lithe-IDEA/viva v0.6.9-0.20261125212154-448b0553faf8 h1:173R5DZnHAMCKirBySDLwSV0CfUHl1SjqLRXxiCwwcY= +github.com/Lithe-IDEA/viva v0.6.9-0.20261125212154-448b0553faf8/go.mod h1:e9In6+J77G7B9ow4enZ2FSOFh7U3q4cQ5iJr3Qn/Olk= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ= diff --git a/desktop/internal/logwindow/exportsheet.go b/desktop/internal/logwindow/exportsheet.go index 7c6ae0d43..f09f2f8aa 100644 --- a/desktop/internal/logwindow/exportsheet.go +++ b/desktop/internal/logwindow/exportsheet.go @@ -49,7 +49,7 @@ func (w *window) exportSheet(c ui.C) { logs := &w.text.Logs m := &logs.ExportDialog open := true - ui.ModalWith(c, &open, logs.ExportLabel, ui.ModalSpec{Description: m.Subtitle, Width: exportSheetWidth}, func() { + ui.Modal(c, &open, logs.ExportLabel, ui.ModalSpec{Description: m.Subtitle, Width: exportSheetWidth}, func() { ui.Column(c).FillWidth().Items(ui.Start).Gap(exportGap).Children(func() { w.exportBody(c) }) diff --git a/desktop/internal/logwindow/toolbar.go b/desktop/internal/logwindow/toolbar.go index 933c673ab..9a072b827 100644 --- a/desktop/internal/logwindow/toolbar.go +++ b/desktop/internal/logwindow/toolbar.go @@ -448,7 +448,7 @@ func (w *window) rangeEditor(c ui.C, anchor ui.Box) { w.rangeEnd = end.Format(toolbarTimeFormat) } spec := ui.PopoverSpec{Width: toolbarRangeWidth, Align: ui.Start, Offset: toolbarMenuGap} - ui.PopoverWith(c, anchor, &w.menus.timeRange, spec, func() { + ui.Popover(c, anchor, &w.menus.timeRange, spec, func() { start, startOK := parseRangeTime(w.rangeStart) end, endOK := parseRangeTime(w.rangeEnd) readable := startOK && endOK diff --git a/desktop/internal/logwindow/window.go b/desktop/internal/logwindow/window.go index 3635e5502..017aa1944 100644 --- a/desktop/internal/logwindow/window.go +++ b/desktop/internal/logwindow/window.go @@ -532,7 +532,7 @@ func (w *window) status(c ui.C) { // name of a filter to save. func (w *window) dialogs(c ui.C) { logs := &w.text.Logs - ui.ModalWith(c, &w.clearOpen, logs.ClearTitle, ui.ModalSpec{Description: logs.ClearMessage, Width: 420}, nil, func() { + ui.Modal(c, &w.clearOpen, logs.ClearTitle, ui.ModalSpec{Description: logs.ClearMessage, Width: 420}, nil, func() { if ui.Button(c, logs.Cancel).Outline().Clicked() { w.clearOpen = false } @@ -541,7 +541,7 @@ func (w *window) dialogs(c ui.C) { w.clearOpen = false } }) - closed := ui.ModalWith(c, &w.bookmarkOpen, logs.NameForFilter, ui.ModalSpec{Width: 360}, func() { + closed := ui.Modal(c, &w.bookmarkOpen, logs.NameForFilter, ui.ModalSpec{Width: 360}, func() { field := ui.TextField(c, &w.bookmarkName, logs.NameForFilter, logs.NameForFilter).FillWidth() if field.Submitted() { w.saveBookmark() diff --git a/desktop/internal/pluginview/render.go b/desktop/internal/pluginview/render.go index e1f2939b5..0c063117b 100644 --- a/desktop/internal/pluginview/render.go +++ b/desktop/internal/pluginview/render.go @@ -21,8 +21,9 @@ type Host struct { Icon func(name string) (gfx.Icon, bool) // Images reads the PNGs of the plugin's package a canvas draws; nil draws none. Images *Images - // Info draws the host's ⓘ for an info text. - Info func(c ui.C, text string) + // Info draws the host's ⓘ for an info text. It is a callback the renderer calls with + // the paint's own c, as Viva's PageConfig.View is; it keeps no context. + Info func(c ui.C, text string) // viva:ignore kept-context // Settings is the settings page of a region; nil in a tool window. Settings SettingsHost } @@ -96,7 +97,7 @@ func Draw(c ui.C, s *Session, host *Host, fill bool) { canvas.RequestFrameIn(wait) } } - r := &renderer{c: c, s: s, host: host} + r := &renderer{s: s, host: host} // The paint measures the width the nodes are laid out in: the view's, less the body's // padding in a tool window. It sends open, and later resize; the scroll bars of the // body float over it, so they take none of the width. @@ -155,7 +156,6 @@ func hasTree(nodes []Node) bool { // renderer declares the nodes of one view in one paint. type renderer struct { - c ui.C s *Session host *Host // fillTree says a tree declared now is a top-level node of a view that fills its diff --git a/desktop/internal/settingswindow/command_install.go b/desktop/internal/settingswindow/command_install.go index 34ebd2c08..3b3f47e38 100644 --- a/desktop/internal/settingswindow/command_install.go +++ b/desktop/internal/settingswindow/command_install.go @@ -368,7 +368,7 @@ func (w *window) commandInstallModal(c ui.C) { installFailed := dialog.output != nil && !installing && dialog.installErr != nil var cancelled, confirmed, retried bool title := i18n.SharedFormat(language, "desktop.plugins.commandInstallTitle", map[string]string{"commands": commandList(dialog.missing.Commands)}) - closed := ui.ModalWith(c, &dialog.open, title, ui.ModalSpec{Width: 620, Description: dialog.pluginName}, func() { + closed := ui.Modal(c, &dialog.open, title, ui.ModalSpec{Width: 620, Description: dialog.pluginName}, func() { ui.Column(c).FillWidth().Gap(8).Children(func() { switch { case installing: diff --git a/desktop/internal/settingswindow/installed_view.go b/desktop/internal/settingswindow/installed_view.go index 902557430..1083b5cf4 100644 --- a/desktop/internal/settingswindow/installed_view.go +++ b/desktop/internal/settingswindow/installed_view.go @@ -632,7 +632,7 @@ func (w *window) uninstallModal(c ui.C, language i18n.Language) { return } title := i18n.SharedFormat(language, "native.uninstall", map[string]string{"arg1": s.uninstallName}) - ui.ModalWith(c.Part("uninstall"), &s.uninstallOpen, title, ui.ModalSpec{Width: 400}, nil, func() { + ui.Modal(c.Part("uninstall"), &s.uninstallOpen, title, ui.ModalSpec{Width: 400}, nil, func() { if ui.Button(c, i18n.Shared(language, "ui.cancel")).Outline().Clicked() { s.uninstallOpen = false } diff --git a/desktop/internal/settingswindow/keymap_import_view.go b/desktop/internal/settingswindow/keymap_import_view.go index f44eea859..130dd4489 100644 --- a/desktop/internal/settingswindow/keymap_import_view.go +++ b/desktop/internal/settingswindow/keymap_import_view.go @@ -77,7 +77,7 @@ func (w *window) keymapImportDialog(c ui.C) { return } language := w.marketLanguage() - ui.ModalWith(c.Part("keymap-import-dialog"), &s.open, i18n.Shared(language, "desktop.keymapImport.title"), ui.ModalSpec{Width: 620}, func() { + ui.Modal(c.Part("keymap-import-dialog"), &s.open, i18n.Shared(language, "desktop.keymapImport.title"), ui.ModalSpec{Width: 620}, func() { ui.Column(c).FillWidth().Gap(10).Children(func() { ui.Row(c).FillWidth().Gap(8).Items(ui.Center).Children(func() { source := s.format diff --git a/desktop/internal/settingswindow/keymap_schemes_view.go b/desktop/internal/settingswindow/keymap_schemes_view.go index e09fd96cd..1f6e4236f 100644 --- a/desktop/internal/settingswindow/keymap_schemes_view.go +++ b/desktop/internal/settingswindow/keymap_schemes_view.go @@ -135,7 +135,7 @@ func (w *window) keymapSchemeCard(c ui.C) { if s.operation == "delete" { title = i18n.Shared(w.marketLanguage(), "desktop.keymapSchemes.delete") } - ui.ModalWith(c.Part("scheme-name"), &s.open, title, ui.ModalSpec{Width: 410}, func() { + ui.Modal(c.Part("scheme-name"), &s.open, title, ui.ModalSpec{Width: 410}, func() { if s.operation != "delete" { ui.TextField(c, &s.name, i18n.Shared(w.marketLanguage(), "desktop.keymapSchemes.name"), "").FillWidth() } diff --git a/desktop/internal/settingswindow/local_history_view.go b/desktop/internal/settingswindow/local_history_view.go index 592811efd..aa6656a93 100644 --- a/desktop/internal/settingswindow/local_history_view.go +++ b/desktop/internal/settingswindow/local_history_view.go @@ -401,7 +401,7 @@ func (w *window) localHistoryCard(c ui.C) { }) }) if d.confirmClear { - ui.Modal(c, &d.confirmClear, i18n.Shared(language, "native.clearThisProjectSLocalHistory"), func() { + ui.Modal(c, &d.confirmClear, i18n.Shared(language, "native.clearThisProjectSLocalHistory"), ui.ModalSpec{}, func() { ui.Wrap(c, i18n.Shared(language, "native.everySavedVersionOfThisProjectSFilesIsDeletedOpenFilesAreNotChanged")).FontSize(12).Color(w.pal.text) }, func() { if ui.Button(c, i18n.Shared(language, "desktop.pluginSettings.actionCancel")).Outline().Clicked() { diff --git a/desktop/internal/settingswindow/marketplace_sources.go b/desktop/internal/settingswindow/marketplace_sources.go index b2ee4fa41..c2d8999a9 100644 --- a/desktop/internal/settingswindow/marketplace_sources.go +++ b/desktop/internal/settingswindow/marketplace_sources.go @@ -130,7 +130,7 @@ func (w *window) repositoriesModal(c ui.C, language i18n.Language) { w.repositoriesOpen = false } } - ui.ModalWith(c.Part("repositories-modal"), &w.repositoriesOpen, title, ui.ModalSpec{Width: 600}, body, footer) + ui.Modal(c.Part("repositories-modal"), &w.repositoriesOpen, title, ui.ModalSpec{Width: 600}, body, footer) if !w.repositoriesOpen { w.marketSourceNotice = "" } diff --git a/desktop/internal/settingswindow/plugin_install.go b/desktop/internal/settingswindow/plugin_install.go index fe6758222..4b965b8f1 100644 --- a/desktop/internal/settingswindow/plugin_install.go +++ b/desktop/internal/settingswindow/plugin_install.go @@ -195,7 +195,7 @@ func (w *window) pluginInstallModal(c ui.C) { if outcome == pluginInstallFailed { title = i18n.Shared(language, "desktop.marketplace.installFailed") } - closed := ui.ModalWith(c, &dialog.open, title, + closed := ui.Modal(c, &dialog.open, title, ui.ModalSpec{Width: 620, Description: description}, func() { ui.Column(c).FillWidth().Gap(8).Children(func() { switch { diff --git a/desktop/internal/settingswindow/plugin_region_view.go b/desktop/internal/settingswindow/plugin_region_view.go index 044c4ee7a..4b94c0551 100644 --- a/desktop/internal/settingswindow/plugin_region_view.go +++ b/desktop/internal/settingswindow/plugin_region_view.go @@ -330,7 +330,7 @@ func (s regionSettings) toolPicker(c ui.C, row ui.Box, language i18n.Language, s title = i18n.Shared(language, "desktop.buildSettings.optionsProject") } spec := ui.PopoverSpec{Align: ui.Start, Width: toolPickerWidth, ConsumeOutsidePress: true, Title: title} - ui.PopoverWith(c, row, open, spec, func() { + ui.Popover(c, row, open, spec, func() { before := scope.wanted(tool.ID) current := toolchainCurrent(tool) ui.Scroll(c.Part("choices")).Scrollbars().FillWidth().MaxHeight(toolPickerMaxHeight).Children(func() { diff --git a/desktop/internal/settingswindow/plugin_settings_actions_view.go b/desktop/internal/settingswindow/plugin_settings_actions_view.go index c5d5efe44..7e5c1bc35 100644 --- a/desktop/internal/settingswindow/plugin_settings_actions_view.go +++ b/desktop/internal/settingswindow/plugin_settings_actions_view.go @@ -36,7 +36,7 @@ func (w *window) pluginSettingActions(c ui.C) { } if confirmation := p.actionConfirmation; confirmation != nil { question := i18n.SharedFormat(language, "desktop.pluginSettings.actionConfirm", map[string]string{"action": confirmation.Title}) - ui.Modal(c, &p.confirmOpen, confirmation.Title, func() { + ui.Modal(c, &p.confirmOpen, confirmation.Title, ui.ModalSpec{}, func() { ui.Wrap(c, question).FontSize(12).Color(w.pal.text) }, func() { if ui.Button(c, i18n.Shared(language, "desktop.pluginSettings.actionCancel")).Outline().Disabled(p.running).Clicked() { diff --git a/desktop/internal/settingswindow/plugin_settings_view.go b/desktop/internal/settingswindow/plugin_settings_view.go index a74b20d0c..d94c3b9c1 100644 --- a/desktop/internal/settingswindow/plugin_settings_view.go +++ b/desktop/internal/settingswindow/plugin_settings_view.go @@ -3,7 +3,6 @@ package settingswindow import ( "errors" "strconv" - "strings" "github.com/1lck/Lithe-IDEA/desktop/internal/configfile" "github.com/1lck/Lithe-IDEA/desktop/internal/core" @@ -197,29 +196,6 @@ func (w *window) pluginSettingsFormRow(c ui.C, item pluginSettingLayout, hasSour } } -// readOnlyField shows value as a field that cannot be edited. Box.Disabled does not apply to -// a TextField in pinned Viva, so the field is the text it holds inside a frame, which -// assistive technology and the platform see as a read-only text field that takes no input. -func (w *window) readOnlyField(c ui.C, label, value string) { - ui.Row(c).Grow(1).MinWidth(0).Height(30).PadX(10).Border(1, w.pal.line).Radius(6).Items(ui.Center). - HitWith(ui.ID(c), label, gfx.HitOptions{Role: gfx.RoleTextField, Value: value, ReadOnly: true, Disabled: true}). - Children(func() { - ui.Text(c, value).FontSize(13).Color(w.pal.muted).Ellipsis() - }) -} - -// readOnlyList shows a list value that cannot be edited one item per line, as the TextArea -// shows it while it can be, so a read-only list is not cut down to its first item. -func (w *window) readOnlyList(c ui.C, label, value string) { - ui.Column(c).FillWidth().MinWidth(0).PadX(10).PadY(6).Gap(2).Border(1, w.pal.line).Radius(6). - HitWith(ui.ID(c), label, gfx.HitOptions{Role: gfx.RoleTextField, Value: value, ReadOnly: true, Disabled: true}). - Children(func() { - for _, line := range strings.Split(value, "\n") { - ui.Text(c, line).FontSize(13).Color(w.pal.muted).FillWidth().Ellipsis() - } - }) -} - // pluginSettingRow declares one setting on one line: its title on the leading side, and on // the trailing side the control for its kind and Reset, so the controls of a page line up // down its trailing edge. A text, path or list takes most of the line, and moves under the @@ -277,11 +253,7 @@ func (w *window) pluginSettingRow(c ui.C, index int, hasSource bool) { case "multiSelect": // Its options are listed under the line. default: - if disabled { - w.readOnlyField(c, declaration.Title, control.text) - } else { - ui.TextField(c, &control.text, declaration.Title, declaration.Placeholder).Grow(1).MinWidth(0).Height(30) - } + ui.TextField(c, &control.text, declaration.Title, declaration.Placeholder).ReadOnly(disabled).Grow(1).MinWidth(0).Height(30) if declaration.Kind == "file" || declaration.Kind == "directory" { if ui.Button(c, i18n.Shared(language, "desktop.pluginSettings.browse")).Outline().Small().Shrink(0).Disabled(disabled).Clicked() { // The native picker blocks, so it runs after the paint. diff --git a/desktop/internal/settingswindow/process_termination_view.go b/desktop/internal/settingswindow/process_termination_view.go index 4d0be599a..e8aef0eb5 100644 --- a/desktop/internal/settingswindow/process_termination_view.go +++ b/desktop/internal/settingswindow/process_termination_view.go @@ -117,7 +117,7 @@ func (w *window) stopTimeCard(c ui.C, value ProcessTermination) { if ui.Button(c.Part("shorter"), i18n.Shared(language, "desktop.settings.processTermination.stopTimeShorter")).Icon(icons.Minus).IconOnly().Ghost().Small().Disabled(!known || seconds <= rule.Min).Clicked() { w.setStopTime(value, rule, seconds-1) } - box := ui.TextFieldID(c, stopTimeFieldID, field, title, "").Width(60).Disabled(!known) + box := ui.TextField(c, field, title, "", ui.WithID(stopTimeFieldID)).Width(60).Disabled(!known) box.OnKey(func(event gfx.KeyEvent) gfx.EventResult { if event.Key == gfx.KeyEnter && !event.Release { w.commitStopTime(value, rule) diff --git a/desktop/internal/settingswindow/source_settings_entries_view.go b/desktop/internal/settingswindow/source_settings_entries_view.go index bcd2d30b8..c3785fd6f 100644 --- a/desktop/internal/settingswindow/source_settings_entries_view.go +++ b/desktop/internal/settingswindow/source_settings_entries_view.go @@ -245,7 +245,7 @@ func (w *window) sourceEntryChooser(c ui.C, p *sourceSettingsForm) { kind := field.EntryKinds[chooser.kind] available := choiceEntries(field, chooser.kind, control.input.Entries) title := i18n.SharedFormat(language, "desktop.sourceSettings.chooseTitle", map[string]string{"title": kind.Title}) - ui.ModalWith(c, &chooser.open, title, ui.ModalSpec{Width: 480, Height: 440}, func() { + ui.Modal(c, &chooser.open, title, ui.ModalSpec{Width: 480, Height: 440}, func() { if len(available) == 0 { ui.Wrap(c, i18n.Shared(language, "desktop.sourceSettings.chooseNone")).FontSize(12).Color(w.pal.muted) return diff --git a/desktop/internal/settingswindow/source_settings_view.go b/desktop/internal/settingswindow/source_settings_view.go index cdc3c4fed..68a1b296a 100644 --- a/desktop/internal/settingswindow/source_settings_view.go +++ b/desktop/internal/settingswindow/source_settings_view.go @@ -535,7 +535,9 @@ func (w *window) sourceSettingsControl(c ui.C, p *sourceSettingsForm, source cor return i18n.SharedFormat(language, "desktop.sourceSettings.inherit", map[string]string{"value": value}) } if disabled { - w.readOnlyField(c, field.Title, label(control.selected)) + // The choice stays readable and can be copied while the source takes no edit. + value := label(control.selected) + ui.TextField(c, &value, field.Title, "").ReadOnly(true).Grow(1).MinWidth(0).Height(30) return } if ui.Select(c, &control.selected, control.choices, label).Width(190).Label(accessibleTitle).Changed() { @@ -552,17 +554,15 @@ func (w *window) sourceSettingsControl(c ui.C, p *sourceSettingsForm, source cor } default: list := field.Kind == "stringList" || field.Kind == "fileList" - if disabled && list { - w.readOnlyList(c, field.Title, control.input.Text) - } else if disabled { - w.readOnlyField(c, field.Title, control.input.Text) - } else if list { - if ui.TextArea(c, &control.input.Text, field.Title, "").FillWidth().Height(100).Changed() { + // A source that takes no edit keeps the value in the same field, read-only, so it + // can still be selected and copied. + if list { + if ui.TextArea(c, &control.input.Text, field.Title, "").FillWidth().Height(100).ReadOnly(disabled).Changed() { control.input.Inherit = false p.changed(source.ID, field.ID) } } else { - if ui.TextField(c, &control.input.Text, field.Title, "").FillWidth().Height(30).Changed() { + if ui.TextField(c, &control.input.Text, field.Title, "").FillWidth().Height(30).ReadOnly(disabled).Changed() { control.input.Inherit = false p.changed(source.ID, field.ID) } diff --git a/desktop/internal/settingswindow/terminal_view.go b/desktop/internal/settingswindow/terminal_view.go index 01d2a1b54..0395533d9 100644 --- a/desktop/internal/settingswindow/terminal_view.go +++ b/desktop/internal/settingswindow/terminal_view.go @@ -213,7 +213,7 @@ func (w *window) scrollbackCard(c ui.C) { if ui.Button(c.Part("less"), i18n.Shared(language, "desktop.settings.terminal.scrollbackLess")).Icon(icons.Minus).IconOnly().Ghost().Small().Disabled(value <= MinScrollback).Clicked() { w.setTerminalScrollback(value-scrollbackStep, false) } - box := ui.TextFieldID(c, scrollbackFieldID, field, title, "").Width(90) + box := ui.TextField(c, field, title, "", ui.WithID(scrollbackFieldID)).Width(90) box.OnKey(func(event gfx.KeyEvent) gfx.EventResult { if event.Key == gfx.KeyEnter && !event.Release { w.commitScrollback() diff --git a/desktop/internal/settingswindow/updates_view.go b/desktop/internal/settingswindow/updates_view.go index a9b803fb1..e6009f1f8 100644 --- a/desktop/internal/settingswindow/updates_view.go +++ b/desktop/internal/settingswindow/updates_view.go @@ -341,7 +341,7 @@ func (w *window) updateChannelDialog(c ui.C, language i18n.Language, status Upda }) } } - closed := ui.ModalWith(c.Part("update-channel"), &open, title, ui.ModalSpec{Description: body, Width: 480}, content, func() { + closed := ui.Modal(c.Part("update-channel"), &open, title, ui.ModalSpec{Description: body, Width: 480}, content, func() { if ui.Button(c.Part("cancel"), w.text.Settings.Cancel).Outline().Clicked() { choice = "cancel" } diff --git a/desktop/internal/settingswindow/window_view.go b/desktop/internal/settingswindow/window_view.go index d503ec25e..affa5c34e 100644 --- a/desktop/internal/settingswindow/window_view.go +++ b/desktop/internal/settingswindow/window_view.go @@ -90,7 +90,7 @@ func (w *window) sidebar(c ui.C) { settings := &w.text.Settings ui.Column(c).Width(sidebarWidth).FillHeight().Shrink(0).Background(p.sidebar).Clip().Children(func() { ui.Row(c).FillWidth().Shrink(0).PadSides(10, 10, 8, 10).Children(func() { - search := ui.TextFieldID(c, searchID, &w.searchField, settings.Search, settings.Search).Icon(icons.Search).FillWidth().Height(searchHeight) + search := ui.TextField(c, &w.searchField, settings.Search, settings.Search, ui.WithID(searchID)).Icon(icons.Search).FillWidth().Height(searchHeight) if w.searchField.Text() != "" { search = search.Action(icons.X, i18n.Shared(w.marketLanguage(), "desktop.logs.clearSearch")) if search.ActionClicked() { diff --git a/desktop/internal/workbench/aicommit_view.go b/desktop/internal/workbench/aicommit_view.go index 9dae83c95..dab3d59b7 100644 --- a/desktop/internal/workbench/aicommit_view.go +++ b/desktop/internal/workbench/aicommit_view.go @@ -30,7 +30,7 @@ func (a *App) drawGeneratedMessageConfirm(c ui.C, p *project) { } t := a.text.AI.Commit open := true - closed := ui.ModalWith(c, &open, t.ReplaceTitle, ui.ModalSpec{Description: t.ReplaceBody, Width: 420}, func() { + closed := ui.Modal(c, &open, t.ReplaceTitle, ui.ModalSpec{Description: t.ReplaceBody, Width: 420}, func() { ui.Paragraph(c, firstLine(p.commit.ai.pending), 2) }, func() { if ui.Button(c, t.Keep).Outline().Clicked() { diff --git a/desktop/internal/workbench/branch_view.go b/desktop/internal/workbench/branch_view.go index dde8204fb..00037f31e 100644 --- a/desktop/internal/workbench/branch_view.go +++ b/desktop/internal/workbench/branch_view.go @@ -51,7 +51,7 @@ func branchInset(depth int) float32 { return chromeEdge + float32(depth)*branchI func (a *App) drawBranchPopup(c ui.C, p *project, anchor ui.Box) { b, t := &a.branch, a.text.Branch spec := ui.PopoverSpec{Align: ui.Start, Offset: chromeMenuOffset, Width: branchPopupWidth, ConsumeOutsidePress: true} - ui.PopoverWith(c, anchor, &b.open, spec, func() { + ui.Popover(c, anchor, &b.open, spec, func() { ui.Column(c).FillWidth().MaxHeight(branchPopupMaxHeight).Gap(chromeMenuItems).Children(func() { a.drawBranchPanel(c, p, t) }) @@ -199,7 +199,7 @@ func (a *App) drawWorkspaceBranchRepo(c ui.C, p *project, t i18n.BranchMessages, // The press that closes the panel goes on to the popup, so a click on another repository opens // that one's panel at once. spec := ui.PopoverSpec{Side: components.PopoverRight, Align: ui.Start, Offset: chromeMenuOffset, Width: branchPopupWidth} - ui.PopoverWith(c, row, &b.repoOpen, spec, func() { + ui.Popover(c, row, &b.repoOpen, spec, func() { ui.Column(c).FillWidth().MaxHeight(branchPopupMaxHeight).Gap(chromeMenuItems).Children(func() { if a.drawBranchActions(c, p, b.currentReference(), query, false) { ui.Divider(c) @@ -582,7 +582,7 @@ func (a *App) drawBranchDialog(c ui.C, p *project) { // dismisses it. func (a *App) branchDialogOf(c ui.C, title, description string, body, footer func()) { open := true - if ui.ModalWith(c, &open, title, ui.ModalSpec{Description: description, Width: branchDialogWidth}, body, footer) { + if ui.Modal(c, &open, title, ui.ModalSpec{Description: description, Width: branchDialogWidth}, body, footer) { c.After(a.cancelBranchDialog) } } diff --git a/desktop/internal/workbench/build_options.go b/desktop/internal/workbench/build_options.go index 0330cadfd..496fa0eb0 100644 --- a/desktop/internal/workbench/build_options.go +++ b/desktop/internal/workbench/build_options.go @@ -419,7 +419,7 @@ func (a *App) buildOptionsDialog(c ui.C, p *project) { if e.instance != "" { title = i18n.SharedFormat(language, "desktop.build.instanceOptions", map[string]string{"name": e.name}) } - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 460}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 460}, func() { ui.Column(c.Part("build-options")).FillWidth().Gap(10).Children(func() { a.buildIgnoredPathsSection(c.Part("detection"), p, ready) if e.instance != "" { diff --git a/desktop/internal/workbench/changelists_view.go b/desktop/internal/workbench/changelists_view.go index 0287414a2..74abf4527 100644 --- a/desktop/internal/workbench/changelists_view.go +++ b/desktop/internal/workbench/changelists_view.go @@ -151,7 +151,7 @@ func (a *App) drawChangeListDialog(c ui.C, p *project) { label := i18n.Shared(lang, "native.name") ready := !l.running && l.name.Text() != "" open, submitted := true, false - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 380}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 380}, func() { ui.Column(c).FillWidth().Gap(8).Children(func() { submitted = ui.TextField(c, &l.name, label, label).FillWidth().AutoFocus().Submitted() if l.nameError != "" { @@ -178,7 +178,7 @@ func (a *App) drawChangeListDialog(c ui.C, p *project) { Description: i18n.Shared(lang, "native.filesReturnToTheDefaultChangeListAndMayBeIncludedByStageAllTheirGitStagingStateIsUnchanged"), Width: 420, } - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "native.deleteChangeList.variant2"), spec, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "native.deleteChangeList.variant2"), spec, func() { ui.Text(c, a.changeListNameByID(p, l.target)).Weight(gfx.WeightMedium) }, func() { if ui.Button(c, cancel).Outline().Clicked() { diff --git a/desktop/internal/workbench/chrome_view.go b/desktop/internal/workbench/chrome_view.go index 3990c6262..05ca13ef1 100644 --- a/desktop/internal/workbench/chrome_view.go +++ b/desktop/internal/workbench/chrome_view.go @@ -445,7 +445,7 @@ func (a *App) hiddenToolWindowList(c ui.C, anchor ui.Box, z zone) { if z != zoneLeftTop && z != zoneRightTop { spec.Align = ui.End } - ui.PopoverWith(c, anchor, &open, spec, func() { + ui.Popover(c, anchor, &open, spec, func() { ui.Column(c).FillWidth().Gap(chromeMenuItems).Children(func() { for _, i := range a.chrome.hidden { row, clicked := a.hiddenToolWindowRow(c.KeyInt(i), i) @@ -630,7 +630,7 @@ func (a *App) projectMenu(c ui.C, anchor ui.Box) { picked, removed := -1, -1 spec := ui.PopoverSpec{Align: ui.Start, Offset: chromeMenuOffset, Width: chromeMenuWidth, ConsumeOutsidePress: true} open := true - ui.PopoverWith(c, anchor, &open, spec, func() { + ui.Popover(c, anchor, &open, spec, func() { ui.Scroll(c).Scrollbars().FillWidth().MaxHeight(chromeMenuMaxHeight).Gap(chromeMenuItems).Children(func() { created = a.menuAction(c.Part("new"), icons.Plus, a.text.Title.NewProjectItem) chosen = a.menuAction(c.Part("open"), icons.FolderOpen, a.text.Title.OpenItem) diff --git a/desktop/internal/workbench/clone_view.go b/desktop/internal/workbench/clone_view.go index 31a18e85c..77a65d648 100644 --- a/desktop/internal/workbench/clone_view.go +++ b/desktop/internal/workbench/clone_view.go @@ -18,7 +18,7 @@ func (a *App) cloneView(c ui.C) { parentLabel := i18n.Shared(language, "desktop.clone.parent") nameLabel := i18n.Shared(language, "desktop.clone.name") submitted, cancelled, confirmed := false, false, false - closed := ui.ModalWith(c, &cl.open, i18n.Shared(language, "desktop.clone.title"), ui.ModalSpec{Width: 570}, func() { + closed := ui.Modal(c, &cl.open, i18n.Shared(language, "desktop.clone.title"), ui.ModalSpec{Width: 570}, func() { ui.Column(c).FillWidth().Gap(10).Children(func() { ui.Text(c, sourceLabel) if ui.TextField(c, &cl.source, sourceLabel, i18n.Shared(language, "desktop.clone.sourcePlaceholder")).FillWidth().Disabled(cl.busy).Submitted() { diff --git a/desktop/internal/workbench/commit_view.go b/desktop/internal/workbench/commit_view.go index f10d183f2..202b5e11b 100644 --- a/desktop/internal/workbench/commit_view.go +++ b/desktop/internal/workbench/commit_view.go @@ -412,7 +412,7 @@ func (a *App) drawCommitOptions(c ui.C, cs *commitState, generates bool) { // they belong to; they line up with the gear at the bottom and grow upwards, and open on // the left when the panel is docked at the window's right edge. spec := ui.PopoverSpec{Side: components.PopoverRight, Align: ui.End, Width: 320} - ui.PopoverWith(c, button, &cs.optionsOpen, spec, func() { + ui.Popover(c, button, &cs.optionsOpen, spec, func() { ui.Column(c).FillWidth().Gap(8).Children(func() { a.commitOptionHeading(c, i18n.Shared(lang, "desktop.commit.optionsGit")) ui.Row(c).FillWidth().Items(ui.Center).Gap(4).Children(func() { @@ -573,7 +573,7 @@ func (a *App) drawCommitReview(c ui.C, p *project, target commitTarget) { questions[q.RepositoryID] = i } open := true - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Description: t.Order, Width: 520}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Description: t.Order, Width: 520}, func() { ui.Column(c).FillWidth().Gap(8).Children(func() { ui.Paragraph(c, t.MessageLine(firstLine(session.Message)), 2) if session.Amend { diff --git a/desktop/internal/workbench/credentials_import.go b/desktop/internal/workbench/credentials_import.go index 2cec03fc1..8297dade6 100644 --- a/desktop/internal/workbench/credentials_import.go +++ b/desktop/internal/workbench/credentials_import.go @@ -97,7 +97,7 @@ func (a *App) credentialImportView(c ui.C) { } lang := a.language() confirmed, cancelled := false, false - closed := ui.ModalWith(c, &in.confirming, i18n.Shared(lang, "desktop.credentials.importLegacyTitle"), + closed := ui.Modal(c, &in.confirming, i18n.Shared(lang, "desktop.credentials.importLegacyTitle"), ui.ModalSpec{Width: 460}, func() { ui.Wrap(c, i18n.Shared(lang, "desktop.credentials.importLegacyDescription")).FontSize(12).Muted() }, func() { diff --git a/desktop/internal/workbench/debug_breakpoints.go b/desktop/internal/workbench/debug_breakpoints.go index 436b073e7..605bae9eb 100644 --- a/desktop/internal/workbench/debug_breakpoints.go +++ b/desktop/internal/workbench/debug_breakpoints.go @@ -128,7 +128,7 @@ func (a *App) debugBreakpointEditor(c ui.C, p *project) { t := a.text.Debug.Breakpoint open := true title := t.Title(debugFileName(edit.path), strconv.FormatInt(edit.line, 10)) - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 460}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 460}, func() { ui.Column(c.Part("breakpoint-editor")).FillWidth().Gap(10).Children(func() { ui.TextField(c.Part("condition"), &edit.condition, t.Condition, t.ConditionPlaceholder).FillWidth() ui.TextField(c.Part("hit-condition"), &edit.hitCondition, t.HitCondition, t.HitConditionPlaceholder).FillWidth() diff --git a/desktop/internal/workbench/debug_view.go b/desktop/internal/workbench/debug_view.go index 2d6cf8e9e..1c0849827 100644 --- a/desktop/internal/workbench/debug_view.go +++ b/desktop/internal/workbench/debug_view.go @@ -247,7 +247,7 @@ func (a *App) debugRemotePrompt(c ui.C, p *project) { return } endpoint := d.remote.endpoint - closed := ui.Modal(c, open, t.RemoteTitle, func() { + closed := ui.Modal(c, open, t.RemoteTitle, ui.ModalSpec{}, func() { ui.Paragraph(c, t.RemotePrompt(endpoint), 4).Color(a.colors.Warning) }, func() { if ui.Button(c, t.RemoteCancel).Outline().Clicked() { @@ -300,7 +300,7 @@ func (a *App) debugBreakpointsDialog(c ui.C, p *project) { } t := a.text.Debug k := c.Part("breakpoints-dialog") - closed := ui.ModalWith(k, open, t.Breakpoints, ui.ModalSpec{Width: 560}, func() { + closed := ui.Modal(k, open, t.Breakpoints, ui.ModalSpec{Width: 560}, func() { ui.Column(k).FillWidth().Gap(6).Children(func() { a.debugBreakpoints(k, p) a.debugExceptionsView(k, p) diff --git a/desktop/internal/workbench/debug_watch.go b/desktop/internal/workbench/debug_watch.go index 110056370..f10ec84f1 100644 --- a/desktop/internal/workbench/debug_watch.go +++ b/desktop/internal/workbench/debug_watch.go @@ -377,7 +377,7 @@ func (a *App) debugWatchEditField(c ui.C, p *project) { c.After(func() { a.commitDebugWatchEdit(p) }) } label := i18n.Shared(a.language(), "native.editWatch") - field := ui.TextFieldID(c, id, &w.edit, label, a.text.Debug.WatchPlaceholder).FillWidth() + field := ui.TextField(c, &w.edit, label, a.text.Debug.WatchPlaceholder, ui.WithID(id)).FillWidth() field.OnKey(func(event gfx.KeyEvent) gfx.EventResult { if event.Key != gfx.KeyEscape { return gfx.EventResult{} diff --git a/desktop/internal/workbench/editor_find.go b/desktop/internal/workbench/editor_find.go index 3a2f7717f..cd990af71 100644 --- a/desktop/internal/workbench/editor_find.go +++ b/desktop/internal/workbench/editor_find.go @@ -264,7 +264,7 @@ func (a *App) editorFindBar(c ui.C, p *project, d *document) { c.Canvas().RequestFocus(queryID) f.focus = false } - ui.TextFieldID(c, queryID, &f.query, i18n.Shared(a.language(), "desktop.editorFind.find"), i18n.Shared(a.language(), "desktop.editorFind.find")).Icon(icons.Search).Grow(1).MinWidth(70).OnKey(func(event gfx.KeyEvent) gfx.EventResult { + ui.TextField(c, &f.query, i18n.Shared(a.language(), "desktop.editorFind.find"), i18n.Shared(a.language(), "desktop.editorFind.find"), ui.WithID(queryID)).Icon(icons.Search).Grow(1).MinWidth(70).OnKey(func(event gfx.KeyEvent) gfx.EventResult { if event.Release { return gfx.EventResult{} } diff --git a/desktop/internal/workbench/filetree_batch.go b/desktop/internal/workbench/filetree_batch.go index 9a67a7587..7e25254b8 100644 --- a/desktop/internal/workbench/filetree_batch.go +++ b/desktop/internal/workbench/filetree_batch.go @@ -224,7 +224,7 @@ func (a *App) treeRemovalDialog(c ui.C, p *project) { }) open = false } - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Description: description, Width: 440}, nil, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Description: description, Width: 440}, nil, func() { if ui.Button(c, i18n.Shared(lang, "desktop.files.cancel")).Outline().Clicked() { open = false } diff --git a/desktop/internal/workbench/filetree_menu.go b/desktop/internal/workbench/filetree_menu.go index ec018a3f7..4fb649bc2 100644 --- a/desktop/internal/workbench/filetree_menu.go +++ b/desktop/internal/workbench/filetree_menu.go @@ -318,7 +318,7 @@ func (a *App) treePromptDialog(c ui.C, p *project) { pr.open = false return } - closed := ui.Modal(c, &pr.open, title, func() { + closed := ui.Modal(c, &pr.open, title, ui.ModalSpec{}, func() { submitted := ui.TextField(c, &pr.name, i18n.Shared(language, "desktop.files.name"), i18n.Shared(language, "desktop.files.name")).FillWidth().Submitted() if pr.err != "" { ui.Text(c, pr.err).FontSize(12).Color(a.colors.Deleted) diff --git a/desktop/internal/workbench/git_auth.go b/desktop/internal/workbench/git_auth.go index ad3e6a801..6890fd7ac 100644 --- a/desktop/internal/workbench/git_auth.go +++ b/desktop/internal/workbench/git_auth.go @@ -118,7 +118,7 @@ func (a *App) gitAuthDialog(c ui.C) { if head.Remote { title = i18n.Shared(lang, "desktop.remoteAuth.title") } - closed := ui.ModalWith(c, &g.open, title, ui.ModalSpec{Width: gitAuthDialogWidth}, func() { + closed := ui.Modal(c, &g.open, title, ui.ModalSpec{Width: gitAuthDialogWidth}, func() { ui.Column(c).FillWidth().Gap(10).Children(func() { if head.Retry { ui.Wrap(c, i18n.Shared(lang, "desktop.gitAuth.retryMessage")) diff --git a/desktop/internal/workbench/git_gutter.go b/desktop/internal/workbench/git_gutter.go index 53ab0df8e..274032f5d 100644 --- a/desktop/internal/workbench/git_gutter.go +++ b/desktop/internal/workbench/git_gutter.go @@ -283,7 +283,7 @@ func (a *App) gitGutterPeek(c ui.C, p *project, d *document, anchor ui.Box) { return } h := *d.gutter.peek - ui.Popover(c.Key("gutterpeek"), anchor, &d.gutter.peekOpen, func() { + ui.Popover(c.Key("gutterpeek"), anchor, &d.gutter.peekOpen, ui.PopoverSpec{}, func() { ui.Column(c).Gap(6).MinWidth(280).Children(func() { ui.Text(c, i18n.Shared(a.language(), "desktop.git.gutter.before")).FontSize(12).Weight(gfx.WeightSemibold).Color(a.colors.Subtle) const maxLines = 20 diff --git a/desktop/internal/workbench/git_history_view.go b/desktop/internal/workbench/git_history_view.go index 40f8f17b4..c5858905e 100644 --- a/desktop/internal/workbench/git_history_view.go +++ b/desktop/internal/workbench/git_history_view.go @@ -159,7 +159,7 @@ func (a *App) drawHistoryRewriteDialog(c ui.C, p *project) { size := a.theme.Metrics.FontSizeS open := true spec := ui.ModalSpec{Description: i18n.Shared(lang, "git.historyReview.description"), Width: reviewDialogWidth, Height: reviewDialogHeight} - closed := ui.ModalWith(c, &open, historyRewriteTitle(lang, r.operation), spec, func() { + closed := ui.Modal(c, &open, historyRewriteTitle(lang, r.operation), spec, func() { ui.Column(c).Fill().Gap(8).Children(func() { if r.err != "" { ui.Paragraph(c, r.err, 4).FontSize(size).Color(a.theme.Danger) @@ -260,7 +260,7 @@ func (a *App) drawHistoryConfirmDialog(c ui.C, p *project) { action = i18n.Shared(lang, "native.revert") } open := true - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Description: description, Width: 460}, nil, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Description: description, Width: 460}, nil, func() { if ui.Button(c, i18n.Shared(lang, "desktop.gitReview.cancel")).Outline().Clicked() { open = false } @@ -279,7 +279,7 @@ func (a *App) drawHistoryResetDialog(c ui.C, p *project) { lang := a.language() open := true description := i18n.SharedFormat(lang, "git.resetToCommitPrompt", map[string]string{"hash": shortHash(h.reset.revision)}) - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "git.resetToCommit"), ui.ModalSpec{Description: description, Width: 460}, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "git.resetToCommit"), ui.ModalSpec{Description: description, Width: 460}, func() { ui.Column(c).FillWidth().Gap(4).Children(func() { for _, mode := range historyResetModes { button := ui.Button(c, historyResetModeText(lang, mode)).FillWidth() diff --git a/desktop/internal/workbench/git_rebase_view.go b/desktop/internal/workbench/git_rebase_view.go index 0d015c106..2af74539f 100644 --- a/desktop/internal/workbench/git_rebase_view.go +++ b/desktop/internal/workbench/git_rebase_view.go @@ -17,7 +17,7 @@ func (a *App) drawRebaseDialog(c ui.C, p *project) { lang := a.language() open := true description := i18n.SharedFormat(lang, "desktop.rebase.description", map[string]string{"hash": shortHash(r.base)}) - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "desktop.rebase.title"), ui.ModalSpec{Description: description, Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "desktop.rebase.title"), ui.ModalSpec{Description: description, Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { ui.Column(c).Fill().Gap(8).Children(func() { if r.err != "" { ui.Paragraph(c, r.err, 3).FontSize(a.theme.Metrics.FontSizeS).Color(a.theme.Danger) diff --git a/desktop/internal/workbench/gitconsole_view.go b/desktop/internal/workbench/gitconsole_view.go index 4f87586d3..87113bee1 100644 --- a/desktop/internal/workbench/gitconsole_view.go +++ b/desktop/internal/workbench/gitconsole_view.go @@ -48,7 +48,7 @@ func (a *App) consolePageView(c ui.C) { func (a *App) drawConsoleToolbar(c ui.C) { v, t := &a.consoleView, &a.text.Console ui.Row(c).Height(logToolbarHeight).Shrink(0).Items(ui.Center).Gap(4).PadX(6).Children(func() { - ui.TextFieldID(c, consoleSearchID, &v.search, t.Find, t.Find).MinWidth(150).Grow(1).MaxWidth(320) + ui.TextField(c, &v.search, t.Find, t.Find, ui.WithID(consoleSearchID)).MinWidth(150).Grow(1).MaxWidth(320) if v.searchFor != "" && v.counted { if v.total == 0 { a.drawConsoleCount(c, t.NoMatches) diff --git a/desktop/internal/workbench/github_create_view.go b/desktop/internal/workbench/github_create_view.go index a13195a59..6ad6eeb47 100644 --- a/desktop/internal/workbench/github_create_view.go +++ b/desktop/internal/workbench/github_create_view.go @@ -12,7 +12,7 @@ func (a *App) drawCreatePullRequestDialog(c ui.C, p *project) { cr := &a.prCreate lang := a.language() open := true - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "desktop.github.newPullRequest"), ui.ModalSpec{Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "desktop.github.newPullRequest"), ui.ModalSpec{Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { ui.Column(c).Fill().Gap(8).Children(func() { if cr.err != "" { ui.Paragraph(c, cr.err, 3).FontSize(a.theme.Metrics.FontSizeS).Color(a.theme.Danger) diff --git a/desktop/internal/workbench/github_prs_view.go b/desktop/internal/workbench/github_prs_view.go index 62a62cc01..3ef9e426f 100644 --- a/desktop/internal/workbench/github_prs_view.go +++ b/desktop/internal/workbench/github_prs_view.go @@ -15,7 +15,7 @@ func (a *App) drawPullRequestsDialog(c ui.C, p *project) { pr := &a.pullRequests lang := a.language() open := true - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "desktop.github.pullRequests"), ui.ModalSpec{Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "desktop.github.pullRequests"), ui.ModalSpec{Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { ui.Column(c).Fill().Gap(8).Children(func() { ui.Row(c).FillWidth().Shrink(0).Gap(6).Children(func() { if ui.Button(c, i18n.Shared(lang, "desktop.github.newPullRequest")).Outline().Disabled(pr.repo == nil && pr.err == "").Clicked() { diff --git a/desktop/internal/workbench/gitlinehistory_view.go b/desktop/internal/workbench/gitlinehistory_view.go index fb9ba9546..3b6f248a4 100644 --- a/desktop/internal/workbench/gitlinehistory_view.go +++ b/desktop/internal/workbench/gitlinehistory_view.go @@ -21,7 +21,7 @@ func (a *App) drawLineHistoryDialog(c ui.C, p *project) { "start": strconv.Itoa(h.start), "end": strconv.Itoa(h.end), }) - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "desktop.lineHistory.title"), ui.ModalSpec{Description: description, Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "desktop.lineHistory.title"), ui.ModalSpec{Description: description, Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { ui.Column(c).Fill().Gap(8).Children(func() { if h.err != "" { ui.Paragraph(c, h.err, 3).FontSize(a.theme.Metrics.FontSizeS).Color(a.theme.Danger) diff --git a/desktop/internal/workbench/gitlog_popover_view.go b/desktop/internal/workbench/gitlog_popover_view.go index abcfef320..629e59f82 100644 --- a/desktop/internal/workbench/gitlog_popover_view.go +++ b/desktop/internal/workbench/gitlog_popover_view.go @@ -43,7 +43,7 @@ func (a *App) drawLogPopover(c ui.C, p *project, which logPopover, anchor ui.Box } open := true spec := ui.PopoverSpec{Align: ui.Start, Offset: 4, Width: width, ConsumeOutsidePress: true} - ui.PopoverWith(c, anchor, &open, spec, func() { + ui.Popover(c, anchor, &open, spec, func() { switch l.popover { case logPopoverBranch: a.drawLogBranchFilter(c, p) @@ -154,7 +154,7 @@ func (a *App) drawLogUserFilter(c ui.C, p *project) { l, v, g := &p.log, &a.logView, a.text.Git query := strings.ToLower(strings.TrimSpace(v.userSearch.Text())) ui.Row(c).PadY(4).PadX(4).Children(func() { - ui.TextFieldID(c, logUserSearchID, &v.userSearch, g.SearchUsers, g.SearchUsers).Grow(1) + ui.TextField(c, &v.userSearch, g.SearchUsers, g.SearchUsers, ui.WithID(logUserSearchID)).Grow(1) }) ui.Scroll(c).Scrollbars().FillWidth().MaxHeight(logListMaxHeight).Children(func() { if l.user != "" { @@ -231,7 +231,7 @@ func (a *App) drawLogPathFilter(c ui.C, p *project) { } ui.Column(c).FillWidth().Gap(8).Children(func() { ui.Text(c, g.PathTitle).Weight(gfx.WeightMedium) - if ui.TextFieldID(c, logPathID, &v.pathField, g.PathTitle, g.PathPlaceholder).FillWidth().Submitted() { + if ui.TextField(c, &v.pathField, g.PathTitle, g.PathPlaceholder, ui.WithID(logPathID)).FillWidth().Submitted() { c.After(func() { apply(v.pathField.Text()) }) } ui.Row(c).FillWidth().Gap(8).Items(ui.Center).Children(func() { diff --git a/desktop/internal/workbench/gitlog_ref_menu.go b/desktop/internal/workbench/gitlog_ref_menu.go index d401c8bfd..6176abdf0 100644 --- a/desktop/internal/workbench/gitlog_ref_menu.go +++ b/desktop/internal/workbench/gitlog_ref_menu.go @@ -364,7 +364,7 @@ func (a *App) drawRefIntegrateDialog(c ui.C, p *project) { description = i18n.SharedFormat(lang, "native.pullIntoTheCurrentBranchWithAMerge", map[string]string{"arg1": name}) } open := true - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Description: description, Width: 460}, nil, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Description: description, Width: 460}, nil, func() { if ui.Button(c, i18n.Shared(lang, "desktop.gitReview.cancel")).Outline().Clicked() { open = false } diff --git a/desktop/internal/workbench/gitlog_view.go b/desktop/internal/workbench/gitlog_view.go index 10f58ab85..f1c16499c 100644 --- a/desktop/internal/workbench/gitlog_view.go +++ b/desktop/internal/workbench/gitlog_view.go @@ -199,7 +199,7 @@ func (a *App) drawLogReferences(c ui.C, p *project) ui.Box { v.refSel = l.refSelected return ui.Column(c).FillHeight().Background(a.colors.Panel).Clip().Children(func() { ui.Row(c).Height(logToolbarHeight).Shrink(0).Items(ui.Center).PadX(6).Children(func() { - ui.TextFieldID(c, logRefSearchID, &v.refSearch, g.BranchSearch, g.BranchSearch).Grow(1) + ui.TextField(c, &v.refSearch, g.BranchSearch, g.BranchSearch, ui.WithID(logRefSearchID)).Grow(1) }) ui.Divider(c) // A level starts an icon and a gap right of its parent, so a row's arrow or icon is under @@ -565,7 +565,7 @@ func (a *App) drawLogToolbar(c ui.C, p *project) { searchMin = logSearchWidth(v.barWidth, v.filtersWidth) } ui.Row(c).Height(logToolbarHeight).FillWidth().Shrink(0).Items(ui.Center).Gap(logBarGap).PadX(logBarPad).Draw(v.barDraw).Children(func() { - ui.TextFieldID(c, logSearchID, &v.search, g.TextOrHash, g.TextOrHash).MinWidth(searchMin).Grow(1).MaxWidth(320) + ui.TextField(c, &v.search, g.TextOrHash, g.TextOrHash, ui.WithID(logSearchID)).MinWidth(searchMin).Grow(1).MaxWidth(320) ui.Row(c).Shrink(1).MinWidth(0).Clip().Items(ui.Center).Children(func() { ui.Row(c).Shrink(0).Items(ui.Center).Gap(logBarGap).Draw(v.filtersDraw).Children(func() { a.drawLogFilters(c, p) diff --git a/desktop/internal/workbench/gitpush_workspace_view.go b/desktop/internal/workbench/gitpush_workspace_view.go index 7a2ebd7e8..524b58e60 100644 --- a/desktop/internal/workbench/gitpush_workspace_view.go +++ b/desktop/internal/workbench/gitpush_workspace_view.go @@ -27,7 +27,7 @@ func (a *App) drawWorkspacePushDialog(c ui.C, p *project) { size := a.theme.Metrics.FontSizeS open := true spec := ui.ModalSpec{Description: i18n.Shared(lang, "desktop.git.pushAll.description"), Width: reviewDialogWidth, Height: reviewDialogHeight} - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "desktop.git.pushAll.title"), spec, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "desktop.git.pushAll.title"), spec, func() { ui.Column(c).Fill().Gap(8).Children(func() { switch { case !s.reviewed && s.err != "": diff --git a/desktop/internal/workbench/gitreview_diff_view.go b/desktop/internal/workbench/gitreview_diff_view.go index c4570ebe8..a3d4ad20d 100644 --- a/desktop/internal/workbench/gitreview_diff_view.go +++ b/desktop/internal/workbench/gitreview_diff_view.go @@ -73,7 +73,7 @@ func (a *App) drawBlameDialog(c ui.C, p *project) { b := &p.review.blame open := true title := i18n.SharedFormat(a.language(), "desktop.gitReview.blameTitle", map[string]string{"file": b.path}) - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: reviewDialogWidth, Height: reviewDialogHeight}, func() { switch { case b.loading: a.gitEmpty(c, i18n.Shared(a.language(), "git.loadingDiff")) @@ -124,7 +124,7 @@ func (a *App) drawUntrackedDialog(c ui.C, p *project) { directory := u.trail[len(u.trail)-1] open := true title := i18n.SharedFormat(a.language(), "desktop.gitReview.untrackedTitle", map[string]string{"path": directory}) - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 620, Height: 440}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 620, Height: 440}, func() { switch { case u.loading: a.gitEmpty(c, i18n.Shared(a.language(), "git.loadingDiff")) @@ -173,7 +173,7 @@ func (a *App) drawRollbackDialog(c ui.C, p *project) { r := &p.review.rollback open := true count := strconv.Itoa(len(r.changes)) - closed := ui.ModalWith(c, &open, i18n.Shared(a.language(), "git.rollback.title"), ui.ModalSpec{Width: 520, + closed := ui.Modal(c, &open, i18n.Shared(a.language(), "git.rollback.title"), ui.ModalSpec{Width: 520, Description: i18n.SharedFormat(a.language(), "git.rollbackPathsConfirm", map[string]string{"count": count})}, func() { ui.Column(c).FillWidth().Gap(8).Children(func() { ui.Paragraph(c, i18n.Shared(a.language(), "git.rollback.warning"), 4).FontSize(a.theme.Metrics.FontSizeS).Color(a.colors.Subtle) diff --git a/desktop/internal/workbench/gitreview_tools_view.go b/desktop/internal/workbench/gitreview_tools_view.go index 3b8ef9237..b5df40e55 100644 --- a/desktop/internal/workbench/gitreview_tools_view.go +++ b/desktop/internal/workbench/gitreview_tools_view.go @@ -55,7 +55,7 @@ func (a *App) drawPushDialog(c ui.C, p *project) { s := &p.review.push title := i18n.SharedFormat(a.language(), "git.pushDialog.title", map[string]string{"repository": p.name}) open := true - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 640, Height: 480, Description: i18n.Shared(a.language(), "git.pushDialog.description")}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 640, Height: 480, Description: i18n.Shared(a.language(), "git.pushDialog.description")}, func() { ui.Column(c).Fill().Gap(8).Children(func() { switch { case s.loading && !s.hasPrev: @@ -167,7 +167,7 @@ func (a *App) drawPushDialog(c ui.C, p *project) { func (a *App) drawToolsDialog(c ui.C, p *project) { t := &p.review.tools open := true - closed := ui.ModalWith(c, &open, i18n.Shared(a.language(), "git.repositories"), ui.ModalSpec{Width: 720, Height: 520}, func() { + closed := ui.Modal(c, &open, i18n.Shared(a.language(), "git.repositories"), ui.ModalSpec{Width: 720, Height: 520}, func() { ui.Column(c).Fill().Gap(8).Children(func() { if t.err != "" { ui.Paragraph(c, t.err, 3).FontSize(a.theme.Metrics.FontSizeS).Color(a.theme.Danger) diff --git a/desktop/internal/workbench/gitsync_view.go b/desktop/internal/workbench/gitsync_view.go index bfbf9c463..f9ae10f39 100644 --- a/desktop/internal/workbench/gitsync_view.go +++ b/desktop/internal/workbench/gitsync_view.go @@ -70,7 +70,7 @@ func (a *App) drawSyncDialog(c ui.C, p *project) { // the user dismisses it. func (a *App) syncDialogOf(c ui.C, p *project, title, description string, body, footer func()) { open := true - if ui.ModalWith(c, &open, title, ui.ModalSpec{Description: description, Width: branchDialogWidth}, body, footer) { + if ui.Modal(c, &open, title, ui.ModalSpec{Description: description, Width: branchDialogWidth}, body, footer) { c.After(func() { p.log.sync.dialog = syncDialogNone }) } } diff --git a/desktop/internal/workbench/gitworktree_view.go b/desktop/internal/workbench/gitworktree_view.go index 9e53f18a9..d8c99757a 100644 --- a/desktop/internal/workbench/gitworktree_view.go +++ b/desktop/internal/workbench/gitworktree_view.go @@ -728,7 +728,7 @@ func (a *App) worktreeConfirm(c ui.C, title, prompt, targetPath, note, confirm s c.After(run) } } - if ui.ModalWith(c, &open, title, ui.ModalSpec{Description: prompt, Width: branchDialogWidth}, body, footer) { + if ui.Modal(c, &open, title, ui.ModalSpec{Description: prompt, Width: branchDialogWidth}, body, footer) { c.After(a.cancelWorktreeDialog) } } @@ -835,7 +835,7 @@ func (a *App) drawWorktreeCreateDialog(c ui.C, p *project) { c.After(func() { a.submitCreateWorktree(p) }) } } - if ui.ModalWith(c, &open, t.CreateTitle, ui.ModalSpec{Width: branchDialogWidth}, body, footer) { + if ui.Modal(c, &open, t.CreateTitle, ui.ModalSpec{Width: branchDialogWidth}, body, footer) { c.After(a.cancelWorktreeDialog) } if submitted && ready { diff --git a/desktop/internal/workbench/inlineedit_view.go b/desktop/internal/workbench/inlineedit_view.go index 858bd9856..e6e68af74 100644 --- a/desktop/internal/workbench/inlineedit_view.go +++ b/desktop/internal/workbench/inlineedit_view.go @@ -20,7 +20,7 @@ func (a *App) inlineEditView(c ui.C, p *project) { title = t.ReviewTitle } open := true - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 640}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 640}, func() { ui.Column(c).FillWidth().Gap(8).Children(func() { if !s.hasResult { scope := i18n.Shared(a.language(), "desktop.ai.inlineEdit.editSelection") diff --git a/desktop/internal/workbench/legacy_import.go b/desktop/internal/workbench/legacy_import.go index 0a2f5a5a0..f8f80996e 100644 --- a/desktop/internal/workbench/legacy_import.go +++ b/desktop/internal/workbench/legacy_import.go @@ -242,7 +242,7 @@ func (a *App) legacyImportView(c ui.C) { chosen := slices.ContainsFunc(s.items, func(item legacyImportItem) bool { return item.chosen }) confirmed, cancelled := false, false spec := ui.ModalSpec{Description: i18n.SharedFormat(language, "desktop.legacyImport.description", map[string]string{"source": s.found.Source}), Width: 480} - closed := ui.ModalWith(c, &s.open, i18n.Shared(language, "desktop.legacyImport.title"), spec, func() { + closed := ui.Modal(c, &s.open, i18n.Shared(language, "desktop.legacyImport.title"), spec, func() { ui.Column(c.Part("legacy-import")).FillWidth().Gap(6).Children(func() { for index := range s.items { entry := &s.items[index] diff --git a/desktop/internal/workbench/local_history_view.go b/desktop/internal/workbench/local_history_view.go index 46b90fd01..7a8ed6435 100644 --- a/desktop/internal/workbench/local_history_view.go +++ b/desktop/internal/workbench/local_history_view.go @@ -23,7 +23,7 @@ func (a *App) drawLocalHistory(c ui.C, p *project) { } t := a.text.History open := true - closed := ui.ModalWith(c, &open, t.Title, ui.ModalSpec{Width: 760, Description: h.rel}, func() { + closed := ui.Modal(c, &open, t.Title, ui.ModalSpec{Width: 760, Description: h.rel}, func() { ui.Column(c.Part("local-history")).FillWidth().Gap(8).Children(func() { if h.failure != "" { ui.Paragraph(c, h.failure, 4).Color(a.theme.Danger) diff --git a/desktop/internal/workbench/markdown_preview.go b/desktop/internal/workbench/markdown_preview.go index 152e84a98..e17d537fe 100644 --- a/desktop/internal/workbench/markdown_preview.go +++ b/desktop/internal/workbench/markdown_preview.go @@ -365,7 +365,7 @@ func (a *App) markdownContentsButton(c ui.C, p *project, d *document) { top = min(top, h.level) } spec := ui.PopoverSpec{Align: ui.End, Width: markdownContentsWidth, ConsumeOutsidePress: true, Title: title} - ui.PopoverWith(c, button, &s.contentsOpen, spec, func() { + ui.Popover(c, button, &s.contentsOpen, spec, func() { height := min(float32(len(s.headings))*markdownContentsRow, markdownContentsMax) ui.List(c, &s.contents, len(s.headings), func(row ui.ListRow) { h := s.headings[row.Index] diff --git a/desktop/internal/workbench/memory_monitor.go b/desktop/internal/workbench/memory_monitor.go index da224a857..8e8918185 100644 --- a/desktop/internal/workbench/memory_monitor.go +++ b/desktop/internal/workbench/memory_monitor.go @@ -433,7 +433,7 @@ func (a *App) memoryDetails(c ui.C, anchor ui.Box) { c.Canvas().RequestFrameIn(memoryDetailInterval) language := a.language() spec := ui.PopoverSpec{Side: components.PopoverTop, Align: ui.End, Offset: chromeMenuOffset, Width: memoryPanelWidth, ConsumeOutsidePress: true} - ui.PopoverWith(c.Key("memoryDetails"), anchor, &m.open, spec, func() { + ui.Popover(c.Key("memoryDetails"), anchor, &m.open, spec, func() { ui.Column(c).FillWidth().Gap(memorySectionGap).Children(func() { a.memoryHeader(c, language) switch { diff --git a/desktop/internal/workbench/navigation_view.go b/desktop/internal/workbench/navigation_view.go index a82ce06dd..c5b82742b 100644 --- a/desktop/internal/workbench/navigation_view.go +++ b/desktop/internal/workbench/navigation_view.go @@ -23,11 +23,11 @@ func (a *App) navigationPopup(c ui.C) { language := a.language() label := i18n.Shared(language, "desktop.navigation.label") cancelled, confirmed, submitted := false, false, false - closed := ui.ModalWith(c, &v.open, i18n.Shared(language, "desktop.navigation.title"), + closed := ui.Modal(c, &v.open, i18n.Shared(language, "desktop.navigation.title"), ui.ModalSpec{Width: 360, InitialFocus: navigationField, NoClose: true}, func() { ui.Row(c).FillWidth().Items(ui.Center).Gap(8).Children(func() { ui.Text(c, label) - submitted = ui.TextFieldID(c, navigationField, &v.input, label, "").Grow(1).MinWidth(0).Submitted() + submitted = ui.TextField(c, &v.input, label, "", ui.WithID(navigationField)).Grow(1).MinWidth(0).Submitted() }) }, func() { cancelled = ui.Button(c, a.text.Settings.Cancel).Outline().Clicked() diff --git a/desktop/internal/workbench/new_project_view.go b/desktop/internal/workbench/new_project_view.go index e2e5567f8..4ae215852 100644 --- a/desktop/internal/workbench/new_project_view.go +++ b/desktop/internal/workbench/new_project_view.go @@ -154,7 +154,7 @@ func (a *App) newProjectModal(c ui.C) { divider, sidebar = gfx.RGB24(0x333438), gfx.RGB24(0x232427) } open := true - ui.ModalWith(c, &open, i18n.Shared(language, "desktop.newProject.title"), ui.ModalSpec{Width: 880, Height: 660}, func() { + ui.Modal(c, &open, i18n.Shared(language, "desktop.newProject.title"), ui.ModalSpec{Width: 880, Height: 660}, func() { ui.Row(c).Fill().Children(func() { a.newProjectSidebar(c, language, sidebar, divider) ui.Column(c).Width(1).FillHeight().Shrink(0).Background(divider) diff --git a/desktop/internal/workbench/notifications.go b/desktop/internal/workbench/notifications.go index 25335c905..d390dd9d0 100644 --- a/desktop/internal/workbench/notifications.go +++ b/desktop/internal/workbench/notifications.go @@ -313,7 +313,7 @@ func (a *App) notificationPanel(c ui.C, anchor ui.Box) { align = ui.Start } spec := ui.PopoverSpec{Side: components.PopoverTop, Align: align, Offset: chromeMenuOffset, Width: notificationPanelWidth, ConsumeOutsidePress: true} - ui.PopoverWith(c, anchor, ¢er.open, spec, func() { + ui.Popover(c, anchor, ¢er.open, spec, func() { ui.Row(c).FillWidth().Height(28).Items(ui.Center).Gap(8).Children(func() { ui.Text(c, i18n.Shared(language, "desktop.notifications.title")).Weight(gfx.WeightSemibold).Grow(1).Ellipsis() a.notificationClearButton(c) diff --git a/desktop/internal/workbench/notifications_test.go b/desktop/internal/workbench/notifications_test.go index 5194a633b..b3073ebdb 100644 --- a/desktop/internal/workbench/notifications_test.go +++ b/desktop/internal/workbench/notifications_test.go @@ -212,6 +212,13 @@ func TestFailureNoticeOpensTheLogsOfTheActionThatFailed(t *testing.T) { t.Fatalf("%d toasts offer %s, want only the failure's", n, viewLogs) } + // The failure's toast sits behind the newest one in the collapsed stack; the pointer + // resting on the stack spreads it out, as a user's does, before the press. + collapsed := center(h.pageHit(viewLogs).Bounds) + if err := h.driver.Move(collapsed.X, collapsed.Y); err != nil { + t.Fatal(err) + } + h.settle() h.clickNamed(viewLogs) h.settle() if len(opened) != 1 || opened[0] != failed { diff --git a/desktop/internal/workbench/pluginprompt.go b/desktop/internal/workbench/pluginprompt.go index 97fedf9d4..108e6ec92 100644 --- a/desktop/internal/workbench/pluginprompt.go +++ b/desktop/internal/workbench/pluginprompt.go @@ -132,7 +132,7 @@ func (a *App) pluginPromptView(c ui.C) { // The modal is named by the prompt's own open flag, so a following prompt // is a new dialog; it is raised again for each paint the prompt is first. prompt.open = true - dismissed := ui.ModalWith(c, &prompt.open, prompt.title, ui.ModalSpec{Width: 520, Height: 320}, func() { + dismissed := ui.Modal(c, &prompt.open, prompt.title, ui.ModalSpec{Width: 520, Height: 320}, func() { if prompt.quick != nil { if a.quickInputBody(c, prompt.quick) { chosen = 1 diff --git a/desktop/internal/workbench/pluginsemantics_view.go b/desktop/internal/workbench/pluginsemantics_view.go index 36dd78447..3a04e1750 100644 --- a/desktop/internal/workbench/pluginsemantics_view.go +++ b/desktop/internal/workbench/pluginsemantics_view.go @@ -359,7 +359,7 @@ func (a *App) renameDialog(c ui.C) { language := a.language() label := i18n.Shared(language, "desktop.semantics.renameName") submitted, cancelled, confirmed := false, false, false - closed := ui.ModalWith(c, &state.open, i18n.Shared(language, "desktop.semantics.renameTitle"), + closed := ui.Modal(c, &state.open, i18n.Shared(language, "desktop.semantics.renameTitle"), ui.ModalSpec{Description: i18n.Shared(language, "desktop.semantics.renameDescription"), Width: 420}, func() { submitted = ui.TextField(c, &state.name, label, label).FillWidth().Disabled(state.busy).Submitted() }, func() { diff --git a/desktop/internal/workbench/recent_files.go b/desktop/internal/workbench/recent_files.go index 8d3198551..fd0704469 100644 --- a/desktop/internal/workbench/recent_files.go +++ b/desktop/internal/workbench/recent_files.go @@ -157,7 +157,7 @@ func (a *App) recentFilesPopup(c ui.C) { if v.edited { title = i18n.Shared(a.language(), "desktop.recentFiles.edited") } - ui.ModalWith(c.Part("recent-files"), &v.open, title, ui.ModalSpec{Width: 660}, func() { + ui.Modal(c.Part("recent-files"), &v.open, title, ui.ModalSpec{Width: 660}, func() { submitted := ui.TextField(c.Part("query"), &v.query, i18n.Shared(a.language(), "desktop.recentFiles.query"), "").Icon(icons.Search).FillWidth().Submitted() open := func(entry core.EditorRecentEntry) { v.open = false diff --git a/desktop/internal/workbench/remote_host_files_view.go b/desktop/internal/workbench/remote_host_files_view.go index c667d921a..54b1cec7f 100644 --- a/desktop/internal/workbench/remote_host_files_view.go +++ b/desktop/internal/workbench/remote_host_files_view.go @@ -32,7 +32,7 @@ func (a *App) remoteHostFilesPopup(c ui.C) { ui.Stack(c.Part("remote-host-files-anchor")).Fill().Children(func() { anchor = ui.Row(c).Absolute().Left((bounds.Width - width) / 2).Top(84).Width(width).Height(1) }) - closed := ui.PopoverWith(c.Part("remote-host-files"), anchor, &f.open, ui.PopoverSpec{ + closed := ui.Popover(c.Part("remote-host-files"), anchor, &f.open, ui.PopoverSpec{ Width: width, Offset: 1, Align: ui.Start, KeepOpenOnAnchor: true, }, func() { ui.Column(c).FillWidth().Height(height).Gap(8).Children(func() { @@ -40,8 +40,8 @@ func (a *App) remoteHostFilesPopup(c ui.C) { ui.Text(c, i18n.Shared(language, "desktop.remote.hostFile.title")).Bold().Shrink(0) ui.Text(c, p.remote.remoteLocation()).FontSize(a.theme.Metrics.FontSizeS).Color(a.colors.Subtle).Ellipsis().Shrink(1).MinWidth(0) }) - ui.TextFieldID(c, remoteHostFilesQueryID, &f.query, i18n.Shared(language, "desktop.remote.hostFile.title"), - i18n.Shared(language, "desktop.remote.hostFile.placeholder")).Icon(icons.FolderOpen) + ui.TextField(c, &f.query, i18n.Shared(language, "desktop.remote.hostFile.title"), + i18n.Shared(language, "desktop.remote.hostFile.placeholder"), ui.WithID(remoteHostFilesQueryID)).Icon(icons.FolderOpen) a.remoteHostFilesList(c, p) if text := remoteSkippedText(language, f.skipped); text != "" { ui.Text(c, text).FontSize(a.theme.Metrics.FontSizeS).Color(a.colors.Subtle).Ellipsis() diff --git a/desktop/internal/workbench/remote_port_rules_view.go b/desktop/internal/workbench/remote_port_rules_view.go index e64ec82fc..f48071a50 100644 --- a/desktop/internal/workbench/remote_port_rules_view.go +++ b/desktop/internal/workbench/remote_port_rules_view.go @@ -241,7 +241,7 @@ func (a *App) remotePortRuleDialog(c ui.C, p *project) { title = i18n.Shared(language, "desktop.remote.ports.ruleConfirmReverseTitle") } unavailable := p.remote.session == "" || draft.starting - closed := ui.Modal(c.Part("ports-rule"), &ports.ruleOpen, title, func() { + closed := ui.Modal(c.Part("ports-rule"), &ports.ruleOpen, title, ui.ModalSpec{}, func() { if draft.confirm != remotePortRuleNoConfirm { ui.Paragraph(c, a.remotePortRuleQuestion(p, draft), 6).Color(a.colors.Warning) return diff --git a/desktop/internal/workbench/remote_ports_view.go b/desktop/internal/workbench/remote_ports_view.go index 548bf7e0b..3e99abd59 100644 --- a/desktop/internal/workbench/remote_ports_view.go +++ b/desktop/internal/workbench/remote_ports_view.go @@ -378,7 +378,7 @@ func (a *App) remotePortsConfirm(c ui.C, p *project) { language := a.language() pending := *ports.confirm target := net.JoinHostPort(pending.host, strconv.Itoa(int(pending.key.port))) - closed := ui.Modal(c.Part("ports-confirm"), &ports.confirmOpen, i18n.Shared(language, "desktop.remote.ports.confirmTitle"), func() { + closed := ui.Modal(c.Part("ports-confirm"), &ports.confirmOpen, i18n.Shared(language, "desktop.remote.ports.confirmTitle"), ui.ModalSpec{}, func() { ui.Paragraph(c, i18n.SharedFormat(language, "desktop.remote.ports.confirmBody", map[string]string{"target": target, "name": p.remote.name}), 5).Color(a.colors.Warning) }, func() { @@ -408,7 +408,7 @@ func (a *App) remotePortsLocal(c ui.C, p *project) { language := a.language() row, _ := ports.row(*ports.local) remote, _ := remotePortsRemote(language, row) - closed := ui.Modal(c.Part("ports-local"), &ports.localOpen, i18n.Shared(language, "desktop.remote.ports.localTitle"), func() { + closed := ui.Modal(c.Part("ports-local"), &ports.localOpen, i18n.Shared(language, "desktop.remote.ports.localTitle"), ui.ModalSpec{}, func() { ui.Paragraph(c, i18n.SharedFormat(language, "desktop.remote.ports.localBody", map[string]string{"remote": remote, "name": p.remote.name}), 5).Color(a.colors.Text) submitted := ui.TextField(c.Part("ports-local-field"), &ports.localField, i18n.Shared(language, "desktop.remote.ports.localLabel"), @@ -456,7 +456,7 @@ func (a *App) remotePortsLabel(c ui.C, p *project) { return } language := a.language() - closed := ui.Modal(c.Part("ports-label"), &ports.labelOpen, i18n.Shared(language, "desktop.remote.ports.labelTitle"), func() { + closed := ui.Modal(c.Part("ports-label"), &ports.labelOpen, i18n.Shared(language, "desktop.remote.ports.labelTitle"), ui.ModalSpec{}, func() { ui.Paragraph(c, i18n.Shared(language, "desktop.remote.ports.labelBody"), 5).Color(a.colors.Text) submitted := ui.TextField(c.Part("ports-label-field"), &ports.labelField, i18n.Shared(language, "desktop.remote.ports.labelField"), i18n.Shared(language, "desktop.remote.ports.labelField")).FillWidth().Submitted() diff --git a/desktop/internal/workbench/remote_shell_view.go b/desktop/internal/workbench/remote_shell_view.go index a940f82e3..c81516315 100644 --- a/desktop/internal/workbench/remote_shell_view.go +++ b/desktop/internal/workbench/remote_shell_view.go @@ -28,7 +28,7 @@ func (a *App) remoteView(c ui.C) { } language := a.language() open := true - ui.ModalWith(c, &open, a.remoteTitle(language), ui.ModalSpec{Width: remoteWindowWidth, Height: remoteWindowHeight}, func() { + ui.Modal(c, &open, a.remoteTitle(language), ui.ModalSpec{Width: remoteWindowWidth, Height: remoteWindowHeight}, func() { k := c.Part("remote") ui.Row(k).Fill().Children(func() { a.remoteList(k, language) diff --git a/desktop/internal/workbench/runconfig_before_launch.go b/desktop/internal/workbench/runconfig_before_launch.go index 6d40fdd19..b1aa53cb8 100644 --- a/desktop/internal/workbench/runconfig_before_launch.go +++ b/desktop/internal/workbench/runconfig_before_launch.go @@ -324,7 +324,7 @@ func (a *App) drawBeforeLaunchConfirmation(c ui.C, p *project) { language := a.language() open := true title := i18n.Shared(language, "desktop.runConfig.beforeLaunch.confirmTitle") - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 520}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 520}, func() { k := c.Part("run-before-launch-confirm") ui.Column(k).FillWidth().Gap(8).Children(func() { ui.Paragraph(c, i18n.SharedFormat(language, "desktop.runConfig.beforeLaunch.confirmBody", map[string]string{"name": ask.name}), 4).Color(a.colors.Text) diff --git a/desktop/internal/workbench/runconfig_dialog_view.go b/desktop/internal/workbench/runconfig_dialog_view.go index 13b6d97e9..94743862e 100644 --- a/desktop/internal/workbench/runconfig_dialog_view.go +++ b/desktop/internal/workbench/runconfig_dialog_view.go @@ -56,7 +56,7 @@ func (a *App) drawRunConfigDialog(c ui.C, p *project) { p.collectRunConfigDialogRows(a) open := true title := i18n.Shared(a.language(), "desktop.runConfig.dialogTitle") - ui.ModalWith(c, &open, title, ui.ModalSpec{Width: runConfigDialogWidth, Height: runConfigDialogHeight}, func() { + ui.Modal(c, &open, title, ui.ModalSpec{Width: runConfigDialogWidth, Height: runConfigDialogHeight}, func() { k := c.Part("run-config-dialog") ui.Row(k).Fill().Children(func() { a.drawRunConfigDialogTree(k, p) diff --git a/desktop/internal/workbench/runconfig_steps.go b/desktop/internal/workbench/runconfig_steps.go index d7b161fde..e5b0fe063 100644 --- a/desktop/internal/workbench/runconfig_steps.go +++ b/desktop/internal/workbench/runconfig_steps.go @@ -534,7 +534,7 @@ func (a *App) drawRunConfigTask(c ui.C, p *project) { title = i18n.SharedFormat(language, "desktop.runConfig.taskAddTitle", map[string]string{"name": t.kind.DisplayName}) } open := true - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Description: t.kind.Description, Width: 560}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Description: t.kind.Description, Width: 560}, func() { k := c.Part("run-config-task") ui.Column(k).FillWidth().Gap(10).Children(func() { a.drawRunConfigFormFields(k, p, t.form, !t.checking) diff --git a/desktop/internal/workbench/runconfig_view.go b/desktop/internal/workbench/runconfig_view.go index 483fcd378..011cc5b4b 100644 --- a/desktop/internal/workbench/runconfig_view.go +++ b/desktop/internal/workbench/runconfig_view.go @@ -466,7 +466,7 @@ func (a *App) drawRunConfigDelete(c ui.C, p *project) { language := a.language() open := true title := i18n.Shared(language, "desktop.runConfig.deleteTitle") - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 420}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 420}, func() { ui.Paragraph(c, i18n.SharedFormat(language, "desktop.runConfig.deleteBody", map[string]string{"name": d.name}), 4).Color(a.colors.Text) }, func() { ui.Row(c.Part("run-config-delete-footer")).FillWidth().Items(ui.Center).Gap(8).Children(func() { diff --git a/desktop/internal/workbench/scratch_files.go b/desktop/internal/workbench/scratch_files.go index cd276b5da..3247ea41b 100644 --- a/desktop/internal/workbench/scratch_files.go +++ b/desktop/internal/workbench/scratch_files.go @@ -163,7 +163,7 @@ func (a *App) scratchPopup(c ui.C) { if !v.open || p == nil { return } - ui.ModalWith(c.Part("scratch-files"), &v.open, i18n.Shared(a.language(), "desktop.drafts.list"), ui.ModalSpec{Width: 620}, func() { + ui.Modal(c.Part("scratch-files"), &v.open, i18n.Shared(a.language(), "desktop.drafts.list"), ui.ModalSpec{Width: 620}, func() { if !v.loading && len(v.entries) == 0 { ui.Text(c, i18n.Shared(a.language(), "desktop.drafts.empty")).Color(a.colors.Subtle) } diff --git a/desktop/internal/workbench/search_everywhere_view.go b/desktop/internal/workbench/search_everywhere_view.go index cd6b1131d..6feb2b192 100644 --- a/desktop/internal/workbench/search_everywhere_view.go +++ b/desktop/internal/workbench/search_everywhere_view.go @@ -56,7 +56,7 @@ func (a *App) everywherePopup(c ui.C) { ui.Stack(c).Fill().Children(func() { anchor = ui.Row(c).Absolute().Left((bounds.Width - width) / 2).Top(84).Width(width).Height(1) }) - closed := ui.PopoverWith(c, anchor, &v.open, ui.PopoverSpec{ + closed := ui.Popover(c, anchor, &v.open, ui.PopoverSpec{ Width: width, Offset: 1, Align: ui.Start, KeepOpenOnAnchor: true, }, func() { ui.Column(c).FillWidth().Height(height).Gap(8).Children(func() { @@ -65,8 +65,8 @@ func (a *App) everywherePopup(c ui.C) { } else { a.everywhereScopes(c, p, language) } - field := ui.TextFieldID(c, everywhereQueryID, &v.query, i18n.Shared(language, "desktop.everywhere.title"), - i18n.Shared(language, "native.typeToSeeCommands")). + field := ui.TextField(c, &v.query, i18n.Shared(language, "desktop.everywhere.title"), + i18n.Shared(language, "native.typeToSeeCommands"), ui.WithID(everywhereQueryID)). Icon(icons.Search).Action(icons.X, i18n.Shared(language, "native.clearSearch")) if field.ActionClicked() { a.performed("workspace.search.clear", surfaceButton) @@ -229,7 +229,7 @@ func (a *App) everywhereFilter(c ui.C, p *project, language i18n.Language) { if button.Clicked() { v.filterOpen = !v.filterOpen } - ui.PopoverWith(c, button, &v.filterOpen, ui.PopoverSpec{Align: ui.End, Width: 300}, func() { + ui.Popover(c, button, &v.filterOpen, ui.PopoverSpec{Align: ui.End, Width: 300}, func() { option := func(label, action string, value *bool) { before := *value ui.Checkbox(c, value, label) diff --git a/desktop/internal/workbench/search_replace_view.go b/desktop/internal/workbench/search_replace_view.go index 5e1ce1662..9c4bbacee 100644 --- a/desktop/internal/workbench/search_replace_view.go +++ b/desktop/internal/workbench/search_replace_view.go @@ -38,7 +38,7 @@ func (a *App) searchReplaceRow(c ui.C, query searchQuery) { } t := a.text.Search ui.Row(c.Key("replace-row")).FillWidth().PadSides(0, 10, 6, 10).Items(ui.Center).Gap(6).Children(func() { - ui.TextFieldID(c, searchReplaceID, &v.replace, t.Replace, t.ReplacePlaceholder).Grow(1).MinWidth(0) + ui.TextField(c, &v.replace, t.Replace, t.ReplacePlaceholder, ui.WithID(searchReplaceID)).Grow(1).MinWidth(0) disabled := strings.TrimSpace(query.text) == "" || p.replace.loading || p.replace.applying if ui.Button(c.Key("replace-all"), t.ReplaceAll).Small().Disabled(disabled).Clicked() { replacement := v.replace.Text() @@ -61,7 +61,7 @@ func (a *App) drawProjectReplace(c ui.C, p *project) { if !r.loading && r.failure == "" { description = t.ReplaceSummary(strconv.Itoa(occurrences), strconv.Itoa(files)) } - closed := ui.ModalWith(c, &open, t.PreviewTitle, ui.ModalSpec{Width: 620, Description: description}, func() { + closed := ui.Modal(c, &open, t.PreviewTitle, ui.ModalSpec{Width: 620, Description: description}, func() { ui.Column(c.Part("replace-preview")).FillWidth().Gap(4).Children(func() { switch { case r.loading: diff --git a/desktop/internal/workbench/search_view.go b/desktop/internal/workbench/search_view.go index 8dbe1e9e3..f1097a238 100644 --- a/desktop/internal/workbench/search_view.go +++ b/desktop/internal/workbench/search_view.go @@ -31,7 +31,7 @@ func (a *App) searchPanel(c ui.C) { ui.Column(c).Fill().Children(func() { ui.Row(c).FillWidth().PadSides(3, 10, 6, 10).Items(ui.Center).Gap(6).Children(func() { label := i18n.Shared(language, "native.searchFilesAndContents") - field := ui.TextFieldID(c, searchQueryID, &v.query, label, label).Icon(icons.Search). + field := ui.TextField(c, &v.query, label, label, ui.WithID(searchQueryID)).Icon(icons.Search). Action(icons.X, i18n.Shared(language, "native.clearSearch")).Grow(1).MinWidth(0) if field.ActionClicked() { a.performed("workspace.search.clear", surfaceButton) @@ -56,7 +56,7 @@ func (a *App) searchPanel(c ui.C) { a.searchReplaceRow(c, query) ui.Row(c).FillWidth().PadX(10).PadSides(0, 10, 10, 10).Children(func() { label := i18n.Shared(language, "native.fileMask") - mask := ui.TextFieldID(c, searchMaskID, &v.mask, label, i18n.Shared(language, "desktop.search.fileMaskPlaceholder")). + mask := ui.TextField(c, &v.mask, label, i18n.Shared(language, "desktop.search.fileMaskPlaceholder"), ui.WithID(searchMaskID)). Icon(icons.Search).Action(icons.X, i18n.Shared(language, "native.clearSearch")).Grow(1).MinWidth(0) if mask.ActionClicked() { a.performed("workspace.search.clear", surfaceButton) @@ -95,7 +95,7 @@ func (a *App) searchOptions(c ui.C, language i18n.Language) { if button.Clicked() { v.optionsOpen = !v.optionsOpen } - ui.PopoverWith(c, button, &v.optionsOpen, ui.PopoverSpec{Align: ui.End, Width: 300}, func() { + ui.Popover(c, button, &v.optionsOpen, ui.PopoverSpec{Align: ui.End, Width: 300}, func() { option := func(label, action string, value *bool) { before := *value ui.Checkbox(c, value, label) diff --git a/desktop/internal/workbench/shelf_view.go b/desktop/internal/workbench/shelf_view.go index 647406b56..e7f63f587 100644 --- a/desktop/internal/workbench/shelf_view.go +++ b/desktop/internal/workbench/shelf_view.go @@ -178,7 +178,7 @@ func (a *App) drawShelveDialog(c ui.C, p *project) { s, lang := &p.shelf, a.language() title := i18n.Shared(lang, "native.shelveChanges") open, submitted := true, false - closed := ui.ModalWith(c, &open, title, ui.ModalSpec{Width: 440}, func() { + closed := ui.Modal(c, &open, title, ui.ModalSpec{Width: 440}, func() { ui.Column(c).FillWidth().Gap(10).Children(func() { label := i18n.Shared(lang, "native.name") submitted = ui.TextField(c, &s.message, label, label).FillWidth().Submitted() @@ -206,7 +206,7 @@ func (a *App) drawShelfDropDialog(c ui.C, p *project) { shelf := *s.dropping open, drop := true, false spec := ui.ModalSpec{Width: 420, Description: i18n.Shared(lang, "native.thisRemovesTheSavedPatchFromLitheAndCannotBeUndone")} - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "git.saved.drop"), spec, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "git.saved.drop"), spec, func() { ui.Column(c).FillWidth().Gap(4).Children(func() { ui.Text(c, shelf.Message).Color(a.colors.Text).Ellipsis() ui.Text(c, a.shelfSummary(shelf)).Muted() diff --git a/desktop/internal/workbench/startup_sweep.go b/desktop/internal/workbench/startup_sweep.go index a9f2f808f..e57aad793 100644 --- a/desktop/internal/workbench/startup_sweep.go +++ b/desktop/internal/workbench/startup_sweep.go @@ -156,7 +156,7 @@ func (a *App) drawStartupSweep(c ui.C) { } language := a.language() open := true - closed := ui.ModalWith(c, &open, i18n.Shared(language, "desktop.startupSweep.title"), ui.ModalSpec{Width: 460}, func() { + closed := ui.Modal(c, &open, i18n.Shared(language, "desktop.startupSweep.title"), ui.ModalSpec{Width: 460}, func() { ui.Column(c.Part("startup-sweep")).FillWidth().Gap(8).Children(func() { ui.Paragraph(c, i18n.SharedFormat(language, "desktop.startupSweep.body", map[string]string{"arg1": strconv.Itoa(len(s.leftovers))}), 4). FontSize(a.theme.Metrics.FontSizeS) diff --git a/desktop/internal/workbench/stash_view.go b/desktop/internal/workbench/stash_view.go index 491c94664..0adab7b46 100644 --- a/desktop/internal/workbench/stash_view.go +++ b/desktop/internal/workbench/stash_view.go @@ -177,7 +177,7 @@ func (a *App) drawStashPushDialog(c ui.C, p *project) { title := i18n.Shared(lang, "desktop.gitReview.stashPush") open, submitted := true, false spec := ui.ModalSpec{Width: 440, Description: i18n.Shared(lang, "native.storeTemporaryChangesInGitSStashList")} - closed := ui.ModalWith(c, &open, title, spec, func() { + closed := ui.Modal(c, &open, title, spec, func() { ui.Column(c).FillWidth().Gap(10).Children(func() { label := i18n.Shared(lang, "git.stashMessage") submitted = ui.TextField(c, &s.message, label, label).FillWidth().Submitted() @@ -206,7 +206,7 @@ func (a *App) drawStashDropDialog(c ui.C, p *project) { stash := *s.dropping open, drop := true, false spec := ui.ModalSpec{Width: 420, Description: i18n.Shared(lang, "native.thisRemovesTheStashFromGitAndCannotBeUndone")} - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "native.dropStash"), spec, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "native.dropStash"), spec, func() { ui.Column(c).FillWidth().Gap(4).Children(func() { ui.Text(c, stash.Message).Color(a.colors.Text).Ellipsis() ui.Text(c, stash.Reference).Muted() diff --git a/desktop/internal/workbench/tabstrip.go b/desktop/internal/workbench/tabstrip.go index b03eb94f0..f000f6bca 100644 --- a/desktop/internal/workbench/tabstrip.go +++ b/desktop/internal/workbench/tabstrip.go @@ -521,7 +521,7 @@ func (a *App) hiddenTabsButton(c ui.C, place *groupPlace, s *tabStrip, tabs []sh wasOpen := s.menu if s.menu { spec := ui.PopoverSpec{Align: ui.End, Offset: chromeMenuOffset, Width: tabMenuWidth, ConsumeOutsidePress: true} - ui.PopoverWith(c, button, &s.menu, spec, func() { + ui.Popover(c, button, &s.menu, spec, func() { ui.Scroll(c.Part("hidden")).Scrollbars().FillWidth().MaxHeight(tabMenuMaxHeight).Gap(chromeMenuItems).Children(func() { for _, member := range s.hidden { i := slices.IndexFunc(tabs, func(t shownTab) bool { return t.member() == member }) diff --git a/desktop/internal/workbench/terminal_find.go b/desktop/internal/workbench/terminal_find.go index 3403a8a7b..5067d71dd 100644 --- a/desktop/internal/workbench/terminal_find.go +++ b/desktop/internal/workbench/terminal_find.go @@ -113,7 +113,7 @@ func (a *App) terminalFindBar(c ui.C, t *terminal) { f.count, f.current = t.view.Find(query) } ui.Row(c.Part("term-find-row" + strconv.Itoa(t.id))).FillWidth().PadX(8).PadY(4).Items(ui.Center).Gap(6).Background(a.colors.Panel).Children(func() { - field := ui.TextFieldID(c, id, &f.field, words.Find, words.Find).Icon(icons.Search).Grow(1).MinWidth(0) + field := ui.TextField(c, &f.field, words.Find, words.Find, ui.WithID(id)).Icon(icons.Search).Grow(1).MinWidth(0) if field.Submitted() { f.count, f.current = t.view.FindStep(-1) } diff --git a/desktop/internal/workbench/update_dialog.go b/desktop/internal/workbench/update_dialog.go index 3dccfeb74..854fb93e0 100644 --- a/desktop/internal/workbench/update_dialog.go +++ b/desktop/internal/workbench/update_dialog.go @@ -302,7 +302,7 @@ func (a *App) updateDialog(c ui.C) { } } open := true - if ui.ModalWith(c, &open, title, ui.ModalSpec{Description: description, Width: width}, body, footer) { + if ui.Modal(c, &open, title, ui.ModalSpec{Description: description, Width: width}, body, footer) { action = "later" } switch action { diff --git a/desktop/internal/workbench/vcs_view.go b/desktop/internal/workbench/vcs_view.go index 131583fb5..47c2b9356 100644 --- a/desktop/internal/workbench/vcs_view.go +++ b/desktop/internal/workbench/vcs_view.go @@ -595,7 +595,7 @@ func (a *App) drawVcsRollbackDialog(c ui.C, p *project, t vcsTarget) { paths := view.rollback open, confirmed := true, false spec := ui.ModalSpec{Width: 440, Description: i18n.Shared(lang, "native.localEditsToTheseFilesAreLost")} - closed := ui.ModalWith(c, &open, i18n.Shared(lang, "native.rollBackTheSelectedChanges"), spec, func() { + closed := ui.Modal(c, &open, i18n.Shared(lang, "native.rollBackTheSelectedChanges"), spec, func() { ui.Column(c).FillWidth().Gap(4).Children(func() { for index, path := range paths { if index == vcsRollbackShown { diff --git a/desktop/internal/workbench/workbench_background.go b/desktop/internal/workbench/workbench_background.go index 9e18f2b96..7783aa2a9 100644 --- a/desktop/internal/workbench/workbench_background.go +++ b/desktop/internal/workbench/workbench_background.go @@ -589,7 +589,7 @@ func (a *App) backgroundPopover(c ui.C, anchor ui.Box) { picked := strength spec := ui.PopoverSpec{Side: components.PopoverLeft, Align: ui.End, Width: 320, ConsumeOutsidePress: true} open := true - ui.PopoverWith(c.Key("workbenchBackground"), anchor, &open, spec, func() { + ui.Popover(c.Key("workbenchBackground"), anchor, &open, spec, func() { ui.Column(c).Gap(8).FillWidth().Children(func() { ui.Row(c).FillWidth().Items(ui.Center).Gap(6).Children(func() { ui.Icon(c, icons.Image).Size(14, 14).Color(a.colors.Subtle) diff --git a/docs/assets/viva-sync-ac665a8f/readonly-source-light-en-US.png b/docs/assets/viva-sync-ac665a8f/readonly-source-light-en-US.png new file mode 100644 index 000000000..10a30f5c5 Binary files /dev/null and b/docs/assets/viva-sync-ac665a8f/readonly-source-light-en-US.png differ diff --git a/docs/assets/viva-sync-ac665a8f/toast-light-en-US.png b/docs/assets/viva-sync-ac665a8f/toast-light-en-US.png new file mode 100644 index 000000000..fc01e7e1d Binary files /dev/null and b/docs/assets/viva-sync-ac665a8f/toast-light-en-US.png differ diff --git a/shared/platform-feature-matrix/features/declarative-plugin-settings.json b/shared/platform-feature-matrix/features/declarative-plugin-settings.json index 21eb3ce2f..8483d706f 100644 --- a/shared/platform-feature-matrix/features/declarative-plugin-settings.json +++ b/shared/platform-feature-matrix/features/declarative-plugin-settings.json @@ -152,5 +152,5 @@ "verificationStatus": "pending" } }, - "notes": "partial 包含原生双层存储、运行消费、离线目录、七类控件、声明动作、动态页面及同一应用内跨窗口通知。语言状态卡、完整 settings v2、独立进程同步及原生产品验收仍 pending;宿主现已声明 settings 2。 Viva 2026-11-14:设置页每项是标题行(标题、ⓘ 说明、重置)加控件行,开关不再重复标题,标题只作无障碍名称;去掉每行常驻的“继承值”说明,作用范围的说明收进范围选择旁的 ⓘ;无效值和仅全局可改两条状态提示保留;自动化:TestPluginSettingsFormEditsOnlyOnExplicitSaveAndPreservesConflictDraft,截图场景 TestVisualPluginSettingsForm。 Viva 2026-11-14:插件设置文字由包内 l10n/<语言>.json 翻译(API-37)。宿主经 configfile 从已安装插件目录只读地取文件,由 Core 选候选并逐条回退。自动化:TestPresentedLoadFollowsContractLocalizationCases、TestInstalledSettingsEditorTranslatesFromThePackageWithoutWritingIt、TestPluginSettingsTextFollowsTheWindowLanguageWithoutDiscardingDrafts、TestPluginSettingsLoadLogsSkippedAndRefusedTranslations;目标平台真机界面验收仍 pending。 Viva 2026-11-16:设置项改为单行,左侧标题与 ⓘ,右侧开关/下拉/输入框与重置按钮;窗格放不下时控件与重置整体换到标题下方,多选、整数范围和状态提示仍在行下。取代 2026-11-14 的标题行加控件行布局。截图 TestVisualPluginSettingsPage(宽页面与插件详情窄窗格、深浅主题)。原生验收仍 pending。 Viva 2026-11-17:宿主声明 sourceSettings [0,1](#2086)。侧栏布局的来源组在表单左侧显示模块列表,其他组各占一项;所选模块的字段按 section 分标签页(只有一组时不显示标签),条目列表的工具栏为 + − ↑ ↓ 图标按钮和属性列标题,添加菜单按条目种类调用原生文件/目录选择器或候选项对话框。" + "notes": "partial 包含原生双层存储、运行消费、离线目录、七类控件、声明动作、动态页面及同一应用内跨窗口通知。语言状态卡、完整 settings v2、独立进程同步及原生产品验收仍 pending;宿主现已声明 settings 2。 Viva 2026-11-14:设置页每项是标题行(标题、ⓘ 说明、重置)加控件行,开关不再重复标题,标题只作无障碍名称;去掉每行常驻的“继承值”说明,作用范围的说明收进范围选择旁的 ⓘ;无效值和仅全局可改两条状态提示保留;自动化:TestPluginSettingsFormEditsOnlyOnExplicitSaveAndPreservesConflictDraft,截图场景 TestVisualPluginSettingsForm。 Viva 2026-11-14:插件设置文字由包内 l10n/<语言>.json 翻译(API-37)。宿主经 configfile 从已安装插件目录只读地取文件,由 Core 选候选并逐条回退。自动化:TestPresentedLoadFollowsContractLocalizationCases、TestInstalledSettingsEditorTranslatesFromThePackageWithoutWritingIt、TestPluginSettingsTextFollowsTheWindowLanguageWithoutDiscardingDrafts、TestPluginSettingsLoadLogsSkippedAndRefusedTranslations;目标平台真机界面验收仍 pending。 Viva 2026-11-16:设置项改为单行,左侧标题与 ⓘ,右侧开关/下拉/输入框与重置按钮;窗格放不下时控件与重置整体换到标题下方,多选、整数范围和状态提示仍在行下。取代 2026-11-14 的标题行加控件行布局。截图 TestVisualPluginSettingsPage(宽页面与插件详情窄窗格、深浅主题)。原生验收仍 pending。 Viva 2026-11-17:宿主声明 sourceSettings [0,1](#2086)。侧栏布局的来源组在表单左侧显示模块列表,其他组各占一项;所选模块的字段按 section 分标签页(只有一组时不显示标签),条目列表的工具栏为 + − ↑ ↓ 图标按钮和属性列标题,添加菜单按条目种类调用原生文件/目录选择器或候选项对话框。 Viva 2026-11-26:Viva 固定到 fork 448b0553 后,不可编辑的设置项(仅全局可改的项目值、只读来源的文本、列表和单选值)改用 Viva 只读输入框(Box.ReadOnly):值照常显示,可获得焦点、选中和复制,原生输入被拒绝;只读列表在多行框里逐行显示。取代此前手画的灰字边框(readOnlyField、readOnlyList,#1821 第 2 项)。自动化:TestPluginSettingsFormEditsOnlyOnExplicitSaveAndPreservesConflictDraft、TestNativeSettingsFormShowsReadOnlyListsInFull;截图 docs/assets/viva-sync-ac665a8f/readonly-source-light-en-US.png(浅色、英文)。原生窗口与 Windows 实机验收仍 pending。" } diff --git a/shared/platform-feature-matrix/features/workbench-notifications.json b/shared/platform-feature-matrix/features/workbench-notifications.json index 6ec2d39e4..937cdff12 100644 --- a/shared/platform-feature-matrix/features/workbench-notifications.json +++ b/shared/platform-feature-matrix/features/workbench-notifications.json @@ -23,7 +23,7 @@ }, "owner": "Workbench", "verification": "触发成功、警告和失败通知,验证队列、关闭、超时和重复通知。同一文案连续触发两次,确认通知栏只保留一条并在文案后显示计数(第二次 `(2)`、第三次 `(3)`),不同文案、不同类型或不同描述的通知仍各自独立;重复出现时该条回到列表顶部并重新标为未读,列表中显示的时间刷新为最后一次出现时间。重复通知使用固定 key 时,确认关闭后再次出现会继续累加而不是停在 1;把其中一个已合并的来源改写成另一段文案,确认只有该来源的次数随文案移动,原组剩余次数不变、新文案不被算成出现过两次。macOS 深浅主题检查共享卡片、官方图标、圆角边框、两行长消息与展开/收起。验证三条上限、旧消息折叠及历史入口,并确认重复一条带“还有 N 条通知”的气泡后该历史入口仍然存在;单条悬停不暂停其他通知,应用后台暂停全部、回到前台按剩余时间关闭;关闭与超时保留历史,清空历史关闭所有气泡。确定性时间测试覆盖计时与折叠,重复消息复核气泡置顶与计时重置,实际工作台检查叠放、关闭和通知中心。打开右侧“通知”工具窗口确认空状态;关闭窗口并触发通知后,重开窗口检查历史与未读角标,滚动查看较早的记录;在工具窗口清空后,确认状态栏铃铛的历史也已清空。 macOS 各面板提示检查深浅主题下的共享 InlineBanner 与编辑器平面提示:六种状态背景/边框、13pt 正文、12pt 内边距或编辑器上下10pt、官方16pt图标、换行、动作链接和关闭按钮的实际点击。 在系统语言与应用语言不同时触发语言服务准备、就绪、超时和失败通知,检查气泡、通知历史及重复计数均跟随应用语言。 带错误详情的失败通知保留原始键和参数,在中文收到后切到 English,气泡与历史重新格式化;不同详情不合并,相同详情重复计数。 macOS 打开项目启动时(模块图重建、可见工具窗口和语言服务器被打断重启),确认不出现“未能完成操作(Swift.CancellationError 错误 1)”之类的取消通知;让模块激活抛出普通错误时仍弹出失败通知。 语言服务器激活进行中时在工作区关闭该语言服务器或关闭触发文档,确认之后不再弹出 “Could not start … language server”。 Viva:运行 scripts/desktop/desktop-go.sh test ./internal/workbench -run 'TestNotice|TestNotification|TestRepeated' -count=1,覆盖重复计数、类型分开、三条上限、欢迎页铃铛和清空。", - "notes": "Viva:通知以 toast 显示并记入通知历史(最多 100 条,最新在前)。同一文案同一类型再次出现合并为一条,计数加一、回到顶部、时间刷新为最后一次。历史关闭时该条标为未读,toast 文案带计数(“(2)”)。状态栏右端的铃铛显示未读数,并打开弹出历史。右侧“通知”工具窗口显示同一份历史,长列表按视口绘制。查看任一入口即标为已读;两处都显示文案、最后时间和次数,失败通知可查看关联日志。“清空”同步两个入口并关闭仍在显示的 toast。通知分成功、信息、警告、错误四类,各有图标与历史色标,同文案不同类型各记一条;同时最多显示三条 toast,超出时最早的一条先收起,历史保留全部;指针停在 toast 上或焦点在其中时全部暂停计时;欢迎页没有状态栏,铃铛放在窗口左下。尚未实现:应用转到后台时暂停计时(需 Viva 提供窗口激活事件)、“还有 N 条”折叠文字、固定 key 的来源改写、应用语言切换后重新格式化旧通知、各面板 InlineBanner。", + "notes": "Viva:通知以 toast 显示并记入通知历史(最多 100 条,最新在前)。同一文案同一类型再次出现合并为一条,计数加一、回到顶部、时间刷新为最后一次。历史关闭时该条标为未读,toast 文案带计数(“(2)”)。状态栏右端的铃铛显示未读数,并打开弹出历史。右侧“通知”工具窗口显示同一份历史,长列表按视口绘制。查看任一入口即标为已读;两处都显示文案、最后时间和次数,失败通知可查看关联日志。“清空”同步两个入口并关闭仍在显示的 toast。通知分成功、信息、警告、错误四类,各有图标与历史色标,同文案不同类型各记一条;同时最多显示三条 toast,超出时最早的一条先收起,历史保留全部;指针停在 toast 上或焦点在其中时全部暂停计时;欢迎页没有状态栏,铃铛放在窗口左下。尚未实现:应用转到后台时暂停计时(需 Viva 提供窗口激活事件)、“还有 N 条”折叠文字、固定 key 的来源改写、应用语言切换后重新格式化旧通知、各面板 InlineBanner。 Viva 2026-11-26:随 Viva 上游紧凑通知(245768e2),同时显示的 toast 折叠成一叠:最新一条在前,较早的缩小叠在后面,指针停在这叠通知上才展开,展开后才能点后面那条的按钮。自动化:TestFailureNoticeOpensTheLogsOfTheActionThatFailed 先悬停展开再点;截图 docs/assets/viva-sync-ac665a8f/toast-light-en-US.png(浅色、英文)。原生窗口与 Windows 实机验收仍 pending。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": {