Skip to content

Agent UI: terminal animations, pixelated cursor, and docs fixes - #568

Merged
kovtcharov merged 16 commits into
mainfrom
kalin/fix-agent-ui-docs
Mar 19, 2026
Merged

kovtcharov merged 16 commits into
mainfrom
kalin/fix-agent-ui-docs

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Terminal-style welcome page: Typewriter effect types out "GAIA Agent UI" and subtitle with hacker-style randomized timing (bursts, pauses, micro-stutters). "GAIA" text pulses with a subtle red glow. Content cascades in sequentially after typing completes.
  • Feature card hover interaction: Fixed-height cards show thematic code hints (> encrypt --local, > npu.accelerate(), etc.) that get erased by the cursor on hover, replaced by expanded descriptions typed out hacker-style with inline cursor tracking.
  • Pixelated red cursor: Consistent 8px blocky AMD red cursor with glow, used across welcome page, chat streaming, typing indicator dots, and input cursor. Sharp-edged (border-radius: 0, image-rendering: pixelated).
  • Smooth view transitions: Crossfade animation between welcome screen and chat view (250ms opacity + translateY). Session switching also smoothly transitions.
  • Elegant agent activity animations: Tools and thinking slide in/out with staggered delays instead of harsh appear/disappear. Thinking text slides from left, tool cards scale up with cascade.
  • Chat view polish: Bouncing mini-cursor typing indicator, scroll-to-bottom button slide animation, staggered empty-state chips, input focus glow pulse, smoother message entrance with subtle scale.
  • Global animation infrastructure: Theme transition CSS utility, toast exit with slide, modal exit keyframes, sidebar content fade on collapse. All animations respect prefers-reduced-motion.
  • Docs fixes: Corrected CLI commands, API method names, and missing model fields in Agent UI documentation.

Test plan

kovtcharov and others added 2 commits March 18, 2026 11:07
…g model fields

- Troubleshooting: show both npm (gaia-ui) and Python CLI (gaia --ui-port) commands
- Fix RAG SDK method: index_file() -> index_document(), chunk_count -> num_chunks
- Add missing indexing_status field to DocumentResponse
- Add missing agent_steps field to MessageResponse
- Update npm package section: gaia -> gaia-ui CLI command name

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…config update

- Add self-hosted fonts (DM Sans, JetBrains Mono, Space Mono) for consistent rendering
- Refine UI styling across ChatView, Sidebar, WelcomeScreen, MessageBubble,
  DocumentLibrary, SettingsModal, and ConnectionBanner
- Update eval config: default model to claude-sonnet-4-6 with pricing
- Add agent-ui eval benchmark plan

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions github-actions Bot added documentation Documentation changes eval Evaluation framework changes electron Electron app changes performance Performance-critical changes labels Mar 18, 2026
@kovtcharov
kovtcharov requested a review from itomek-amd March 18, 2026 18:52
@kovtcharov kovtcharov self-assigned this Mar 18, 2026
- Welcome page: typewriter effect for title and subtitle with hacker-style
  randomized timing, sequential content reveal, GAIA text pulsating glow
- Feature cards: fixed-height with code hints that get erased by cursor on
  hover, replaced by expanded descriptions typed out hacker-style
- Pixelated red cursor: consistent 8px blocky design with AMD red glow
  across welcome page, chat streaming, typing indicator, and input cursor
- View transitions: smooth crossfade between welcome and chat views
- Agent activity: elegant slide-in/out transitions for tools and thinking
- Chat polish: bouncing typing indicator, scroll button slide, staggered
  chips, input focus glow, smoother message entrance animations
- Global: theme transition CSS, toast exit slide, modal exit keyframes,
  sidebar content fade on collapse, prefers-reduced-motion support
@kovtcharov kovtcharov changed the title Agent UI: docs fixes, UI polish, and eval config update Agent UI: terminal animations, pixelated cursor, and docs fixes Mar 18, 2026
kovtcharov and others added 11 commits March 18, 2026 15:53
… refinements

- Smooth streaming exit: streaming bubble fades out with content snapshot
  before completed message appears (no duplicate flash or jarring vanish)
- Stop button: AMD red accents for immediate visual priority during streaming
- User messages: removed contradictory left border for cleaner asymmetry
- GAIA avatar: subtle red glow in dark mode ties into accent system
- Copy confirmation: green background tint flash for clearer feedback
- Agent activity: stronger thinking bar glow, visible collapsed summary
- Input area: inset shadow depth, higher placeholder contrast
- Text selection: AMD red tint across entire app for brand cohesion
- Scrollbars: unified 5px themed scrollbars across all panels and modals
- Glassmorphism: consistent backdrop-blur on all floating surfaces
- Button active states: tactile press feedback on all button types
- Hover accents: doc pills, attachments, tool cards use AMD red consistently
- Transition timing: unified to design system variables throughout
…shell whitelist

The suggested "What hardware is in my PC?" query was completely broken due to:
- Missing system info commands (systeminfo, wmic, powershell, lscpu, lspci, etc.)
- LLM defaulting to Linux commands on Windows (no platform awareness in prompt)
- PowerShell pipe commands broken by shlex.split stripping quotes
- Windows /flags (e.g., findstr /i) misidentified as file paths
- Piped commands not validated against whitelist (security gap)

Changes:
- shell_tools.py: Add cross-platform system info commands to whitelist, add
  PowerShell/wmic with read-only cmdlet validation, fix command execution to
  preserve quoting on Windows, add pipe pipeline validation, block dangerous
  shell operators (>, &&, ||, ;), fix Windows flag path detection
- agent.py: Add dynamic platform detection to system prompt so LLM uses the
  correct OS-specific commands (Windows/macOS/Linux)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…URLs

- AnimatedPresence wrapper: delays unmount for CSS exit animations on all
  modals (Documents, File Browser, Settings, Mobile Access)
- Modal exit: overlay fades out + panel slides down (reverse of entrance)
- Session delete: slides left + shrinks + fades (250ms) before removal,
  sessions below smoothly reflow
- Message delete: fades + scales down + shrinks (250ms) before removal
- Session URL routing: sessions linkable via #hash in URL bar, auto-updates
  on session switch with getSessionHash/findSessionByHash utilities
- Default model updated from Qwen3-Coder-30B to Qwen3.5-35B-A3B across
  ChatAgent config, effective model selection, and database defaults
- Added network query guidance: prefer ipconfig, identify primary adapter
  by real Default Gateway, ignore virtual adapters unless asked
Replace count-based session polling with fingerprint comparison that
detects any change (new/deleted sessions, title edits, timestamp
updates). Add guard against empty server responses wiping the sidebar.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Increase Lemonade health check timeout from 3s to 10s and soften the
banner message to acknowledge the server may be busy rather than down.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…hardening, and test plan

Thinking/cursor display:
- Stream LLM reasoning_content as <think> tags through SSE handler
- FlowThought component shows thinking text with red cursor in AgentActivity
- Single cursor rule: only one red cursor visible at any time
- LoadingMessage with sequential red glowing dots while waiting for LLM
- Auto-collapse AgentActivity panel when thinking completes
- Separated thinking events from status events (start_progress -> status type)

Lemonade integration:
- Model badge shows live model from Lemonade health API (not stale session DB)
- Settings modal shows model size, device, context window, GPU, inference speed
- Inference stats (tok/s, TTFT, token counts) on each assistant message
- Model override: custom HuggingFace model with status indicators (found/downloaded/loaded)
- Settings persistence via SQLite settings table

Security hardening:
- Block & operator in shell commands (was only blocking &&)
- Remove foreach-object from safe PS cmdlets (allows .NET code execution)
- Add shlex.split ValueError handling for malformed PS commands
- Improved DANGEROUS_SHELL_OPERATORS regex with word-boundary matching

Agent improvements:
- System prompt trimmed from 25K to 13K chars (removed verbose examples, deduplicated tool refs)
- Enhanced list_indexed_documents with per-doc chunks, sizes, types
- Enhanced rag_status with total index size and document type breakdown
- Better index_document messages (skip/cache/re-index/new)
- Improved read_file error with parent dir context and search_file suggestion
- Friendlier error messages from GAIA's perspective (not technical stack traces)

Test infrastructure:
- Comprehensive 56-case conversational test plan (tests/agent_ui_test_plan.md)
- Test fixture files: CSVs, YAML, Python, empty file for data analysis tests

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Cursor consolidation:
- ThinkingIndicator in message header types/erases "Thinking..." next to GAIA name
- Cursor only renders when ThinkingIndicator is active (no dual cursor with FlowThought)
- RenderedContent cursor gated on !agentStepsActive (no overlap with thinking cursor)
- Removed dead cursorRef from FlowThought, renamed wasActiveRef2

Message transition fix:
- Skip rendering static DB message during streamEnding phase (return null)
- Removed stream-ending fade/blur/translate animation (caused visible flash)
- Streaming bubble stays in place until unmounted, static message takes over seamlessly

Thinking panel:
- Auto-collapse immediately when thinking completes (no 300ms delay)
- Removed red border from active summary bar
- Removed erase animation from FlowThought (was invisible due to collapse)
- start_progress emits status type instead of thinking (prevents cursors on status lines)

CSS cleanup:
- Consolidated .thinking-dots animation to single global rule in index.css
- Removed duplicate rules from AgentActivity.css and MessageBubble.css
- Removed dead .flow-thought-spinner CSS and reduced-motion override
- Removed dead .loading-message, .thinking-display, .thinking-cursor CSS
- Slower dot animation: 2.4s cycle with ease-in-out for relaxed pulse

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Remove orphaned .msg-entering CSS class (no longer referenced after transition fix)
- Use var(--text-muted) for thinking indicator color (was hardcoded white, invisible in light theme)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The default model was changed from Qwen3-Coder-30B-A3B-Instruct-GGUF
to Qwen3.5-35B-A3B-GGUF in database.py but the test wasn't updated.
@github-actions github-actions Bot added llm LLM backend changes tests Test changes labels Mar 19, 2026
kovtcharov and others added 2 commits March 18, 2026 23:32
The implementation was changed to emit {"type": "status", "message": ...}
instead of {"type": "thinking", "content": ...} but tests weren't updated.
- AgentActivity panel always starts collapsed (thinking text in header instead)
- Summary bar uses stable step count label (no THINKING → 1 STEP text swap)
- Consistent Zap icon always (no spinner → icon swap on transition)
- Removed active/done CSS differences (no padding/font/border/margin changes)
- Immediate auto-collapse when thinking completes (no 300ms delay)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@kovtcharov
kovtcharov added this pull request to the merge queue Mar 19, 2026
@kovtcharov
kovtcharov removed this pull request from the merge queue due to a manual request Mar 19, 2026
@kovtcharov
kovtcharov added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit 25c6d25 Mar 19, 2026
37 checks passed
@kovtcharov
kovtcharov deleted the kalin/fix-agent-ui-docs branch March 19, 2026 15:24
itomek added a commit that referenced this pull request Mar 23, 2026
PR #566 squash-merged a stale branch that had resolved merge conflicts by
keeping older file versions, reverting 3 previously-merged PRs from main:
- PR #564: TOCTOU upload locking security fix
- PR #565: Tool execution guardrails with confirmation popup
- PR #568: Agent UI overhaul (CSS design system, animations, UX polish)

Follow-up PRs #593/#604/#605 partially restored functionality. This PR
restores all remaining missing changes while preserving those follow-ups.

Changes:
- 24 files: clean restore from pre-revert commit (CSS, components, utils)
- Security: restore per-file asyncio.Lock upload guard (dependencies.py,
  documents.py, server.py)
- SSE handler: restore <think> block state machine, UUID-scoped confirms,
  timeout parameter, friendly error messages
- Frontend: restore AnimatedPresence, session hash badge, smooth streaming
  exit, custom model override UI, terminal typing animation, inference stats
- Backend: restore custom_model DB override, Lemonade stats fetching,
  friendlier user-facing error messages
- Tests: 497 passing, TypeScript build clean (1845 modules)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
itomek added a commit that referenced this pull request Mar 23, 2026
PR #566 squash-merged a stale branch that had resolved merge conflicts by
keeping older file versions, reverting 3 previously-merged PRs from main:
- PR #564: TOCTOU upload locking security fix
- PR #565: Tool execution guardrails with confirmation popup
- PR #568: Agent UI overhaul (CSS design system, animations, UX polish)

Follow-up PRs #593/#604/#605 partially restored functionality. This PR
restores all remaining missing changes while preserving those follow-ups.

Changes:
- 24 files: clean restore from pre-revert commit (CSS, components, utils)
- Security: restore per-file asyncio.Lock upload guard (dependencies.py,
  documents.py, server.py)
- SSE handler: restore <think> block state machine, UUID-scoped confirms,
  timeout parameter, friendly error messages
- Frontend: restore AnimatedPresence, session hash badge, smooth streaming
  exit, custom model override UI, terminal typing animation, inference stats
- Backend: restore custom_model DB override, Lemonade stats fetching,
  friendlier user-facing error messages
- Tests: 497 passing, TypeScript build clean (1845 modules)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 23, 2026
… (#608)

## Summary

PR #566 was accidentally merged with stale conflict resolutions that
reverted 3 previously-merged PRs. Follow-up PRs #593/#604/#605 partially
restored functionality. This PR restores all remaining missing changes.

**Root cause:** During a `git merge origin/main` into the branch (commit
`f07b932`), conflict resolution kept the branch's older file versions,
discarding work from 3 PRs. The squash merge then propagated this to
main.

**Reverted PRs restored by this PR:**
- **#564** — TOCTOU race condition fix: per-file `asyncio.Lock` for
document uploads (`dependencies.py`, `routers/documents.py`,
`server.py`)
- **#565** — Tool execution guardrails: `<think>` block state machine,
UUID-scoped confirms, inference stats, custom model override, friendly
error messages (`sse_handler.py`, `_chat_helpers.py`, `models.py`)
- **#568** — Agent UI overhaul: CSS design system (glassmorphism,
animations), AnimatedPresence, session hash badge, smooth streaming
exit, terminal typing animation, custom model override UI,
`appendThinkingContent`, `format.ts` utilities (`App.tsx`,
`ChatView.tsx`, `AgentActivity.tsx`, `SettingsModal.tsx/css`,
`WelcomeScreen.tsx/css`, `Sidebar.tsx/css`, `MessageBubble.tsx/css`,
`chatStore.ts`, 12 other CSS files, `shell_tools.py`, `database.py`)

**Preserved follow-up PR additions:**
- #593: Device support banners, processor name display, Lemonade hints
- #604: `permission_request` events, `confirmTool` API, `fileList`
pass-through, PermissionPrompt
- #605: RAG indexing guards

## Test plan

- [x] `python -m pytest tests/unit/chat/ui/ --tb=short` — 497 passed
- [x] `python util/lint.py --black --isort` — all checks pass
- [x] `npm run build` in `src/gaia/apps/webui/` — 1,845 modules, no
TypeScript errors
- [ ] Smoke test: `gaia chat --ui` — verify UI loads, settings modal
shows custom model override, welcome screen has typing animation, chat
streams correctly
- [ ] Verify concurrent document uploads use per-file locking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 25, 2026
…607)

## Summary

### Eval Benchmark Framework
- **New `gaia eval agent` CLI command** — runs multi-turn Agent UI
benchmark scenarios via `claude -p` subprocess with MCP tool access
- **Eval framework** (`src/gaia/eval/`) — `AgentEvalRunner`,
`scorecard.py` (weighted scoring across 7 dimensions: correctness, tool
selection, context retention, completeness, efficiency, personality,
error recovery), `audit.py` (deterministic architecture checks)
- **Eval corpus** (`eval/corpus/`) — 12+ documents covering reports,
CSVs, HTML, Python code, and adversarial edge cases; 34 YAML scenarios
across RAG quality, tool selection, context retention, and real-world
categories
- **Score clamping** — eval runner clamps dimension scores to [0, 10] to
prevent hallucinating eval agents from inflating/deflating weighted
scores
- **Hardened runner** — graceful manifest error handling, authoritative
`scenario_id` injection, empty `ground_truth` validation, non-dict JSON
guard, `ERRORED` status tracking, UTC timestamps on run IDs

### Agent UI Improvements
- **Redesigned Settings modal** — system status dashboard with
model/context/GPU/disk/memory rows, Model Override UI with
save/clear/warning flow, model status pills (found/downloaded/loaded)
- **Load/Download model actions** — new `/api/system/load-model` and
`/api/system/download-model` backend endpoints (non-blocking async);
ConnectionBanner "Load Now" and "Download" buttons replace Lemonade UI
links
- **Terminal-style animations** — typewriter welcome text with pixelated
red cursor, glassmorphism styling, AnimatedPresence modal transitions,
session fingerprint colors
- **Thinking display** — `<think>` block state machine in SSE handler
routes reasoning to thinking events; single cursor, no flash, smoother
animations
- **Streaming cleanup** — improved `_TOOL_CALL_JSON_RE` regex (DOTALL,
handles thought+goal+tool+tool_args prefix), `_json_filtered` flag for
artifact suppression, combined cleaners in `print_final_answer`
- **Performance stats** — hover to see token counts, timing, and
Lemonade metrics per message
- **Pre-load heavy modules** at server startup for faster first-response
latency

### Agent Reasoning Fixes
- **Auto-index path re-match bug** — `query_specific_file` auto-indexing
used absolute path for `index_document()` but relative path for
re-match, causing silent fallthrough to error; fixed by including
`resolved` (absolute) path in match check
- **RAG-first system prompt** — Smart Discovery rules, Context-Check
rules, DATA ANALYSIS section, anti-re-index guard, response length
calibration
- **Model upgrade** — default model updated to `Qwen3.5-35B-A3B-GGUF`
across `lemonade_client.py` MODELS registry, all agent profiles,
database schema, and CLAUDE.md
- **Wrong model detection** — ConnectionBanner warns when unexpected
model is loaded or context window is too small

### Security & Reliability
- **Shell command guardrails** — `DANGEROUS_SHELL_OPERATORS` regex,
PowerShell blocked flags, whitelist for system info commands
- **Security path restrictions** — `allowed_paths` enforcement in RAG
auto-indexing
- **Restored reverted PRs** — changes from PRs #564, #565, #568 that
were accidentally reverted by PR #566

### Electron Packaging
- **Electron forge config** — asar packaging, ignore list for source/dev
files, English-only locales, proper semver conversion

## Test plan

- [x] `gaia eval agent` — runs all scenarios and prints scorecard (34/34
PASS confirmed)
- [x] `gaia eval agent --scenario simple_factual_rag` — single scenario
filtering
- [x] `gaia eval agent --category rag_quality` — category filtering
- [x] `gaia eval agent --audit` — deterministic architecture checks
- [x] `python -m pytest tests/test_eval.py -xvs` — 95 eval tests pass
- [x] `python -m pytest tests/unit/ -xvs` — unit tests pass
- [x] All 37 CI checks pass (Code Quality, Unit Tests, Security, MCP,
RAG, CLI, Electron builds)
- [x] `gaia chat --ui` end-to-end regression check
- [x] ConnectionBanner "Load Now" / "Download" buttons trigger model
actions
- [x] Settings modal Model Override save/clear flow

---------

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: Tomasz Iniewicz <[email protected]>
@itomek itomek mentioned this pull request Mar 27, 2026
4 tasks
github-merge-queue Bot pushed a commit that referenced this pull request Mar 27, 2026
## Summary

Release v0.17.0 — **GAIA Agent UI**, eval benchmark framework, tool
execution guardrails, system prompt optimization, and security
hardening.

### Files Changed
- **`docs/releases/v0.17.0.mdx`** — Comprehensive release notes (new
file)
- **`docs/docs.json`** — Added `releases/v0.17.0` to Releases tab,
updated navbar to `v0.17.0 · Lemonade 10.0.0`
- **`src/gaia/version.py`** — Already at `0.17.0` on main (no change
needed)

### Release Highlights

**New Features:**
- **GAIA Agent UI** — Full-stack privacy-first desktop chat with
streaming responses, 53+ format document Q&A, ngrok tunnel for mobile,
page-level citations, session management (PR #428)
- **Agent UI Eval Framework** — `gaia eval agent` command with
7-dimension weighted scoring across 34 scenarios, redesigned Settings
modal, `<think>` block display, performance stats (PR #607)
- **Tool Execution Guardrails** — Blocking confirmation popup
(Allow/Deny/Always Allow) before write/shell tools, 60s timeout (PR
#565, #604)
- **Device Support Detection** — AMD Ryzen AI Max + Radeon ≥24GB
detection, `--base-url` remote bypass, `GAIA_SKIP_DEVICE_CHECK` override
(PR #593)
- **Terminal UI Design** — Typewriter welcome page, pixelated AMD
cursor, glassmorphism, `prefers-reduced-motion` support (PR #568)

**Performance:**
- **78% System Prompt Reduction** — 17,600 → 3,853 tokens via two-tier
RAG gating, 600s chat timeout, MCP runtime status display (PR #617)

**Security:**
- **TOCTOU Race Condition** — Atomic `O_NOFOLLOW` + `fstat` fix in
document upload, per-file `asyncio.Lock` (PR #564)

**Bug Fixes:**
- LRU eviction silent failure + new
`--max-indexed-files`/`--max-total-chunks` CLI flags (PR #567)
- Lemonade v10 device key renames: `npu` → `amd_npu`, `gpu` →
`amd_igpu`/`amd_dgpu` (PR #548)
- Agent UI rendering, Windows paths, JSON safety regex, RAG indexing
guards (PR #566, #604, #605)
- Restored accidentally reverted changes from PRs #564, #565, #568 (PR
#608)

### Post-Merge
After merging, tag and push:
```bash
git checkout main && git pull
git tag v0.17.0 && git push origin v0.17.0
```
CI runs `validate-release` → `publish-release`. PyPI gated on Kalin
approval.

## Test plan
- [ ] `docs.json` is valid JSON and renders on Mintlify
- [ ] `validate_release_notes.py` passes for v0.17.0
- [ ] `version.py` reads `0.17.0`
- [ ] Release notes content matches actual PR changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes electron Electron app changes eval Evaluation framework changes llm LLM backend changes performance Performance-critical changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants