Skip to content

Delta Command: conversational UI#12

Draft
nfaggian wants to merge 1 commit into
cursor/ui-precision-535cfrom
cursor/conversational-ui-535c
Draft

Delta Command: conversational UI#12
nfaggian wants to merge 1 commit into
cursor/ui-precision-535cfrom
cursor/conversational-ui-535c

Conversation

@nfaggian

@nfaggian nfaggian commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Reworks the AI surface so it reads as a modern conversational interface (Claude, ChatGPT, Cursor Chat, Perplexity) rather than a dashboard with a one-shot "Generate" button.

What changed

Backend

  • POST /api/chat accepts a full { messages: [{role, content}] } history and returns the next assistant reply. The system prompt embeds a summary of the live database on every turn — the client never sends state.
  • POST /api/briefing is preserved as a canned first-turn wrapper. Both endpoints share a common call_llm(messages) under the hood.
  • New ChatRequest / ChatTurn Pydantic models; build_context broadened to include the top-N active opportunities and available engineers so replies can name specifics.
  • Tests cover 400/503/success paths for /api/chat, including forwarded-history assertions.

Frontend

  • New /chat route as the primary AI surface:
    • Empty-state hero — "What do you need to know?" + four starter prompt tiles
    • Full-height message thread; user bubbles right, assistant left with a Δ mark; MarkdownLite for bold / italic / code / bullets
    • Client-side character-reveal animation with a blinking accent caret at the tip (abortable via Stop)
    • Three-dot typing indicator during the "Analyzing pipeline…" phase
    • Multi-line composer with ⌘⏎ / submit, Shift+⏎ newline, auto-grow to ~8 rows, disabled-until-content Send button
    • Copy button on assistant replies, "New chat" reset in the top bar
    • ?prompt=<id> deep-link auto-submits the first turn
  • Sidebar: Chat promoted to the first nav item with an accent icon + AI badge; a divider separates it from the data-first nav.
  • Dashboard: standalone ExecutiveBriefingPanel replaced by AskDeltaCallout, which presents Delta plus three deep-linked starter prompts. Deleted the panel component.
  • New Tailwind keyframes: typing-dot, caret-blink, message-in (fade + lift).
  • READMEs updated for the new endpoint and surface.

Design principles applied

  1. Chat is the primary primitive. The composer is always ready; no modal.
  2. Streaming reveal. Even without SSE, client-side reveal makes replies feel alive.
  3. Grounded outputs. Every turn re-embeds live data; the assistant cites specific names, percentages, and clients.
  4. Minimal chrome. Sidebar + slim top bar + centered thread + fixed composer, nothing else.
  5. Deep links from data surfaces. The dashboard becomes an entry point to the chat, not a competing AI surface.

Verification

  • next build clean; new chat bundle is 6.35 kB / 122 kB First Load JS
  • tsc --noEmit clean
  • 16 / 16 backend tests pass, including the three new /api/chat tests
  • Playwright screenshots at 2× DPI:

Empty state

Chat empty state

Streaming reveal (caret visible after "capacity):")

Chat streaming

Complete reply

Chat answered

Composer with follow-up drafted

Chat follow-up input

Dashboard callout (deep-links into /chat?prompt=…)

Dashboard with Ask Delta callout

Stacking

Stacked on cursor/ui-precision-535c (PR #11) → cursor/llm-briefing-535c (PR #9). All roll up to the future nfaggian/delta-tools main.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Rework the AI surface so it reads as a modern conversational interface
instead of a dashboard with a one-shot briefing button.

Backend
- POST /api/chat replaces the callable role of /api/briefing. Takes a
  full { messages: [{role, content}] } history and returns the next
  assistant reply. The backend embeds a summary of the live database in
  the system prompt on every turn, so the client never sends state.
- /api/briefing is preserved as a canned first-turn wrapper for CLI /
  non-chat callers; both endpoints share call_llm(messages).
- New ChatRequest / ChatTurn Pydantic models.
- Backend context prompt broadened to include top active opportunities
  and available engineers so replies can name specifics.
- Tests cover 400/503/success paths for /api/chat.

Frontend
- New /chat route as the primary AI surface:
  * empty-state hero ("What do you need to know?") + four starter
    prompt tiles
  * full-height message thread, user bubbles right / assistant left
    with a Δ mark, MarkdownLite for bold/italic/code/bullets
  * client-side reveal animation with a blinking accent caret at the
    tip, driven by an abortable timer (Stop button is wired)
  * three-dot typing indicator for the "Analyzing pipeline…" phase
  * multi-line composer with ⌘⏎ / ⏎ submit, Shift+⏎ newline, auto-grow
    to ~8 rows, disabled-until-content Send button
  * copy button on assistant replies, New chat reset in the top bar
  * ?prompt=<starter-id> deep-link auto-submits the first turn
- Sidebar: Chat promoted to the first nav item with an accent icon and
  an AI badge; a divider separates it from the data-first nav.
- Dashboard: standalone ExecutiveBriefingPanel replaced by an
  AskDeltaCallout that presents Delta plus three deep-linked starter
  prompts.
- New keyframes: typing-dot, caret-blink, message-in (fade+lift).
- READMEs updated for the /api/chat endpoint and /chat surface.

Verified: next build clean (chat bundle 6.35 kB / 122 kB First Load),
tsc --noEmit clean, 16/16 backend tests pass.

Co-authored-by: Nathan Faggian <nathan.faggian@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants