2.7 KiB
| title | status | type | priority | created_at | updated_at |
|---|---|---|---|---|---|
| Submit form: author optional (default Anonymous), clarify auth code auto-generation | completed | bug | normal | 2026-03-10T23:32:07Z | 2026-03-10T23:32:07Z |
Bug
Two related UX issues on the submit form (src/bin/ui/pages/submit.rs):
1. Author field should be optional
Currently, author is required — the validation at line 53 returns early with "Text and author are required." if it is empty, and the field has required=true at line 177. Not all quotes have a known author, so it should be optional. When left blank, the API should receive "Anonymous" as the author.
2. Auth code label should clarify auto-generation
The label currently reads "Custom auth code (optional)". The label itself does not explain what happens if left blank. The placeholder does say "word-word-word-word (auto-generated if empty)", but users may not notice placeholders. The label should make it explicit.
Expected behaviour
- Author field: leaving it blank submits the quote with author =
"Anonymous". The field should not block form submission. - Auth code label: reads something like
"Custom auth code (optional — one will be generated if left blank)".
How to fix
In src/bin/ui/pages/submit.rs:
Author optional:
- Change the validation at line 53:
// Before if text_val.is_empty() || author_val.is_empty() { error.set(Some("Text and author are required.".to_string())); return; } // After if text_val.is_empty() { error.set(Some("Quote text is required.".to_string())); return; } - When building
CreateQuoteInput, default the author to"Anonymous"if empty:author: if author_val.is_empty() { "Anonymous".to_string() } else { author_val }, - Remove
required=truefrom the author<input>(~line 177). - Update the label from
"Author *"to"Author (optional, defaults to Anonymous)"or similar. - Update the placeholder from
"e.g. Mark Twain"to"e.g. Mark Twain (leave blank for Anonymous)".
Auth code label:
- Change the label at line 236 from:
to:"Custom auth code (optional)""Auth code (optional — one will be generated if left blank)"
File
src/bin/ui/pages/submit.rs(lines 53–56, 64–66, 163–178, 235–237)
Validation
# From quotesdb/ root
cargo fmt && cargo check && cargo clippy && cargo test
trunk build
Manually test: submit a quote with author left blank — it should succeed and display Anonymous as the author.
Commit scope
fix(quotesdb): submit form author optional and auth code label