Skip to content

feat(dashboard): MVP Session UI Overhaul#4

Merged
MattMagg merged 2 commits intomainfrom
001-session-ui-overhaul
Feb 22, 2026
Merged

feat(dashboard): MVP Session UI Overhaul#4
MattMagg merged 2 commits intomainfrom
001-session-ui-overhaul

Conversation

@MattMagg
Copy link
Owner

Changes Made

  • Implement streaming transcript bubbles
  • Add unified composer with model and thinking level overrides
  • Integrate ReactMarkdown for rendering rich responses and thought blocks
  • Implement Unknown Payload fallbacks
  • Implement graceful degradation to polling if SSE drops

@MattMagg
Copy link
Owner Author

@codex


PR Review: #4 - feat(dashboard): MVP Session UI Overhaul

Summary

[1-2 sentence overview of your findings regarding the Session UI Overhaul implementation]

Recommendation

[APPROVE | REQUEST_CHANGES | COMMENT]
(Decision logic: APPROVE if no blocking issues exist. REQUEST_CHANGES for bugs, memory leaks, or missing edge case handling. COMMENT for questions/non-blocking feedback).

Key Findings

🔴 Blocking Issues (must fix)

  • [List any bugs, memory leaks, strict TS errors, or major architectural flaws with file:line references]

🟡 Suggestions (should consider)

  • [List refactoring suggestions, performance tweaks, or minor UX improvements with rationale]

🟢 Nitpicks (optional)

  • [List minor style/formatting notes]

Checklist Summary

Category Status Notes
Code Quality & React ✅/⚠️/❌ [Note on Context/Hook usage]
Security & Boundaries ✅/⚠️/❌ [Note on Edge Case/Unknown payload handling]
Performance ✅/⚠️/❌ [Note on SSE connection and rendering optimization]

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2f1ffe8da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@MattMagg MattMagg merged commit ea8e1ea into main Feb 22, 2026
1 check passed
@MattMagg MattMagg deleted the 001-session-ui-overhaul branch February 22, 2026 23:45
MattMagg added a commit that referenced this pull request Feb 23, 2026
## Context
The session UI had severe UX regressions from a prior incomplete overhaul
(PR #4). Thinking blocks rendered as red JSON error cards, HITL approval
buttons were non-functional, the transcript used a flat layout with no
visual distinction between roles, and the sidebar lacked temporal grouping.
This commit addresses all outstanding issues and applies benchmark patterns
from open-webui and agent-chat-ui reference codebases.

## Changes

### Transcript (`transcript.tsx`)
- **Message layout redesign**: User messages now right-aligned with `rounded-2xl`
  pill background; assistant messages left-aligned with compact indigo avatar;
  system messages compact and muted with smaller amber avatar
- **Streaming indicator**: Staggered pulse dots `ThinkingDots` component with
  150ms delays replacing single ping animation; indigo blinking cursor bar
  for active streaming content
- **Entry animations**: `animate-in fade-in slide-in-from-bottom-2` on all
  message types for smooth appearance
- **Empty states**: Centered Cpu icon with descriptive text; loading state
  uses staggered dots animation
- **sessionKey prop**: Threaded through to EventRenderer and HitlApprovalCard
  to enable approval mutation wiring
- Removed unused `User` icon import

### HITL Approval Card (`hitl-approval-card.tsx`)
- **Functional Approve/Reject buttons**: Wired to `sessions.resolveApproval`
  tRPC mutation with Loader2 spinner during pending state
- **Optimistic local state**: `localResolution` prevents stale UI after action
- **Error display**: Inline mutation error message
- **Animated pending indicator**: Ping dot with "Pending" label replacing
  static "Waiting for user" text
- Added `useMutation`, `useQueryClient`, `useTRPC` imports; component now
  accepts optional `sessionKey` prop

### Content Normalizer (`normalize-content.ts`)
- **Object-format thinking recognition**: Added handler for
  `{type: "thinking", thinking: "..."}` and `{type: "reasoning", ...}`
  payloads that were previously falling through to the unknown event type
- These now render as purple "Agent Reasoning" cards with token estimates
  instead of raw JSON in an unknown payload card

### Gateway Client (`client.ts`)
- **`execApprovalsResolve()`**: New method calling `exec.approvals.resolve`
  RPC with `sessionKey` and `resolution` parameters

### tRPC Sessions Router (`sessions.ts`)
- **`resolveApproval` mutation**: New procedure with Zod-validated input
  (`sessionKey: string`, `resolution: "approved" | "rejected"`)
  proxying to `gateway.execApprovalsResolve()`

### Session Workspace (`session-workspace.tsx`)
- **Header metadata**: Agent Cpu icon, model/thinking/token count badges,
  `formatTokens()` helper for compact display (e.g., "12.2k")
- **Connection status**: Live indicator with Streaming (indigo ping dot) /
  Live (Wifi icon, emerald) / Polling (WifiOff, muted) states
- **Context panel persistence**: Toggle state saved to
  `localStorage("claw-dash:context-panel")` with SSR-safe initializer
- **sessionKey threading**: Passed to Transcript component

### Session Sidebar (`session-sidebar.tsx`)
- **Time grouping**: Sessions grouped into Today/Yesterday/This Week/Older
  with `getTimeGroup()` helper using start-of-day calculations
- **Fallback titles**: `generateFallbackTitle()` extracts agent name and
  formats timestamp from colon-delimited session keys
- **Active state**: Indigo left border (`border-l-2 border-l-indigo-500`)
  with `ring-1 ring-zinc-700/50` highlight

### Deep Thought Block (`deep-thought-block.tsx`)
- CSS grid `0fr → 1fr` expand animation replacing display toggle
- Token count estimate (`Math.ceil(rawText.length / 4)`)
- Purple theming with Brain icon; rotating chevron indicator
- `max-h-96 overflow-y-auto` on expanded content

### Tool Execution Card (`tool-execution-card.tsx`)
- **`TruncatedOutput` component**: 8-line truncation with gradient fade
  overlay and "Show N more lines" / "Show less" toggle
- **Pending state**: `Loader2 animate-spin` with amber "running" label
  when `isPending = !isResult && !payload.result`
- CSS grid expand animation; status icons (CheckCircle2/XCircle/Loader2)

### Unknown Payload Card (`unknown-payload-card.tsx`)
- Changed from alarming red error styling (bg-red-950, AlertTriangle) to
  neutral zinc collapsible card with FileJson2 icon
- CSS grid animation; CodeBlock for syntax-highlighted JSON

### Composer (`composer.tsx`)
- **Inline errors**: `fileError` and `mutationError` state with auto-dismiss
  amber/red banners replacing browser `alert()` calls
- **Drag-drop zone**: `isDragOver` state with indigo ring visual feedback
- **Auto-resize textarea**: `useCallback` + `useEffect` pattern
- **Compact action bar**: Model selector dropdown, thinking level pill
  buttons, Send/Stop with icon + spinner states

### Pre-Session Page (`page.tsx`)
- **Configuration grid**: 2x2 grid for Agent/Model/Workflow/Skills selects
  with shared `selectClass` for consistent styling
- **File handling**: `addFiles()` with 20MB limit and 5-file cap validation,
  inline amber error banner, drag-drop zone
- **Auto-resize textarea**: Matching composer pattern
- **Action bar**: Attachment button, thinking level pills, Start Session
  button with Loader2 spinner

## New Files
- **`docs/session_frontend_prompt.md`**: Originating spec prompt for the
  session UI overhaul, documenting the role definition, known issues,
  execution workflow phases, and benchmark research requirements

## Testing/Verification
- `npm run lint` — zero errors, zero warnings
- `npm run build` — compiled successfully, all routes generated
- Live browser audit via Chrome extension at localhost:3939/sessions:
  verified message layout, thinking block rendering, collapsible cards,
  context panel toggle, sidebar grouping, and composer functionality

## Related
- Follows PR #4 (001-session-ui-overhaul) which left several items incomplete
- Resolves: broken HITL buttons, red unknown payload cards, flat transcript
  layout, missing thinking block recognition for object payloads
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.

1 participant