Feat: Add Copy URL button and reusable toast notification system
Detail page now has a "Copy URL" button that copies the image's direct file URL to the clipboard. A toast service (BehaviorSubject-backed, auto-dismissing after 3s) confirms success or failure. ToastComponent is registered at the app root and available to all future features. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
33
specs/016-copy-url-toast/quickstart.md
Normal file
33
specs/016-copy-url-toast/quickstart.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Quickstart: Copy URL & Toast Notifications
|
||||
|
||||
## Happy Path — Copy URL
|
||||
|
||||
1. Open any image detail page (e.g. `http://localhost:4200/images/{id}`).
|
||||
2. Confirm a "Copy URL" button is visible.
|
||||
3. Click "Copy URL".
|
||||
4. Confirm a success toast appears ("URL copied!" or similar) and then disappears automatically.
|
||||
5. Paste into a text editor — confirm the pasted value is the full image file URL.
|
||||
|
||||
## Happy Path — Toast Auto-Dismiss
|
||||
|
||||
1. Click "Copy URL".
|
||||
2. Confirm the toast appears.
|
||||
3. Do not interact — wait ~3 seconds.
|
||||
4. Confirm the toast disappears on its own.
|
||||
|
||||
## Edge Case — Clipboard Unavailable
|
||||
|
||||
1. In Firefox, navigate to `about:config` and set `dom.events.asyncClipboard.clipboardItem` to `false` (or test with a non-HTTPS localhost where clipboard API may be blocked).
|
||||
2. Click "Copy URL".
|
||||
3. Confirm an error toast appears (e.g. "Failed to copy URL") and auto-dismisses.
|
||||
|
||||
## Edge Case — Rapid Clicks
|
||||
|
||||
1. Click "Copy URL" three times quickly.
|
||||
2. Confirm only one toast is visible at a time (new toast replaces old, no overlapping stack).
|
||||
|
||||
## Regression — Other Pages
|
||||
|
||||
1. Navigate to the library (`/`), upload page (`/upload`), tags page (`/tags`).
|
||||
2. Confirm no toast or copy button is visible on these pages.
|
||||
3. Confirm existing functionality is unaffected.
|
||||
Reference in New Issue
Block a user