Repository navigation
fix: reduce clicks/keystrokes -- web restore, open, config, error msgs - #23
Merged
Merged
Conversation
internal/cli/open.go shelled out to xdg-open unconditionally, which does not exist on macOS, so `snapback open <dir>` silently failed for every macOS user. Mirror the platform branch internal/web/command.go already uses for its own "open in browser" opener: pick `open` on darwin, `xdg-open` on linux (unchanged), and return a clear error naming the directory path on any other GOOS instead of a confusing exec failure.
File rows on /history had no click target and HistoryView.Versions was never set, so the Versions panel, Download and Restore were dead code. - handleHistory gives each non-directory entry its root-relative path. - history.html renders that as a versions-open button carrying root and file (the parameters /api/versions reads), and an empty hidden Versions panel when nothing is prefetched. - app.js fetches /api/versions on click, lists each copy with a Download link to /api/download and a restore form for /api/restore, and shows the restored path from the response with an Open in file manager button. - Restore forms now send root, which /api/restore needs to resolve file.
…snippet ErrOutsideRoots only named the rejected directory, forcing a trip to docs-site/configuration.md to learn the roots[] YAML shape. Policy only carries each root's ID and local path (no repository info reaches it from cmd/snapback's wiring), so the repository_id is a placeholder the user fills in; the id and local_path are real, derived from the given directory.
run() only recognized --config when it was literally args[0], so a user typing e.g. "snapback status --config X" had the flag silently fall through as a positional argument and the command ran against the default config instead -- no warning, no error. Scan the full arg list for --config / --config=PATH once before dispatch, strip it, and feed the resolved path into the same env.ConfigPath every subcommand already reads; error (exit 2) if --config has no value, instead of swallowing it.
Every new root typed into the Config page's "Roots" textarea was silently assigned to cfg.Repositories[0], regardless of how many repositories are configured. A new root's line now accepts an optional "=<repository id>" suffix to choose the repository explicitly; with exactly one repository configured the suffix is still unnecessary, matching today's behavior. An existing root's line is always treated as its literal local path (never split), so an edit to an existing root can't be misread as a repository suffix or have "=" silently stripped from its path. An unresolved or missing repository choice is now a clear, re-rendered form error instead of a silent misassignment.
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 10, 2026
## [1.6.2](v1.6.1...v1.6.2) (2026-10-10) ### Bug Fixes * reduce clicks/keystrokes -- web restore, open, config, error msgs ([#23](#23)) ([3018a2b](3018a2b))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five real bugs found during a UX friction audit (goal: fewer clicks and keystrokes for common tasks), each fixed test-first in its own worktree then folded here:
HistoryView.Versionswas never populated, history.html had no click target on file rows, and app.js never called the already-fully-implemented/api/versions//api/download//api/restore. Restoring a file was only possible by hand-crafting API requests in devtools. Now: click a file in history, pick a version, download or restore it -- verified end to end in a real browser.snapback openwas broken on macOS. It hard-codedxdg-open, which doesn't exist on darwin, so the command silently did nothing on the exact platform this project is developed on. Now branches onruntime.GOOS, mirroring the patterninternal/web/command.goalready used.link/seed's "outside configured roots" error was a dead end. It named the rejected directory but gave no next step, forcing a trip to the docs to learn theroots[]YAML shape. Now includes a copy-pasteable snippet with the real path substituted in.cfg.Repositories[0].IDregardless of how many repositories were configured -- a real correctness bug for any multi-repository setup, not just a cosmetic one. Now accepts an optionalpath=<repository id>suffix per line; single-repository setups are unaffected.--configflag was silently ignored unless it was the very first argument.snapback status --config /pathwould silently fall back to the default config with no warning. Now parsed anywhere in the argument list before subcommand dispatch.Test plan
gofmt -lcleango vet ./...cleangolangci-lint run ./...-- 0 issuesgo build ./...cleango test -race ./...-- all packages pass, zero regressions