Merge mmo/ui branch: Fyne system tray UI #26

Merged
qwc merged 10 commits from issue-19/merge-ui into main 2026-02-02 12:55:33 +01:00
Owner

Summary

Squash-merges the mmo/ui branch (38 commits) into main, adding a Fyne-based system tray UI for desktop notifications, plus follow-up fixes, tests, and CI repair.

  • Fyne system tray UI (cmd/backive_ui, ui/ package) with message level filtering and hide-until support
  • Unix socket IPC between daemon and UI (ui_handler.go)
  • Database format migration to map[string]interface{} for structured run data
  • Security fix: socket permissions hardened from 0777 to 0660, write errors handled
  • Bug fixes: variable shadowing in ui/ui_main.go, exported struct fields for JSON marshal, rewritten ShallShow() logic, panic→log in settings I/O
  • Cleanup: removed dead comments, profanity in log message, unreachable code after log.Fatal
  • New tests: ui_handler_test.go, ui/ui_test.go, extended backup_test.go (68.4% coverage on non-CGO packages)
  • CI fixed: workflow was completely broken (goreleaser action not mirrored on Forgejo)

Closes #19
Closes #8
Closes #10
Closes #11

Commits

  1. Squash merge mmo/ui branch
  2. Remove go.work files, add to .gitignore
  3. Security fix: socket permissions and write error handling
  4. Bug fixes in ui/ui_main.go
  5. Cleanup: config.go, backup.go, cmd/backive_ui/main.go
  6. Add UIHandler tests
  7. Add UI settings/filtering tests
  8. Extend backup tests (legacy format, map format, never-run edge case)
  9. Fix CI: upgrade Go 1.19→1.25, vendor deps, remove GoReleaser
  10. Fix go vet: non-constant format string in log.Printf

CI fixes (was completely broken)

The previous workflow failed immediately because goreleaser/goreleaser-action@v2.7.0 was not mirrored on data.forgejo.org. Additional issues fixed:

  • Upgraded actions: checkout@v2v4, setup-go@v2v5 (#11)
  • Removed GoReleaser: replaced with plain go build
  • Removed deprecated golint: replaced with go vet (#11)
  • Go version: bumped from 1.19 to 1.25 (#8)
  • Vendor approach: go mod vendor, committed vendor/, builds use -mod=vendor (#10)
  • Fixed test scope: go test -v -covergo test -v -cover ./...
  • Added pkg-config to apt dependencies (needed for CGO/Fyne)
  • Removed sudo from apt commands (Forgejo runner is root)
  • Fixed go vet warning: log.Printf(msg)log.Print(msg) (Go 1.25 stricter checks)

Deferred

  • Multi-client UIHandler → #25
  • Structured logging → #21
  • Further socket security (group-based access for events.go) → #1

Test plan

  • go build -mod=vendor ./... succeeds (non-CGO)
  • go test -v -cover -mod=vendor ./... passes (non-CGO packages)
  • go vet clean (non-CGO packages)
  • Full CI build on Forgejo (with CGO for backive_ui)
  • Manual check: backive-example.yml has uiUnixSocketLocation
## Summary Squash-merges the `mmo/ui` branch (38 commits) into `main`, adding a Fyne-based system tray UI for desktop notifications, plus follow-up fixes, tests, and CI repair. - **Fyne system tray UI** (`cmd/backive_ui`, `ui/` package) with message level filtering and hide-until support - **Unix socket IPC** between daemon and UI (`ui_handler.go`) - **Database format migration** to `map[string]interface{}` for structured run data - **Security fix**: socket permissions hardened from `0777` to `0660`, write errors handled - **Bug fixes**: variable shadowing in `ui/ui_main.go`, exported struct fields for JSON marshal, rewritten `ShallShow()` logic, panic→log in settings I/O - **Cleanup**: removed dead comments, profanity in log message, unreachable code after `log.Fatal` - **New tests**: `ui_handler_test.go`, `ui/ui_test.go`, extended `backup_test.go` (68.4% coverage on non-CGO packages) - **CI fixed**: workflow was completely broken (goreleaser action not mirrored on Forgejo) Closes #19 Closes #8 Closes #10 Closes #11 ## Commits 1. Squash merge mmo/ui branch 2. Remove go.work files, add to .gitignore 3. Security fix: socket permissions and write error handling 4. Bug fixes in ui/ui_main.go 5. Cleanup: config.go, backup.go, cmd/backive_ui/main.go 6. Add UIHandler tests 7. Add UI settings/filtering tests 8. Extend backup tests (legacy format, map format, never-run edge case) 9. Fix CI: upgrade Go 1.19→1.25, vendor deps, remove GoReleaser 10. Fix go vet: non-constant format string in log.Printf ## CI fixes (was completely broken) The previous workflow failed immediately because `goreleaser/goreleaser-action@v2.7.0` was not mirrored on `data.forgejo.org`. Additional issues fixed: - **Upgraded actions**: `checkout@v2`→`v4`, `setup-go@v2`→`v5` (#11) - **Removed GoReleaser**: replaced with plain `go build` - **Removed deprecated `golint`**: replaced with `go vet` (#11) - **Go version**: bumped from 1.19 to 1.25 (#8) - **Vendor approach**: `go mod vendor`, committed `vendor/`, builds use `-mod=vendor` (#10) - **Fixed test scope**: `go test -v -cover` → `go test -v -cover ./...` - **Added `pkg-config`** to apt dependencies (needed for CGO/Fyne) - **Removed `sudo`** from apt commands (Forgejo runner is root) - **Fixed go vet warning**: `log.Printf(msg)` → `log.Print(msg)` (Go 1.25 stricter checks) ## Deferred - Multi-client UIHandler → #25 - Structured logging → #21 - Further socket security (group-based access for events.go) → #1 ## Test plan - [x] `go build -mod=vendor ./...` succeeds (non-CGO) - [x] `go test -v -cover -mod=vendor ./...` passes (non-CGO packages) - [x] `go vet` clean (non-CGO packages) - [ ] Full CI build on Forgejo (with CGO for backive_ui) - [ ] Manual check: `backive-example.yml` has `uiUnixSocketLocation`
Merges 38 commits from mmo/ui that add:
- System tray UI application (cmd/backive_ui, ui/ package)
- Unix socket IPC between daemon and UI (ui_handler.go)
- Message level filtering (INFO/REMIND/WARN/ERROR)
- Database format migration to map[string]interface{}
- Updated CI workflows for CGO and X11 deps
- Architecture documentation (PlantUML diagrams)

Conflicts resolved in go.mod/go.sum: kept mmo/ui deps with
golang.org/x/text v0.3.8 from main.

Ref: #19

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
These are local development files that should not be tracked.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change socket permissions from 0777 to 0660 (owner+group only)
- Move os.Chmod after net.Listen error check to avoid chmod on failure
- Check uh.client.Write return value; close and clear dead client on
  write error to prevent silent message loss

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix apphomedir variable shadowing (:= to = in Init) that caused
  settings path to always be empty
- Export uiSettings fields (HideUntil, GlobalLevel) with JSON tags
  so json.Marshal/Unmarshal works correctly
- Rewrite ShallShow() to properly check globalLevel and hideUntil:
  suppress non-error messages during hide period, use effective
  level from temporary messageLevel or persistent GlobalLevel
- Remove redundant doNotShowUntil package variable, use
  uisettings.HideUntil directly via SetHideUntil
- Replace panic() with log.Printf() in SaveSettings/LoadSettings
- Set default GlobalLevel to 20 (REMIND) in Init
- Fix typo "a hour" -> "an hour" in tray menu

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- config.go: remove commented-out debug/config lines
- backup.go: replace profanity in type switch default with proper log
- cmd/backive_ui/main.go: remove unreachable panic after log.Fatal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TestUIHandlerInit: socket creation and permissions
- TestUIHandlerDisplayMessageWithClient: verify JSON output
- TestUIHandlerDisplayMessageNoClient: error when no client
- TestUIHandlerDisplayMessageWriteError: error handling, client cleared
- TestMsgLevelValues: guard constant values against reordering

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TestShallShow: level filtering with GlobalLevel, hideUntil, invalid input
- TestSetMessageLevel: temporary vs persistent level changes
- TestSaveLoadSettings: round-trip via file I/O, error handling
- Tests use mock I/O where needed to avoid side effects

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extend backup tests with Runs load and ShouldRun edge cases
Some checks failed
Go / build (pull_request) Failing after 1m9s
f00600d28e
- TestRunsLoadLegacyFormat: verify old string-based DB format loads
- TestRunsLoadMapFormat: verify new map[string]interface{} format loads
- TestShouldRunNeverRun: edge case for backup that has never run

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix CI: upgrade Go to 1.25, vendor deps, remove GoReleaser
Some checks failed
Go / build (pull_request) Failing after 2m26s
774ede630c
- Upgrade go.mod from Go 1.19 to 1.25
- Switch to vendor approach (go mod vendor), commit vendor/
- Rewrite .github/workflows/go.yml for Forgejo Actions:
  - Use actions/checkout@v4 and actions/setup-go@v5
  - Replace GoReleaser with plain go build
  - Replace deprecated golint with go vet
  - Fix go test to use ./... for all packages
  - Remove sudo (runner is root in Forgejo)
  - Add pkg-config to X11/GL dev dependencies
- Update go-release.yml similarly
- Remove .goreleaser.yml (plain go build for now)

The previous workflow failed because goreleaser/goreleaser-action@v2.7.0
was not mirrored on data.forgejo.org, preventing even checkout from
completing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix go vet: non-constant format string in log.Printf
All checks were successful
Go / build (pull_request) Successful in 2m5s
44757ceada
Use log.Print instead of log.Printf for pre-formatted string.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
qwc merged commit 828e59feaa into main 2026-02-02 12:55:33 +01:00
qwc deleted branch issue-19/merge-ui 2026-02-02 12:55:34 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
qwc-open/backive!26
No description provided.