From 94a8dcc62a6bbe2c678a96a13f2c13aa4dece271 Mon Sep 17 00:00:00 2001 From: mixeme Date: Tue, 23 Jun 2026 07:57:51 +0300 Subject: [PATCH] P3.4: Add Queue group to settings view Add Execution mode and Overlap policy widget.Select controls in ui/settings_view.go under a new Queue section group, between the Application and Storage sections. Both selects are primed from the current config on open and their selected values are written back into the config struct on save, passing through the existing UpdateSettings validation path. Co-Authored-By: Claude Sonnet 4.6 --- docs/PRE-RELEASE-TASKS.md | 2 +- src/ui/settings_view.go | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/PRE-RELEASE-TASKS.md b/docs/PRE-RELEASE-TASKS.md index ebb5a5a..53f8b58 100644 --- a/docs/PRE-RELEASE-TASKS.md +++ b/docs/PRE-RELEASE-TASKS.md @@ -97,7 +97,7 @@ These land together because both edit `domain/job.go` and `storage/store.go`. - [x] P3.1 — Config/runtime fields + defaults - [x] P3.2 — Split dispatch into `app/run.go` - [x] P3.3 — Rework `RunDue`/`executeRun` for mode + overlap policy -- [ ] P3.4 — Settings Queue selects +- [x] P3.4 — Settings Queue selects - [ ] P3.5 — Queue tests ### Phase 4 — Notifications + Command browse diff --git a/src/ui/settings_view.go b/src/ui/settings_view.go index 5f4e3c5..98ef0fe 100644 --- a/src/ui/settings_view.go +++ b/src/ui/settings_view.go @@ -8,6 +8,7 @@ import ( "strings" "gitea.mixdep.ru/mix/gosentry/src/app" + "gitea.mixdep.ru/mix/gosentry/src/domain" "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" @@ -46,6 +47,16 @@ func settingsView(w fyne.Window, svc *app.Service) fyne.CanvasObject { minimizeToTray.SetChecked(store.Config.KeepRunningInTray) notifications := widget.NewCheck("Show desktop notifications for failed jobs", nil) notifications.SetChecked(store.Config.NotifyOnFailure) + executionModeSelect := widget.NewSelect( + []string{string(domain.ExecutionModeParallel), string(domain.ExecutionModeSequential)}, + nil, + ) + executionModeSelect.SetSelected(string(store.Config.ExecutionMode)) + overlapPolicySelect := widget.NewSelect( + []string{string(domain.OverlapPolicySkip), string(domain.OverlapPolicyQueue)}, + nil, + ) + overlapPolicySelect.SetSelected(string(store.Config.OverlapPolicy)) jobsDir := widget.NewEntry() jobsDir.SetText(store.Config.JobsDir) jobsDirBrowse := widget.NewButtonWithIcon("Browse", theme.FolderOpenIcon(), func() { @@ -92,6 +103,8 @@ func settingsView(w fyne.Window, svc *app.Service) fyne.CanvasObject { config.StartOnLogin = startOnLogin.Checked config.KeepRunningInTray = minimizeToTray.Checked config.NotifyOnFailure = notifications.Checked + config.ExecutionMode = domain.ExecutionMode(executionModeSelect.Selected) + config.OverlapPolicy = domain.OverlapPolicy(overlapPolicySelect.Selected) if err := svc.UpdateSettings(config); err != nil { settingsStatus.SetText("Save failed: " + err.Error()) return @@ -111,6 +124,10 @@ func settingsView(w fyne.Window, svc *app.Service) fyne.CanvasObject { settingsRow("Tray", container.New(minWidthLayout{width: settingsControlWidth}, minimizeToTray)), settingsRow("Notifications", container.New(minWidthLayout{width: settingsControlWidth}, notifications)), widget.NewSeparator(), + widget.NewLabelWithStyle("Queue", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + settingsRow("Execution mode", container.New(minWidthLayout{width: settingsControlWidth}, executionModeSelect)), + settingsRow("Overlap policy", container.New(minWidthLayout{width: settingsControlWidth}, overlapPolicySelect)), + widget.NewSeparator(), widget.NewLabelWithStyle("Storage", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), settingsRow("Config YAML", widget.NewLabel(store.Paths.ConfigPath)), settingsRow("Jobs directory", container.NewBorder(nil, nil, nil, jobsDirBrowse, jobsDir)),