Commit Graph
1 Commits
Author SHA1 Message Date
yetoneandggbdpq 1fd73a3fce gui: a folder plugin on a Windows path is a folder on the Plugins page (#2266, ggbdpq)
plugins.js isPath took a spec as a path only when it started with ./, /,
file:// or a drive letter. plugin.IsPath also takes a leading backslash
(#2229), so a plugin added from \\server\share\plugin or \Users\me\plugin
was installed as a folder. The Plugins page, though, named it by its whole
path and treated it as an npm package. isPath now takes a leading \ too.

Sibling: name() cut a spec at its last @ before label() could see it was a
path, so C:\Users\me@corp\plugin was labelled "me". It now returns a path
whole, as plugin.Name does. The test has that case. No other isPath copy
exists in the GUI: label, isGit, onNPM and the local check all go through
this one.

Run (this commit is the last of four in this push; the run covers all
four at this head):
- gofmt -l: clean. go vet ./... darwin -tags nogui, GOOS=linux
  CGO_ENABLED=0 -tags nogui, GOOS=windows CGO_ENABLED=0: clean.
- set -o pipefail; go test -tags nogui -p 4 -timeout 40m ./... in a
  sandbox HOME: exit 0, 55 packages ok, no FAIL.
- The issue's plugin-folder-path.test.cjs, with the @ case added:
  Chromium and WebKit pass.
- Every GUI test that opens the Plugins page (37 files, 504 tests)
  passes in Chromium and WebKit.
- Rebased on 3a0b61275 (#2261, #2265, #2267 landed; no file in common):
  the three vets clean again, and go test -tags nogui -timeout 40m of
  internal/agent, gateway, gui, plugin, provider and sessions: ok.
- Rebased again on af9bd6c3e (#2268, routing P3; only
  gateway-routing.md in common, merged cleanly): the three vets clean,
  and -timeout 40m of internal/gateway, routes, provider, gui, sessions,
  dirent, lastgood and plugins/...: ok.

Broken by hand: on the code before this, plugin-folder-path fails in both
engines with the rows named '\\Users\\me\\my-plugin' and
'\\\\server\\share\\plugin'. With only isPath fixed, the @ case fails as
'me'.

Not tried: the real app on Windows with a UNC share.

Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-10-15 09:36:27 +08:00