From 2feb762aa2a3f8e0b696263ffc7e798bcb9ef2fa Mon Sep 17 00:00:00 2001 From: Brian Love Date: Sun, 17 May 2026 08:38:31 -0700 Subject: [PATCH 1/8] docs(spec): chat-surface polish design (sub-project B) Three chat-surface tweaks for the demo UX polish pass: collapse the welcome suggestions to a single featured chip plus "More prompts" dropdown, add a 32px gradient fade above the chat input, and bump the message-actions padding to 16px/12px. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../2026-05-17-chat-surface-polish-design.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 docs/superpowers/specs/2026-05-17-chat-surface-polish-design.md diff --git a/docs/superpowers/specs/2026-05-17-chat-surface-polish-design.md b/docs/superpowers/specs/2026-05-17-chat-surface-polish-design.md new file mode 100644 index 000000000..fc352078b --- /dev/null +++ b/docs/superpowers/specs/2026-05-17-chat-surface-polish-design.md @@ -0,0 +1,177 @@ +# Chat surface polish — Design + +**Status:** Approved +**Date:** 2026-05-17 +**Goal:** Three chat-surface tweaks that complete the demo UX polish pass — reduce suggestion footprint to a single chip, add a scroll fade above the input, and increase the message-actions bar padding. + +## Why now + +Sub-project B of the demo UX polish pass. Sub-project A (sidenav) shipped in PR #399 and is live on `demo.cacheplane.ai`. The remaining three items the user flagged from the production review: + +- **Suggestion list** still occupies more space than warranted. With sub-project A's sidenav now drawing the eye correctly, the suggestions are next to compress. +- **Abrupt line** between scrolling chat content and the input bar is jarring. +- **Message-actions bar** sits too tightly under each assistant message. + +## Decisions locked during brainstorming + +| Decision | Choice | +|---|---| +| Suggestions layout | **One featured chip + "More prompts" dropdown** in a single horizontal row, centered under the chat input | +| Featured chip source | `FEATURED_SUGGESTIONS[0]` — the first array entry. Consumer-controlled. Text trims with ellipsis if needed. | +| Canonical demo's featured prompt | "Demo: render a contact form" — the GenUI surface showcase is the most differentiating capability of @ngaf/chat | +| Scroll fade | 32px gradient mask above the chat input | +| Message-actions padding | 16px top / 12px bottom | +| Layout responsiveness | Pill respects container width via `max-width` + ellipsis. No new viewport breakpoints. | + +## Architecture + +### Item 3 — Single featured chip + dropdown + +`WelcomeSuggestionsComponent` (in `examples/chat/angular/src/app/modes/`) was added in PR #383 to render `FEATURED_SUGGESTIONS` (3 chips) + `MORE_SUGGESTIONS` (14 chips in a dropdown). This spec reduces FEATURED to render only its first entry as a single chip, with everything else (FEATURED[1..] + all of MORE_SUGGESTIONS) consolidated into the dropdown. + +Two implementation paths: +1. **Trim FEATURED_SUGGESTIONS to a single entry** in `welcome-suggestions.ts` (data change), keep the component reading `FEATURED_SUGGESTIONS[0]`. +2. **Keep FEATURED_SUGGESTIONS as a 3-entry list** but the component renders only `featured[0]` and merges `featured[1..] ++ more` into the dropdown options. + +We pick #2. Rationale: the data file's intent (group of curated entries) stays consistent for any future consumer that wants to feature multiple chips. The component owns the "show only the first" presentation decision. + +Layout: single horizontal flex row, centered, gap 12px. Pill uses `max-width: 380px` + `text-overflow: ellipsis` so long labels truncate. Dropdown trigger ("More prompts ⌄") is a borderless text-button (subtler than today's bordered chat-select trigger). + +The canonical demo's `FEATURED_SUGGESTIONS` array gets reordered so "Demo: render a contact form" is at index 0. + +### Item 4 — Scroll fade above input + +Chat input lives at the bottom of the chat surface. The scrollable message-list above it currently abuts the input with no visual transition. + +Add a 32px-tall gradient mask layer between the message list and the input: `linear-gradient(180deg, transparent 0%, var(--ngaf-chat-bg) 100%)`. Absolutely positioned, anchored to the top edge of the input region, with `pointer-events: none` so it doesn't block clicks. + +The mask is rendered by `chat-window` or `chat-input` — whichever owns the bottom-anchored input chrome. Inspection needed; lib-side change in either case. + +### Item 5 — Message-actions bar padding + +`chat-message-actions` primitive (libs/chat) wraps the refresh/copy/thumbs row. Current vertical padding is ~4px. Increase to 16px top / 12px bottom via the component's CSS. + +The 16px above separates the action row from the message bubble it belongs to; the 12px below separates it from the next message in the stream. + +## Files touched + +### Demo + +- `examples/chat/angular/src/app/modes/welcome-suggestions.ts` — reorder `FEATURED_SUGGESTIONS` so the contact-form prompt is at index 0 +- `examples/chat/angular/src/app/modes/welcome-suggestions.component.ts` — render only `featured[0]` as the single chip; merge `featured[1..] ++ more` into the dropdown options +- `examples/chat/angular/src/app/modes/welcome-suggestions.component.spec.ts` — update existing tests; add new cases for the single-chip behavior + +### Library + +- `libs/chat/src/lib/primitives/chat-message-actions/` (component file + spec + styles) — increase padding to 16/12 +- `libs/chat/src/lib/primitives/chat-window/chat-window.component.ts` — template gains a `