Skip to content

refactor(web): share the admin settings save bar - #1919

Merged
Quick104 merged 4 commits into
feat/collections-revampfrom
refactor/shared-save-bar
Oct 4, 2026
Merged

Quick104 merged 4 commits into
feat/collections-revampfrom
refactor/shared-save-bar

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #192
Validation tasks: none. The settings pages keep the same save bar markup, and no other page uses the new options yet.

The collection editor in the collections redesign needs a save bar along the bottom of the page, in both the user and admin shells. The only save bar today is the admin settings pill under pages/admin-settings/, which is laid out for the admin sidebar alone. A second copy for the editor would leave two bars to keep in step. This PR moves the settings save bar to components/SaveBar and adds opt-in options for a page placement. Nothing visible changes.

Stacked on #1918 (fix(web): wait for Save before removing a personal poster).

Approach

  • git mv moves SaveBar.tsx and its test to web/src/components/. Its 13 importers now import @/components/SaveBar. Those are the AI, Appearance, Compatibility Proxies, Downloads, General, Infrastructure, Library Metadata, Notifications, Playback, Providers, Requests, Security & Access and Sign-in settings pages.
  • Every new prop defaults to today's behaviour. The settings pill keeps its markup, including its single role="status" wrapper.
  • placement="page" docks a bar up to 1000px wide, the page container's width, along the bottom of the page:
    • It starts at the sidebar edge from the existing --app-sidebar-offset and pads by the shell's content gutter, so its edges line up with the content column.
    • It rises above the background watch or audiobook bar by their measured heights. app.css combines the --watch-bar-height and --audiobook-bar-height values that usePlaybackBarHeight already sets into one --playback-bar-clearance variable.
    • It is a region named "Unsaved changes", and only its message is a live status. The status element stays mounted, empty, while the bar is hidden, so screen readers announce the first change.
    • Below 1024px the buttons are 44px tall and the message can wrap to two lines.
  • More opt-in props, for the editor's create mode: message replaces "N unsaved changes", and discardLabel turns Discard into Cancel. For the page placement only, visible shows the bar before any edit, tone="idle" mutes the dot, and label renames the region. "Create collection", disabled until the form is ready, uses the existing saveLabel and canSave.
  • Layout.tsx and AdminLayout.tsx publish their horizontal padding as --page-gutter and pad with it. The computed padding at each breakpoint is the same as before.

No API change. jellycompat, the Apple and Android clients and the user manual need no change.

Validation

  • Web: lint (no errors; the touched files have no new warnings), format:check, build, budget:check, tsc -b and make test-web pass.
  • Before the move, a test commit pinned the save bar markup on the General and Playback settings pages with a dirty form. Both snapshots pass unchanged after the move. SaveBar.test.tsx passes with only its import path changed.
  • New tests cover the custom message and labels, the create-mode bar before any edit, the page region and status roles, the status node staying in place when the bar appears, and the page bar's use of the sidebar offset, gutter and measured playback clearance.
  • The page placement was checked with the built CSS in headless Chromium at 390, 700, 1280 and 1500px wide, with a background watch bar showing. In both shells the bar sits above the watch bar with its edges matching the content column. At full scroll in the admin shell, the last content row ends above the bar.
  • make verify-local-paths passes. No Go, contract or migration files changed, so the Go and contract checks were not run. make verify-case-collisions does not exist on this base and was not run.

Risks

  • No page uses placement="page" yet. The collection editor will be the first, and it needs a visual check in both shells, with and without a playback bar.
  • The two settings-page snapshots include the shared Button class strings, so a later change to Button styling will need those snapshots updated.
  • On desktop, AdminLayout's lg:pb-8 still drops the playback-bar padding for admin pages. This PR doesn't change that. The page bar's own spacer covers the gap only for pages that use it.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code subagents (implementer, independent reviewer)
  • Model(s): claude-opus-5-5[1m]
  • Involvement: Fully AI-generated, human review pending
  • Adversarial review: An independent reviewer subagent checked the move against the 13 importers and confirmed that the two settings snapshots were byte-identical before and after it. It rebuilt both bars from the built CSS in headless Chromium. It found one major issue: the page bar rose by a fixed 8rem, so on a phone it overlapped the stacked watch bar by about 24px. It also found three minor issues. The admin shell on desktop left too little scroll room under the bar. The bar couldn't show in create mode before any edit. Its padding didn't match the content gutter, and its scrim sat under the playback bar. A nit noted that the live region was inserted with its text already in it. All five were fixed in the last commit. None were dismissed.

🤖 Generated with Claude Code

Note

Move SaveBar from admin-settings to shared components and add page-docked mode

  • Moves the SaveBar component from SaveBar.tsx to SaveBar.tsx and updates imports across all admin settings pages
  • Adds a page placement mode with a fixed main-column dock, responsive gutter and sidebar offsets, playback-bar clearance, scrim, and accessibility labels; existing settings pill behavior is unchanged
  • New props: custom discard text, custom status content, save eligibility, pending/idle tone, and explicit visibility
  • Layout and AdminLayout now expose a responsive page-gutter custom property via padding, and app.css adds a root-level playback clearance variable, so fixed page chrome can read active spacing values
  • Behavioral Change: the SaveBar save action no longer forwards the click event to the callback; its status node stays mounted while hidden for first-change announcements

Macroscope summarized 0b4d94f.

Quick104 and others added 4 commits October 4, 2026 10:25
The admin settings save bar is about to move to components/ so the
collection editor can share it. Pinning its rendered markup on General
and Playback proves the move leaves every settings page unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The collection editor needs the same floating save bar the admin
settings pages use. Moving it out of pages/admin-settings lets both
import one component instead of growing a second copy. No markup
changes; the settings pages render it exactly as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The collection editor needs the save bar under its page container in
either shell, not centred beside the admin sidebar. placement="page"
starts at the sidebar edge both shells already publish in
--app-sidebar-offset, rises above the background playback bar by a new
--main-inset-bottom that Layout and AdminLayout set on <main>, and
announces only its message inside a labelled region. message and
discardLabel let the editor name its staged fields and offer Cancel.
Settings pages keep the default placement and render as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e with content

The page placement rose by a hard-coded 8rem/9rem, which overlapped the
taller stacked watch bar on phones, and in the admin shell at lg its scroll
room left the end of the page under the raised bar. It now rises by
--playback-bar-clearance, derived on :root from the playback bar heights
usePlaybackBarHeight already measures, and its spacer and scrim include
that clearance. Both shells publish --page-gutter and pad by it, so the bar
lines up with the content column at every width.

The editor's create mode needs the bar before anything is staged, so
visible, tone and label are opt-in props. The page status stays mounted,
empty, while the bar is hidden, so the first change is announced.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T14:48:16.420698Z 0b4d94f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 154a6200-795c-46d6-9961-c4fa9bab5fb1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from fix/personal-poster-removal-on-save to feat/collections-revamp October 4, 2026 20:26
@Quick104
Quick104 merged commit c362e55 into feat/collections-revamp Oct 4, 2026
14 checks passed
@Quick104
Quick104 deleted the refactor/shared-save-bar branch October 4, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant