Skip to content

Basic pinning support (PP-3116) - #203

Merged
tdilauro merged 6 commits into
mainfrom
feature/pinning-basics
Sep 29, 2026
Merged

tdilauro merged 6 commits into
mainfrom
feature/pinning-basics

Conversation

@tdilauro

@tdilauro tdilauro commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds basic library pinning, behind a new feature flag.

  • Feature flag: set the PALACE_CPW_FEATURE_PINNING environment variable to true to enable pinning. It is off by default; while off, pin controls are hidden and stored pins are ignored. The flag is documented in the README with the other feature flags.
  • Pin and unpin from a library's page (header, next to the language selector) and from each card on the multi-library home page. The item landing page has no pin controls.
  • My Libraries section above the search on the home page and the item landing page. It lists pinned libraries in pinned order and leaves out any that are no longer available.
  • With pins shown: the search heading becomes "Find another library:" and the full library list shows only while the search box holds text. Pinning or unpinning from the home page clears the search.
  • Public computer warning on the first pin, with a "Do not show this again." option and a "Reset the shared computer warning" button in My Libraries.
  • Unpinning a library the user is signed in to asks for confirmation and signs out. From the library page this runs the full sign-out flow, now shared with the Sign Out button through a new useSignOutFlow hook. From the home page it clears the stored credentials only.
  • Accessibility:
    • Pin and unpin are announced to screen readers.
    • When the pressed button disappears, focus moves to the library's new button, a neighboring library's button, or the heading.
    • The dialogs are named and described by their visible heading and message.
    • The search box is named by its heading.
  • Shared pieces: an AlertDialog component for confirmation dialogs; LibraryCard gains a slot for the pin button.
  • Dialog fix: dialogs and their backdrop now sit on the theme's modal layer, so page content no longer shows through. This applies to all dialogs.
  • Translations: new strings in French, Italian, German, and Spanish, plus pinning terms in the translation glossary.

Known limitations:

  • VoiceOver in Safari can miss the pin and unpin announcements when focus moves at the same time. VoiceOver-specific support is deferred for now.
  • Unpinning a signed-in library from the home page does not call the server-side logout.

Important

This branch is stacked on PR #202. This PR must not be merged until that one lands.

Motivation and Context

Patrons should not have to find their library(ies) in the full list on every visit. Pinning keeps those libraries at the top of the library pickers on this device. The PALACE_CPW_FEATURE_PINNING flag allows us to test the feature without it surfacing to users before it is ready.

[Jira PP-3116]

How Has This Been Tested?

  • Unit tests cover:
    • the pin button, both dialogs, and the announcements;
    • the My Libraries section, including focus after pin and unpin and changes from another tab;
    • both library pickers, with the hidden list and the search reset;
    • the header pin and both sign-out paths;
    • the feature flag.
  • Checked by hand in Chrome and Safari: keyboard focus, dialog behavior, and the dialog layering.
  • All tests pass locally and in CI.

Checklist:

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

Screenshots

Initially the full "Choose a library" and we click the pin icon
Untitled 11

Confirm the pin
Untitled 6

Now the library is pinned in "My Libraries"
Untitled 7

Find another library
Untitled 8

Confirm the pin and click "Do not show again"
Untitled 9

The second library is pinned and we have the option to reset the confirmation dialog
Untitled 10

@tdilauro
tdilauro added this pull request to stack #204 September 28, 2026 01:01
@tdilauro
tdilauro requested a review from a team September 28, 2026 01:04
@tdilauro tdilauro mentioned this pull request Sep 28, 2026
1 task done
Base automatically changed from feature/library-cards to main September 28, 2026 17:59
@tdilauro
tdilauro force-pushed the feature/pinning-basics branch from ca7b404 to 9b9f3af Compare September 28, 2026 17:59
@coveralls

coveralls commented Sep 28, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 36521806022

Coverage decreased (-2.8%) to 26.946%

Details

  • Coverage decreased (-2.8%) from the base build.
  • Patch coverage: 210 uncovered changes across 15 files (17 of 227 lines covered, 7.49%).
  • 7 coverage regressions across 4 files.

Uncovered Changes

Top 10 Files by Coverage Impact Changed Covered %
src/components/PinnedLibraryList.tsx 51 1 1.96%
src/components/PinButton.tsx 42 1 2.38%
src/hooks/useSignOutFlow.ts 34 1 2.94%
src/components/context/PinnedLibrariesContext.tsx 34 3 8.82%
src/utils/publicWarning.ts 15 2 13.33%
src/components/MultiLibraryHome.tsx 10 0 0.0%
src/components/PublicComputerWarning.tsx 9 2 22.22%
src/components/AlertDialog.tsx 7 2 28.57%
src/components/LibraryFilterList.tsx 5 0 0.0%
src/components/WorkLibrarySelector.tsx 4 0 0.0%
Total (18 files) 227 17 7.49%

Coverage Regressions

7 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
src/components/MultiLibraryHome.tsx 3 2.04%
src/components/WorkLibrarySelector.tsx 2 2.26%
src/components/LibraryFilterList.tsx 1 3.77%
src/components/SignOut.tsx 1 5.88%

Coverage Stats

Coverage Status
Relevant Lines: 2416
Covered Lines: 757
Line Coverage: 31.33%
Relevant Branches: 1707
Covered Branches: 354
Branch Coverage: 20.74%
Branches in Coverage %: Yes
Coverage Strength: 8.8 hits per line

💛 - Coveralls

Comment thread src/components/PinnedLibraryList.tsx Outdated

@PoorBillyPilgrim PoorBillyPilgrim 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.

This is great, @tdilauro. The accessibility feels robust. I tested locally and analyzed with Axe DevTools and WAVE; it all LGTM.

I just had a single comment, but non-blocking, so I'll go ahead and approve.

@tdilauro
tdilauro force-pushed the feature/pinning-basics branch from 9b9f3af to 52008ed Compare September 29, 2026 04:28
@tdilauro
tdilauro merged commit b4ee8af into main Sep 29, 2026
7 checks passed
@tdilauro
tdilauro deleted the feature/pinning-basics branch September 29, 2026 04:54
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.

3 participants