Skip to content

feat(ui): shared PageBack component for consistent back navigation - #12

Merged
Quick104 merged 3 commits into
mainfrom
t3code/5155230b
May 27, 2026
Merged

Quick104 merged 3 commits into
mainfrom
t3code/5155230b

Conversation

@Quick104

@Quick104 Quick104 commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add PageBack — a small glass-subtle chevron pill, absolute-positioned in the top-left, calling navigate(-1) — matching the existing DetailBreadcrumb chevron styling exactly.
  • Replace eight inconsistent back affordances across user-facing pages (hero overlays, header pills, ghost links, plain text links) so the control lands in the same screen position regardless of title length or hero content.
  • DetailBreadcrumb keeps its textual hierarchy path on Season/Episode pages but no longer owns the back chevron.
  • DetailHero gains a topNav slot that hero pages opt into; non-hero pages add PageBack inside a relative wrapper.

Pages affected

Hero (slot into DetailHero): MovieContent, SeriesContent, SeasonContent, EpisodeContent, RequestDetail
Hero (new affordance, custom header): PersonDetail
Non-hero (replace existing back): SettingsLayout, RequestBrowse, CollectionEditor, SmartCollectionWizard, RecommendationsSection
Non-hero (new affordance): ProfileCustomizeHome
Component: DetailBreadcrumb (chevron removed, breadcrumb segments retained)

Out of scope: admin pages, auth/onboarding flows, playback chrome, Watch Together flows.

Spec: docs/superpowers/specs/2026-05-26-page-back-component-design.md

Test plan

  • cd web && pnpm exec eslint <changed files> — 0 errors, 1 pre-existing warning
  • cd web && pnpm exec prettier --check <changed files> — clean
  • cd web && pnpm exec tsc -b — clean
  • cd web && pnpm exec vitest run src/components/PageBack.test.tsx — 4 new tests pass (default label, custom label, navigate(-1) on click, positioning classes)
  • Updated EpisodeContent.test.tsx to drop assertions on the removed chevron link; existing path-segment link still asserted.
  • Updated SettingsLayout.test.tsx to check for aria-label="Go back" instead of the removed href="/" link.
  • make verify-local-paths — clean
  • Manual smoke: navigate Home → movie detail → confirm chevron in top-left and clicking returns to Home. Repeat for Series, Season, Episode, Person, Request detail, Request browse, Collection editor, Smart collection wizard, Settings, Recommendations Section. Confirm chevron stays in the same screen position across pages.
  • Manual visual check on a Season detail page: textual breadcrumb path (e.g. "Series Title › Season N") still renders inside the hero info column and segment links still navigate to the series page.

🤖 Generated with Claude Code


Note

Low Risk
UI-only navigation and layout changes with no API or auth impact; main review focus is correct fallback routes and history vs explicit to on deep-linked pages.

Overview
Introduces a shared PageBack control (glass chevron pill, top-left) that calls navigate(-1) when router history exists, otherwise navigates to a configurable fallback (to, default /). Optional preferHistory, label, and floating (viewport-pinned on large screens, e.g. Settings) round out the API, with Vitest coverage for navigation and styling.

DetailHero gains a topNav slot; movie/series/season/episode and request detail pages pass PageBack there. Other user-facing screens replace ad-hoc ghost links, text links, and header back buttons with PageBack inside relative wrappers (often with top margin so content clears the overlay). Collection flows typically use to="/collections" with preferHistory={false}; recommendations/requests browse similarly pin to their hub routes.

DetailBreadcrumb drops its leading chevron back link and keeps only the text trail; episode tests now expect a single season href (breadcrumb only, not a duplicate back control). RequestDetail removes inline back buttons from the action bar and error state in favor of hero/header PageBack. SettingsLayout / wizard tests assert the accessible Go back button instead of old link markup.

Reviewed by Cursor Bugbot for commit 13fe740. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added a standardized back-navigation control with accessible label, configurable target/behavior, and optional pinned/floating layout; integrated into detail heroes via a top-navigation slot.
  • Refactor

    • Replaced inline back links across editors, detail pages, profiles, settings, recommendations, requests, and wizards with the shared back control; simplified breadcrumbs and header layouts.
  • Tests

    • Added and updated tests to verify rendering, labeling, styling and navigation behavior of the new back control.

Review Change Stack

Replace the eight inconsistent back affordances across user-facing pages
with a single absolute-positioned chevron pill, so the control lives in
the same screen position regardless of title length or hero content.

DetailBreadcrumb keeps its textual hierarchy path but no longer owns the
back chevron; PageBack does. DetailHero gains a topNav slot consumed by
Movie/Series/Season/Episode/Request detail pages. Non-hero pages drop
their bespoke back buttons and add PageBack inside a relative wrapper.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 087189d8-354c-42ee-a679-b471d52f3b1f

📥 Commits

Reviewing files that changed from the base of the PR and between 8492043 and 13fe740.

📒 Files selected for processing (10)
  • web/src/components/PageBack.test.tsx
  • web/src/components/PageBack.tsx
  • web/src/pages/CollectionEditor.tsx
  • web/src/pages/PersonDetail.tsx
  • web/src/pages/ProfileCustomizeHome.tsx
  • web/src/pages/RecommendationsSection.tsx
  • web/src/pages/RequestBrowse.tsx
  • web/src/pages/RequestDetail.tsx
  • web/src/pages/SettingsLayout.tsx
  • web/src/pages/SmartCollectionWizard.tsx
✅ Files skipped from review due to trivial changes (1)
  • web/src/pages/ProfileCustomizeHome.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
  • web/src/pages/PersonDetail.tsx
  • web/src/pages/RequestBrowse.tsx
  • web/src/pages/RecommendationsSection.tsx
  • web/src/pages/CollectionEditor.tsx
  • web/src/pages/RequestDetail.tsx

📝 Walkthrough

Walkthrough

Adds a reusable PageBack component (label, to, preferHistory, floating), updates DetailHero to accept topNav, replaces inline back-navigation across item-detail and standard pages, simplifies breadcrumbs, removes RequestActions' onBack/back button, and adds PageBack tests.

Changes

Back Navigation Consolidation

Layer / File(s) Summary
PageBack component and tests
web/src/components/PageBack.tsx, web/src/components/PageBack.test.tsx
New PageBack with label?: string, to?: To, preferHistory?: boolean, and floating?: boolean; implements conditional navigate(-1) vs navigate(to); tests mock useNavigate, assert label, click navigation behavior, and styling classes.
DetailHero topNav support
web/src/pages/ItemDetail/DetailHero.tsx
DetailHeroProps adds topNav?: ReactNode; DetailHero destructures and renders topNav at the top of the hero section.
Item detail pages integration
web/src/pages/ItemDetail/*
Episode, Movie, Season, and Series content pages import PageBack and pass it to DetailHero via topNav. EpisodeContent tests updated for breadcrumb/back-link expectations.
DetailBreadcrumb simplification
web/src/pages/ItemDetail/components/DetailBreadcrumb.tsx
Drops ChevronLeft import and back-link rendering; simplifies breadcrumb container while keeping per-segment rendering and final aria-current="page".
Standard pages PageBack adoption
web/src/pages/CollectionEditor.tsx, web/src/pages/PersonDetail.tsx, web/src/pages/ProfileCustomizeHome.tsx, web/src/pages/RecommendationsSection.tsx, web/src/pages/RequestBrowse.tsx, web/src/pages/SettingsLayout.tsx, web/src/pages/SettingsLayout.test.tsx
Replaces inline Link/ArrowLeft back-navigation with PageBack and adjusts container classes (adds relative where applicable). Settings test now checks for aria-label="Go back".
RequestDetail and RequestActions refactoring
web/src/pages/RequestDetail.tsx
Removes local useNavigate back usage, embeds PageBack in error state and as topNav in DetailHero; RequestActions removes onBack prop and its back button.
SmartCollectionWizard refactoring
web/src/pages/SmartCollectionWizard.tsx
Renders PageBack above the wizard header, removes backHref/Link usage in WizardHeader, and simplifies the header props/layout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A tiny hop, a chevron's track,

I press the button, the page rolls back,
One component guides each backward leap,
From hero tops to settings deep,
PageBack keeps routes in tidy stacks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(ui): shared PageBack component for consistent back navigation' directly and clearly summarizes the main change: introducing a shared PageBack component to standardize back navigation across the UI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/5155230b

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

Comment thread web/src/pages/SettingsLayout.tsx Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7be1f7363b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/src/components/PageBack.tsx Resolved
Comment thread web/src/pages/SettingsLayout.tsx Resolved
Comment thread web/src/pages/SettingsLayout.tsx Resolved
- Add `floating` prop to pin PageBack to viewport on lg+ screens
- Switch styling from glass-subtle to glass with shadow for better contrast
- Use floating variant on SettingsLayout
Comment thread web/src/pages/SmartCollectionWizard.tsx Resolved
Comment thread web/src/pages/CollectionEditor.tsx Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 13fe740. Configure here.

type="button"
aria-label={label}
onClick={goBack}
className={`glass text-foreground hover:bg-accent ${position} z-20 flex items-center justify-center rounded-full p-1.5 shadow-md transition-colors`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong CSS class: glass instead of glass-subtle

Medium Severity

The PageBack button uses the glass CSS class, but both the design spec and PR description explicitly require glass-subtle to match the old DetailBreadcrumb chevron styling. The glass class renders a significantly more prominent effect (70% surface opacity, 20px blur, heavy drop shadow) compared to glass-subtle (40% surface opacity, 12px blur, minimal shadow). This visual mismatch is especially noticeable on hero pages with backdrop images, where the spec notes glass-subtle was chosen for contrast balance. The test also asserts the wrong class.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 13fe740. Configure here.

@Quick104
Quick104 merged commit d9e287a into main May 27, 2026
14 checks passed
@Quick104
Quick104 deleted the t3code/5155230b branch May 27, 2026 01:29
Quick104 added a commit to thezak48/silo-server that referenced this pull request Jun 7, 2026
feat(ui): shared PageBack component for consistent back navigation
Quick104 added a commit that referenced this pull request Jun 11, 2026
feat(ui): shared PageBack component for consistent back navigation
CoffeeKnyte added a commit that referenced this pull request Jul 31, 2026
…accurate

Five defects in revocation state and credential semantics. Lands after the
tracker-lifecycle batch on purpose: raising the over-cap TTL is only safe once
the count feeding it is trustworthy.

#13 -- a longer old revocation suppressed a newer cutoff. applyLocal kept or
replaced the WHOLE record by expiry, so when the existing revocation expired
later the new one was dropped entirely, including its newer RevokedAt. The
durable upsert did the same, with a comment documenting it as intentional.
RevokedAt is the user-kill CUTOFF, so this left a credential issued between the
two cutoffs valid -- a second admin kill after a user re-authenticates silently
failed to cut them. The two fields now merge independently: ExpiresAt stays
monotonic, RevokedAt advances to the later value, and reason follows the newer
cutoff. Both superseded comments are replaced rather than left contradicting the
code. Session-kind revocation still ignores RevokedAt, so the enforcer's
re-revoke cannot weaken a session kill.

Also fixed while here: Redis received the merged record but pub/sub published the
raw input one, so under pub/sub-only delivery (Redis down) an edge got the newer
short record without the older long expiry and lost monotonicity. Both now carry
the merged record.

#7 + M1 -- Postgres could indefinitely block the urgent Redis kill.
RevokeWithWarnings held the global opMu across all propagation, stripped the
caller's deadline with WithoutCancel, and did the durable Postgres upsert BEFORE
Redis, on a pool with no statement timeout. The local kill still applied, so
playback on that process was fine -- but edge propagation, pub/sub, the admin
response and every later revoke/unrevoke stalled behind the lock. Redis and
pub/sub now go first, and the detached context is bounded. WithoutCancel is kept
deliberately: propagation must outlive an aborted admin request.

opMu scope is deliberately NOT narrowed. mirrorToRedis is an unconditional SET
with no atomic merge, so same-process serialization is what stops an older value
overwriting a newer one; narrowing the lock would also let an unrevoke interleave
with a revoke's propagation. Bounding the context caps how long the lock can be
held, which is the actual reported harm. The remaining cross-replica race -- two
central replicas racing the same SET -- is documented, not half-fixed; it needs
A6's shared picture.

A2 / #6 -- a missed unrevoke got resurrected. In-memory tombstones already
existed, but being process-local they did not survive a restart or reach a
replica that missed the pub/sub event, so maintain's durable self-heal
re-Upserted the surviving entry and the ban returned. Tombstones are now durable,
via two nullable columns on stream_revocations rather than a second table: a
tombstone is a state of the same key, and it needs its own expiry horizon
separate from the revocation's. The upsert rejects a stale replica's write while
a tombstone is live but lets a genuinely newer revocation clear it, and warm
paths apply tombstones BEFORE revocations so an un-banned key cannot be restored
as a live kill. Tombstones are pruned on the same sweep, so the table cannot grow
without bound.

A1 / #3 -- over-cap kills reopened after 5 minutes while the token stayed
reconstructable for 24h. The TTL now derives from playback.MaxTokenTTL rather
than duplicating 24h, behind a validated setting.

Critically, the enforcer uses a revoke-if-absent path rather than re-revoking.
Expiry is monotonic and the enforcer re-evaluates every 30s, so a plain long TTL
would slide expiry forward by another full lifetime on every pass -- making a
wrong kill effectively permanent for as long as any stale record persisted, with
only an explicit unrevoke to recover it. Admin Revoke keeps its monotonic
behaviour; only the enforcer's own repeat kill is non-extending. The setting is
documented as affecting future revocations only, since monotonic expiry means it
cannot shorten one already issued.

A3 / #5 -- the user cutoff compared against a fresh time.Now() taken at request
entry, so a request from a pre-cutoff login could look post-cutoff and escape the
kill. The credential time is now the access token's iat.

Two deliberate choices worth stating. API-key credentials carry no issue time, so
they pass the zero time and, per IsRevoked's documented contract, are never
matched by a user cutoff: a user kill provably cannot cut an API-key-owned pour.
That is an accepted, logged, documented hole -- and strictly better than
time.Now(), which actively defeats the cutoff. And jellycompat uses the compat
session's CreatedAt rather than the bridged Silo token's iat, because that token
refreshes without a new Jellyfin login, so its iat would advance on refresh and
let a refreshed credential slip past a cutoff.

Stream tokens are now bound to their route: a token whose SessionID does not match
the URL's session_id is rejected with 403 instead of being silently ignored,
matching the reconstruction helper that already refused a different session.

Per-login logout cuts remain out of scope -- they need per-login identity in the
stream credential. S5 (the (sessionID, userID, startedAt) clump) is rejected as
ceremony now that A3 is the iat option rather than the generation model.

#12 (closing an RSS feed does not cut its current pour) is deferred: it needs a
namespaced revocation id that cannot collide with real session ids, that id
threaded onto public feed requests, and protection against a new feed inheriting
an old tombstone.

Part of #305.
@kody-ai kody-ai Bot mentioned this pull request Sep 27, 2026
2 tasks done
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