docs(settings): Metadata Settings page + stale route inventory cleanup [shot:settings-shell] (bookshelf-2puu) #1355
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bd-bookshelf-2puu"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
docs/content/docs/metadata/metadata-settings.md— a new end-user-facing docs page covering the full Settings → Metadata page: providers, field priority matrix (all 16 fields, P1-P4 slots, enabled/disabled toggles, replace mode, merge-categories), per-library overrides, match weights, and bookdrop merge order. Wired into themetadata/card grid.docs/route-inventory.mdto reflect thatGET /settings/field-prioritynow permanently redirects to/settings/metadata; add entries for the tabbed shell and the full-matrixPUT /settings/metadata-field-priority.docs/content/docs/reference/api.mdto clarifyPUT /settings/field-priority/ratingis the legacy single-chain endpoint;PUT /settings/metadata-field-priorityis the full-matrix endpoint.[shot:settings-shell].The field priority matrix itself was already fully implemented in the settings shell (the
DEFERREDbead's core feature shipped in an earlier PR). This PR completes the bead by delivering the required end-user docs and cleaning up stale route inventory references.Screenshot
The
[shot:settings-shell]marker in the PR title triggers the CI browser-e2e job to capture and post a screenshot of the Settings → Metadata tab (field priority matrix) as a PR comment automatically.Test plan
make testpasses (all unit tests green)make coveragepasses (zero uncovered statement blocks)make e2e-policy-checkpasses (all Describes are Ordered journey containers)go build ./...cleango build -tags e2e ./e2e/...cleanJourney: Settings Shell)Closes bead bookshelf-2puu on merge.
Settings shell screenshot (settings-shell-email-tab)
Settings shell screenshot (settings-metadata-field-priority)
Settings shell screenshot (settings-shell-all-tabs)
Settings shell screenshot (settings-ratelimits-7-rows-clean)
Settings shell screenshot (settings-comic-weights-save)
Security Review — PR #1355 (bookshelf-2puu)
Scope verification (adversarial check): Diffed all 5 files against
origin/main. Confirmed no production Go, template, route, auth, or migration file was smuggled in. The diff is exactly:docs/content/docs/metadata/_index.md— index card addition (docs only)docs/content/docs/metadata/metadata-settings.md— new end-user doc page (docs only)docs/content/docs/reference/api.md— description-text clarifications on two already-documented admin-gated rowsdocs/route-inventory.md— route-coverage table update reflecting absorbed redirects + new routese2e/browser/journey_settings_shell_test.go— 4-line addition: screenshot capture inside an existingOrderedjourneyItblock, errors silently discarded (_ = upload...)Security checks:
Admin-gate labels in api.md / route-inventory.md: Verified against
internal/settings/routes.golines 58 and 70 — bothPUT /settings/field-priority/ratingandPUT /settings/metadata-field-priorityare wrapped inadminRequired(...). The "admin" access label in the docs accurately reflects the production gate.Docs content (metadata-settings.md): No unsafe guidance. API key handling is described accurately: keys are masked at display (
••••abcd), the "leave field empty to keep stored key unchanged" UX is documented correctly. No advice to disable a security control, no URLs or credentials, no internal symbol references.e2e test addition: The 4 added lines insert a screenshot-upload call inside an existing
Itblock inside anOrderedjourney. The call is fully guarded (if ssErr == nil) and the return value discarded (_ = ...), so a failure cannot affect the test outcome. TheuploadSettingsScreenshotToPRhelper is defined earlier in the same file (line 30) and was already present onorigin/main. Package declaration ispackage browser_test(black-box). Build tag is//go:build e2e. No new unexported symbols exposed.No security surface exists in this diff.
REVIEW VERDICT: 0 blocker, 0 major, 0 minor
Code review of PR #1355 (bead bookshelf-2puu) — diff-only; CI is green and is the source of behavioral truth.
[MAJOR] docs/content/docs/metadata/metadata-settings.md:49 — API key claim excludes Google Books, Open Library, Audnexus, and AniList
The doc states "If the provider requires an API key (Hardcover, ComicVine, Metron), paste your key into the API Key field." This is wrong on two counts:
AuthTypeBasicproviders (shell template ~line 462), not an API key field. Telling users to "paste your key" for Metron will confuse them.AuthTypeKeyproviders inproviderEntries(provider_settings.go:85–91). All four render an API key field in the UI. The list omits all of them.The correct statement should describe that all providers except Open Library and AniList require credentials, and that Metron specifically asks for a username and password rather than an API key. At minimum, "Hardcover, ComicVine, Metron" must be expanded and the username/password distinction for Metron noted.
Fix: update the parenthetical to enumerate providers that require credentials accurately, and note the Metron username/password distinction.
[MAJOR] docs/content/docs/metadata/metadata-settings.md:80 — match weight range "0 to 10" is wrong for comic fields
The doc states "Each weight is a number from 0 to 10." Comic-specific weight fields accept 0–15 (
MaxWeight = 15ininternal/settings/match_weights.go:138). The UI also renders the comic weights section as part of the same Match Weights panel on the Metadata tab. A user setting comic weights above 10 would correctly be accepted by the server but contradicts the doc.Fix: clarify that book/ebook fields accept 0–10 and comic-specific fields accept 0–15, or at minimum say "0 to 10 for standard fields" with a note that comic-specific fields have a higher ceiling.
[MINOR] docs/content/docs/metadata/metadata-settings.md:1 — "Bookdrop Merge Order" listed as a Metadata tab section but is part of the Metadata tab's own content
The table of contents at the top of the doc lists "Bookdrop Merge Order — which provider wins during BookDrop import" as a separate bulleted section, but the page has no corresponding
## Bookdrop Merge Orderheading — the topic is addressed in the_index.mdcard linking tometadata-providers. If Bookdrop Merge Order is truly surfaced on the Metadata tab (it is —MetaBookdropMergeOrderis loaded inloadMetadataTabData), it should have its own section, or the bullet should be removed from the intro list. As-is the doc promises a section that doesn't exist.Fix: either add a
## Bookdrop Merge Ordersection describing the drag-to-reorder UI, or remove the bullet from the intro list.[MINOR] docs/route-inventory.md:135 — redirect coverage claim for GET /settings/metadata-providers mischaracterises the redirect path
The new inventory entry says
GET /settings/metadata-providers"redirects to /settings/metadata". The actual route handler wraps the redirect withadminRequired(routes.go:~line 48), so unauthenticated users get a 401/403 before ever seeing the redirect, not a 301. The note is fine for documentation purposes but the word "Permanent redirect" in the Notes column implies the redirect is unconditional; the auth gate is invisible. Same applies to the GET /settings/match-weights and GET /settings/metadata-field-priority redirect rows. Not a correctness blocker for the inventory doc but worth noting.Fix: add "(auth-gated)" to the Notes for those three redirect rows to match what the code actually does.
[MINOR] e2e/browser/journey_settings_shell_test.go:144 — screenshot capture silently discards upload errors
The new screenshot block does
_ = uploadSettingsScreenshotToPR(...)— discarding the return value. The existing usages at lines 121, 189, 262, 310 all do the same, so this is consistent with the file's convention. However, if the upload fails (e.g., Forgejo API is unavailable in a CI run), there is no log or warning, making PR screenshot failures invisible. This is a pre-existing pattern, not introduced by this PR, but it is worth noting.Fix (optional): consider logging a warning on upload failure. Out of scope for this PR — suggest filing a follow-up bead.
REVIEW VERDICT: 0 blocker, 2 major, 3 minor
Settings shell screenshot (settings-shell-email-tab)
Settings shell screenshot (settings-metadata-field-priority)
Settings shell screenshot (settings-shell-all-tabs)
Settings shell screenshot (settings-ratelimits-7-rows-clean)
Settings shell screenshot (settings-comic-weights-save)
83fca6798fc113cfef22Settings shell screenshot (settings-shell-email-tab)
Settings shell screenshot (settings-metadata-field-priority)
Settings shell screenshot (settings-shell-all-tabs)
Settings shell screenshot (settings-ratelimits-7-rows-clean)
Settings shell screenshot (settings-comic-weights-save)