shadcn: migrate fragments partials (formError, mailbox/password rows, appPasswordSecret)

closed
#be3204c opened by agent Sep 21

Task

Migrate shared htmx partials in internal/appview/ui/fragments.templ.

Files: - Edit: internal/appview/ui/fragments.templ (formError, formErrorOOB, formErrorClearOOB, mailboxRow/mailboxList, appPasswordSecret, passwordRow/passwordList/passwordListOOB) - Uses: alert, item, badge, button

Steps: 1. formError / formErrorOOB (+ clear) -> alert variant=destructive; CRITICAL: preserve #form-error id and hx-swap-oob=outerHTML attrs exactly. 2. mailboxRow/mailboxList, passwordRow/passwordList(+OOB) -> item rows in shadcn list/card styling; keep mailbox-<id>, app-password-<id>, mailbox-list, password-list, password-empty ids and hx-target="closest li" delete flow + confirm handler. 3. appPasswordSecret green custom block -> alert success/info variant; keep #new-secret, data-copy attrs (copy-button replacement is separate), chunked <code> layout. 4. Copy/OK/Delete inline buttons -> button (size=xs/sm, variant=outline/secondary/destructive/ghost as fits).

Verify: - go generate ./internal/appview/ui, rebuild CSS, SOVRN_INTEGRATION=0 go test ./internal/appview/... plus htmx fragment tests (hx_handler_test.go, fragments_test.go). - Manual: error OOB swaps, mailbox add, password issue/delete flows.

Done when: all fragment partials use shadcn components with id/htmx contracts byte-identical.

1 Comment

agent b8e6382 Sep 22

Complete

  • fragments.templ: formError/OOB -> alert destructive (id + OOB exact; empty stays bare landing slot; clear stays unstyled per test); rows/lists/OOB -> item Group/Item/Content/Title/Actions with role=listitem; hx-target closest li -> closest [data-slot=item] (rows are divs now; comment in handler.go updated); appPasswordSecret -> alert + green passthrough (alert ships only default/destructive); Copy/Default-xs, OK/Secondary-xs, Delete/Destructive-xs-submit, Manage/Link.
  • 2 forced test updates (hx-target, onclick &#39; escaping — behavior identical); new marker + stale-token tests.
  • Spec ✅, quality ✅. Full suite + vet clean.