gui: Report a problem's version line compiles on first use, and its route is named

4519eea71 (Settings › About's Report a problem) left main red on
ubuntu and macOS at d0a4e0be6 (run 43215704825) in two guards outside
the packages it ran:
- TestNoEagerPackageRegexps: feedback.go's osVersionRE was a
  package-level regexp.MustCompile; it is lazyre.New now.
- TestEveryRouteHasACommandOrIsNamed: GET /api/feedback had no command
  and wasn't in notYet. It is the window's own (it builds the block the
  About row copies), so it goes in notYet as W.

Run on mote at this tree: TestNoEagerPackageRegexps ok,
TestEveryRouteHasACommandOrIsNamed ok, internal/gui -run Feedback ok
(TestFeedbackBlockHoldsNoPrivateFacts), go vet of gui and cli plus
GOOS=linux nogui (cli) and GOOS=windows (gui) clean. Red before: both
guards in run 43215704825.
This commit is contained in:
yetone
2026-11-12 20:53:53 +08:00
parent a687f6b040
commit f97415bc0c
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -246,6 +246,7 @@ var notYet = map[string]string{
"GET /api/cli": A, // api.go
"GET /api/drift": A, // api.go
"GET /api/notices": W, // api.go
"GET /api/feedback": W, // feedback.go: Settings › About's Report a problem, which opens a page
"GET /api/omarchy": W, // api.go
"GET /api/quit": W, // api.go: the window's Quit question
"GET /api/remote": W, // remote.go: another magpie opened in a window of the app
+2 -2
View File
@@ -4,11 +4,11 @@ import (
"context"
"net/http"
"os"
"regexp"
"runtime"
"strings"
"time"
"github.com/yetone/magpie/internal/lazyre"
"github.com/yetone/magpie/internal/proc"
)
@@ -16,7 +16,7 @@ import (
// About's Report a problem opens it after copying the facts below.
const FeedbackURL = "https://x.com/magpie_router/status/2119861020978188499"
var osVersionRE = regexp.MustCompile(`\d+(\.\d+)+`)
var osVersionRE = lazyre.New(`\d+(\.\d+)+`)
// osVersion names the system and its version: "macOS 26.2", "Windows
// 10.0.26100", "Ubuntu 24.04.1 LTS". Only what the system calls itself: