You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.2 KiB
Markdown
36 lines
1.2 KiB
Markdown
+++
|
|
title = "quotesdb/ui: hidden toggle on quote pages (auth required to unhide)"
|
|
priority = 5
|
|
status = "done"
|
|
ticket_type = "feature"
|
|
dependencies = ["8a7fba"]
|
|
+++
|
|
## Summary
|
|
Add UI for toggling the hidden state of a quote on the quote detail page. Requires the quote's auth code to change hidden state.
|
|
|
|
## Details
|
|
On the /quotes/:id page:
|
|
- If the quote is hidden, show a visible "Hidden" badge/banner near the top of the quote
|
|
- Show a toggle button: "Make Public" (if hidden) or "Hide" (if visible)
|
|
- Clicking the toggle opens an auth prompt modal asking for the auth code
|
|
- On submit, call POST /api/quotes/:id with the new hidden value and the X-Auth-Code header
|
|
- On success, update the UI to reflect new state
|
|
- On 403, show an error message (invalid auth code)
|
|
|
|
## Notes
|
|
- Hidden quotes are still accessible at /quotes/:id (direct URL)
|
|
- Depends on: 8a7fba (API hidden flag support)
|
|
|
|
## Acceptance Criteria
|
|
- [ ] Hidden badge visible when quote.hidden is true
|
|
- [ ] Toggle button shown on quote detail page
|
|
- [ ] Auth modal appears on click
|
|
- [ ] Correct API call on submit
|
|
- [ ] Success and error states handled
|
|
- [ ] Works for both hiding and unhiding
|
|
|
|
## Validation
|
|
```sh
|
|
cargo fmt && cargo check && cargo clippy
|
|
trunk build
|
|
``` |