Skip to content

Display thinking content with custom styling#1

Closed
dnouri wants to merge 2 commits intomasterfrom
feat/thinking-display
Closed

Display thinking content with custom styling#1
dnouri wants to merge 2 commits intomasterfrom
feat/thinking-display

Conversation

@dnouri
Copy link
Owner

@dnouri dnouri commented Dec 30, 2025

  • Handle thinking_start, thinking_delta, thinking_end events
  • Use ```thinking markdown fence which becomes #+begin_src thinking
  • Add pi-thinking face (italic, comment color)
  • Add font-lock to apply face to thinking block content
  • Simple streaming approach: just insert markers at start/end, no replacement

Emacs frontend for the pi coding agent.

Features:
- Two-window interface: chat buffer (org-mode) + input buffer
- Markdown to org-mode conversion via pandoc with syntax highlighting
- Collapsible tool output with preview
- Streaming response display with auto-scroll
- Input history with search (M-p, M-n, C-r)
- Magit-style transient menu (C-c C-p)
- Model selection and thinking level control
- Session management: new, resume, branch, export
- Custom slash commands from ~/.pi/agent/commands/
- Multi-session support with full isolation

Requirements:
- Emacs 28.1+
- pi coding agent (npm install -g @anthropics/claude-code)
- pandoc for markdown rendering
- Handle thinking_start, thinking_delta, thinking_end events
- Use ```thinking markdown fence which becomes #+begin_src thinking
- Add pi-thinking face (italic, comment color)
- Add font-lock to apply face to thinking block content
- Simple streaming approach: just insert markers at start/end, no replacement
@dnouri dnouri closed this Dec 30, 2025
dnouri added a commit that referenced this pull request Jan 28, 2026
Uncle Bob review fixes:

Issue #1 & #2: Extract pi-coding-agent--prepare-and-send
- Single function handles display/tracking for all send paths
- Used by pi-coding-agent-send, follow-up queue, and custom commands
- Consistent behavior: slash commands never display locally

Issue #3: Add edge case test
- Test for when template expands to same text as command
- Documents expected behavior (skip display if identical)

Issue #4: Fix JSON boolean encoding
- Use :json-false instead of :false for json-encode
- :false encodes to string "false", :json-false encodes to boolean false
- Updated extension UI confirm handler

Issue #5: Improve test coverage
- Add assertion verifying expanded content is displayed
- Add test for different expanded content case
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