Commit Graph

6 Commits

  • fix: render edit tool diffs in HTML export
    - Use result.details.diff from tool execution (same as TUI)
    - Apply proper color coding for added/removed/context lines
    - Remove unused generateDiff function
    - Match TUI's diff rendering approach
  • Make HTML export header minimal and stack info vertically
    **Header improvements:**
    - Changed title from "pi coding-agent session" to "pi v{version}"
    - Smaller, more compact header (16px instead of 20px)
    - Info items now stack vertically with consistent labels (80px width)
    - Reduced padding and spacing for cleaner look
    - Labels aligned to left, values aligned to baseline
    
    The header is now much less cramped and easier to read.
  • Add click-to-expand and system prompt display to HTML export
    **Click-to-expand functionality:**
    - Truncated tool outputs are now clickable to show full content
    - Works for bash (>5 lines), read (>10 lines), write (>10 lines)
    - Displays "... (N more lines) - click to expand" hint in cyan
    - Smooth toggle between preview and full output
    - Cursor changes to pointer on hover
    
    **System prompt and tools display:**
    - Added system prompt section with yellow header on dark brownish background
    - Shows all available tools with names and descriptions
    - Both sections appear before messages for context
    - Subtle yellow/brown theme (rgb(60, 55, 40)) that's not too bright
    
    The HTML export now provides better interactivity for large outputs and gives full context about the agent's configuration.
  • Rewrite HTML export to match TUI visual style exactly
    Complete overhaul of export-html.ts to replicate the TUI renderer's visual design:
    
    **Exact TUI color matching:**
    - User messages: rgb(52, 53, 65) dark slate background
    - Tool pending: rgb(40, 40, 50) dark blue-gray
    - Tool success: rgb(40, 50, 40) dark green
    - Tool error: rgb(60, 40, 40) dark red
    - Body background: rgb(24, 24, 30) very dark
    - Text colors matching chalk: cyan for paths, dimmed gray for output
    
    **Tool formatting (matching ToolExecutionComponent):**
    - bash: Bold `$ command`, dimmed output (max 5 lines)
    - write: Bold header with cyan path, line count, content preview (max 10 lines)
    - read: Bold header with cyan path, content preview (max 10 lines)
    - edit: Bold header with cyan path, unified diff with line numbers
    - All tools show "... (N more lines)" indicators
    
    **Additional improvements:**
    - Use session filename + .html for default output
    - Shorten paths with tilde notation (~)
    - Replace tabs with 3 spaces
    - Monospace font matching terminal aesthetic
    - Minimal, clean design with no borders/boxes
    - Print-friendly styles
    
    The HTML export now looks identical to the TUI version.
  • Add /export command to export sessions as self-contained HTML
    - Add exportSessionToHtml function that generates beautifully formatted HTML exports
    - HTML includes session metadata, all messages, tool calls, tool results, thinking blocks, and images
    - Support for ANSI color codes in tool output (converted to HTML)
    - Self-contained with inline CSS (dark theme, responsive design, print-friendly)
    - Add /export slash command to TUI with optional filename parameter
    - Add agent and coding-agent to dev script for watch mode
    - Increment coding-agent version to 0.6.1
    
    Usage: /export [optional-filename.html]