feat(web): inline-expand summary + Q&A in the list (ADR-031, #16)
Click a summarized card → its full summary (summaryBody) + chat dock (chatReveal)
expand in place via HTMX (GET /v/{id}/expand → expandedCard), collapse back via
GET /v/{id}/card → compact VideoCard. Same <li id>, outerHTML swap — the existing
list-fragment pattern. The card title carries href=/v/{id} as the no-JS fallback
(detail page stays for no-JS + deep links); only summarized cards expand. Reuses
summaryBody + chatReveal so the expanded card never drifts from the detail page.
BDD: inline_expand.feature un-pended + mapped. TDD: 6 handler/fragment tests
(expand/collapse fragments, chat dock, summarized-only, no-JS href, shared body).
Minimal CSS only — the TUI/charm restyle is #17.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -190,6 +190,18 @@ func chatURL(videoID string) templ.SafeURL {
|
||||
return templ.SafeURL("/v/" + videoID + "/chat")
|
||||
}
|
||||
|
||||
// expandURL builds the inline-expand fragment path (GET) — the full summary + chat
|
||||
// dock swapped into the list card in place (ADR-031).
|
||||
func expandURL(videoID string) templ.SafeURL {
|
||||
return templ.SafeURL("/v/" + videoID + "/expand")
|
||||
}
|
||||
|
||||
// cardURL builds the compact-card fragment path (GET) — the collapse target that
|
||||
// returns an expanded card to its compact form (ADR-031).
|
||||
func cardURL(videoID string) templ.SafeURL {
|
||||
return templ.SafeURL("/v/" + videoID + "/card")
|
||||
}
|
||||
|
||||
// Charmbracelet-inspired palette for the summarizing animation (TapirSpinner) —
|
||||
// a charm purple box, pink tapir, mint snout/eyes/progress. Kept as named consts
|
||||
// so the inline span colours and the CSS track/fill share one source of truth.
|
||||
@@ -618,6 +630,10 @@ a.btn, a.btn:visited { color: var(--accent-fg); }
|
||||
.card-meta { color: var(--muted); font-size: .85rem; }
|
||||
.card-preview { color: var(--muted); font-size: .9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.card-foot { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: var(--s1); }
|
||||
/* Inline-expanded card (ADR-031). Minimal layout only — the TUI/charm restyle is #17. */
|
||||
.card-expanded { border-color: var(--accent, #7653fc); }
|
||||
.card-expanded-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
|
||||
.card-collapse { font-size: .85rem; white-space: nowrap; }
|
||||
.chip { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: var(--accent-weak); color: var(--accent); font-size: .72rem; font-weight: 600; }
|
||||
/* passive "retrying later" chip: dim/grey (CharmDim), not the accent — it is a
|
||||
status, not an action the user can take. */
|
||||
|
||||
Reference in New Issue
Block a user