chore(ui): consolidate avatar renderer, auth form-errors, confirm-dialog guideline (LC-169) #214
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/lc-169-ui-consolidation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes LC-169. C3 consolidation follow-ups from the LC-148 audit (
docs/audit/2026-05-22-lc148-audit-report.md), folding three copy-pasted UI patterns back onto a single source each.Avatar / presence badge (one renderer)
The mention popover (
partials/mention_popover.html) re-implemented the avatar circle inline and, unlike every other avatar surface, rendered no presence status dot. Folded it onto the single avatar renderer (partials/avatar.html) using the same{% let avatar_* = ... %}+{% include %}pattern that user search and invite search already use.MentionSuggestiongainsstatus+custom_status; the autocomplete handler resolves presence withroutes::effective_status, so mention rows now show the same offline-aware status dot as the sidebar and user search. Broadcast (@here/@channel) and group (#group) rows keep their glyph badges and never reach the avatar partial.Form-error rendering (one fragment shape)
auth/form_errors.htmlexisted but was included nowhere; all five auth pages (login,register,forgot,reset,verify_email_result) hand-rolled an identical inline{% if let Some(error) = error %}block. Pointed every page at the shared partial and addedrole="alert"to it, so server-rendered auth errors announce to assistive tech the same way the in-place modal/composer slots (.composer-error,.thread-error,#lc-upload-error) already do. Single visual + a11y contract across both rendering paths.Confirm-dialog guideline (documented, not mechanically converted)
Documented the three coexisting confirmation tiers in a new
docs/ui-conventions.mdrather than rewriting sites:hx-confirmfor htmx-driven reversible mutations, nativeconfirm()for plain-<form>POSTs (wherehx-confirmwould not fire), and server-side re-auth / typed verification for irreversible high-blast-radius actions (delete account, delete enclave, stage restore). Converting a plain form to htmx is behavior-changing and must be audited per site, so the deliverable here is the documented default plus a survey of which tier each existing site sits in. The doc also captures the avatar and form-error contracts above so new surfaces inherit all three by construction.Verification
just testandjust test-saasboth green;cargo clippyandcargo fmtclean. Newroutes_mentionsbehavior (presence dot) covered by the existing 15 mention tests, which still pass.C3 follow-ups from the LC-148 audit, folding three copy-pasted UI patterns back onto a single source each. Avatar: the mention popover (partials/mention_popover.html) re-implemented the avatar circle inline with no presence badge. Fold it onto the one avatar renderer (partials/avatar.html) via the same {% let avatar_* = ... %} + include pattern user/invite search already use. MentionSuggestion gains status + custom_status; the autocomplete handler resolves presence with effective_status so mention rows now show the same offline-aware status dot as every other surface. Broadcast/group rows keep their glyph badges and never reach the avatar partial. Form errors: auth/form_errors.html existed but was included nowhere; all five auth pages hand-rolled an identical inline error block. Point every page at the partial and add role="alert" to it so server-rendered errors announce to assistive tech the same way the in-place modal/composer slots already do. Confirm dialogs: documented the three coexisting confirmation tiers (hx-confirm for htmx-driven, native confirm() for plain-form, server-side re-auth/typed for irreversible) in a new docs/ui-conventions.md rather than mechanically converting sites, since converting a plain form to htmx is behavior-changing and must be audited per site. The doc also captures the avatar and form-error contracts above so new surfaces inherit them. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>