Commit Graph
2 Commits
Author SHA1 Message Date
yetone e16db525ca gui tests: group-duplicate doesn't count WebKit's ResizeObserver loop notice as a page error (#1542)
webkit de failed in the full GUI suite, and 1 in 5 runs alone, with errors
== ['ResizeObserver loop completed with undelivered notifications.']. Traced
with every ResizeObserver callback logged per frame: as the Routing page
first lays out, the view's scrollbar comes and goes within one frame (#rt
362 -> 352 -> 362). routing.js's width marks (byWidth) and the stage
observer are told twice, past the loop's depth. WebKit reports that as a
page error; Chromium doesn't. The round is delivered on the next frame and
nothing is painted wrong. This is the same notice 75aa03e1a ruled on for
purpose-filter, and the test now ignores that one message with the reason
beside it. The cause in the app, which 89 other Routing tests could also
hit, is filed as #1542.

Run: group-duplicate.test.cjs alone, 5 times in WebKit (25/25) and once in
Chromium (5/5).
2026-10-11 04:56:32 +08:00
yetone ddd4f43144 provider: a routing group can be duplicated, from its menu on the Routing page or with magpie group copy (lc on Discord)
provider.CopyGroup(id, name) saves a copy of the group as it is now: its
models and patterns, routing, stays, rules, classifier, effort, context,
levels, and fast and off members. The copy is deep, so its rules' time
windows aren't shared. Its name is the one given, or "<name> copy", with a
number added past a name in use. Its id comes from the name, numbered past
any id in use, removed ones included. It is listed right after the group
it copies. The copy is a group of the user's and switched on, even when
it copies a found group or a switched-off one. The original is unchanged.

Surfaces:
- GUI: a group row's menu (right-click, or a click on its logos) has
  Duplicate under Move up and Move down. It posts /api/groups/copy with
  the id and t("{name} copy"), so the name is in the reader's language.
  It asks before discarding an editor with unsaved changes. The status
  then says "Duplicated {name}". No click scrolls the page.
- CLI: magpie group copy <id> [name]; duplicate, dup and clone work too.
- zh, zh-TW, ja and de strings. docs/reference.md and the site's start
  page (en, zh, ja) list the command.

Run:
- TestGroupCopy (internal/gui): the copy has the models, pattern,
  routing, rule and off member, is on, and is listed after the original.
  The original stays off and unchanged. A second copy is "Fast copy 2" /
  fast-copy-2. An unknown id is refused.
- TestGroupCopyCLI (root): the default name, a given name, a found
  group's copy as the user's, and the errors.
- group-duplicate.test.cjs: Chromium and WebKit, en/zh/zh-TW/ja/de at
  420px, 10/10. It fails 10/10 on the old routing.js. Siblings
  group-arrange, removed-groups-menu-scroll, group-bulk-remove and
  click-scroll pass 36/36.
- Sandbox CLI (sandbox HOME): group copy and duplicate made "DupTest copy"
  and "DupTest copy 2", listed after DupTest.
- gofmt -l clean. go vet darwin/linux/windows on the root, provider and
  gui packages: ok.
2026-10-10 15:08:14 +08:00