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>
1.2 KiB
1.2 KiB
Quickstart: Copy URL & Toast Notifications
Happy Path — Copy URL
- Open any image detail page (e.g.
http://localhost:4200/images/{id}). - Confirm a "Copy URL" button is visible.
- Click "Copy URL".
- Confirm a success toast appears ("URL copied!" or similar) and then disappears automatically.
- Paste into a text editor — confirm the pasted value is the full image file URL.
Happy Path — Toast Auto-Dismiss
- Click "Copy URL".
- Confirm the toast appears.
- Do not interact — wait ~3 seconds.
- Confirm the toast disappears on its own.
Edge Case — Clipboard Unavailable
- In Firefox, navigate to
about:configand setdom.events.asyncClipboard.clipboardItemtofalse(or test with a non-HTTPS localhost where clipboard API may be blocked). - Click "Copy URL".
- Confirm an error toast appears (e.g. "Failed to copy URL") and auto-dismisses.
Edge Case — Rapid Clicks
- Click "Copy URL" three times quickly.
- Confirm only one toast is visible at a time (new toast replaces old, no overlapping stack).
Regression — Other Pages
- Navigate to the library (
/), upload page (/upload), tags page (/tags). - Confirm no toast or copy button is visible on these pages.
- Confirm existing functionality is unaffected.