fix(library): inline two-stage delete confirm (replaces browser popup)#243
Merged
Conversation
Two complaints from the UI: - The trash button in the action row had a loud red-bordered circle visual, drawing more attention than the actual primary actions. - Clicking it triggered the native browser confirm() popup — looks like an alien dialog, breaks the in-app feel. Mirrors the existing VocabularyPage delete pattern: idle styling is neutral (matches the neighbour icon buttons), first click arms the action — button flips to a red-filled pill with an inline "Confirm?" label — second click within 3 s actually deletes. The 3 s timer reverts the arm if the user does nothing, and the timer is cleared on unmount. Library refresh on delete continues to rely on the pre-existing emitDataChanges(['user-books', 'shelves']) + LibraryPage's on-mount fetch and 5s polling — that path was already in place. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Two visible bugs on the user-book detail page:
primary actions next to it.
confirm()popup, which lookslike an alien dialog inside the app.
Both fixed by porting
VocabularyPage's two-stage delete pattern.Behavior
+, link, share).Hover tints red — destructive intent visible only on intent.
"Confirm?" label. 3 s timer reverts to idle if the user does nothing.
deleteUserBookruns.Library refresh
The pre-existing
emitDataChanges(['user-books', 'shelves'])+LibraryPage'son-mount fetch and 5 s polling already cover the refresh path; this PR
doesn't touch it.
Tests
pnpm -C apps/web buildclean.🤖 Generated with Claude Code