Skip to content

Neutral tool block face, italic headers#103

Merged
dnouri merged 3 commits intomasterfrom
refactor/tool-block-faces
Feb 7, 2026
Merged

Neutral tool block face, italic headers#103
dnouri merged 3 commits intomasterfrom
refactor/tool-block-faces

Conversation

@dnouri
Copy link
Owner

@dnouri dnouri commented Feb 7, 2026

Changes

Successful tool blocks no longer flash bright green (diff-added). They use a
neutral theme-derived blue tint — the same subtle background used during
execution. Error blocks keep their red diff-removed face.

Tool headers get split styling: the tool name ($, edit, read, …) is
bold italic, arguments are italic. Uses font-lock-face so faces survive
gfm-mode refontification.

Faces

Before After
tool-block-pending (blue tint) tool-block (blue tint)
tool-block-success (diff-added) (removed — uses tool-block)
tool-block-error (diff-removed) (unchanged)
tool-name (bold) tool-name (bold italic)
tool-command (plain) tool-command (italic)

Header styling

tool-header now returns a propertized string with split faces:

$ ls -la          →  [$=tool-name] [ls -la=tool-command]
edit foo.txt       →  [edit=tool-name] [foo.txt=tool-command]

Diff line overlays (+/- lines inside edit output) are unchanged.

Refs #97

Remove the diff-added green background from successful tool blocks.
Tool blocks now use a single neutral theme-derived background for both
pending and completed states. Only errors get the diff-removed red.

- Rename tool-block-pending -> tool-block (base face)
- Remove tool-block-success (was inheriting diff-added)
- Rename update-tool-pending-face -> update-tool-block-face
- Success now keeps the same neutral background as pending
Tool headers now use split face propertization for visual distinction:
- Tool name (edit, read, $) in bold+italic via pi-coding-agent-tool-name
- Arguments (path, command) in italic via pi-coding-agent-tool-command

Uses font-lock-face property so faces survive gfm-mode refontification.
Tests call font-lock-ensure to verify faces persist across font-lock cycles.
- Fix stale comment: 'pending-tool-block' -> 'tool-block'
- Remove history from tool-block docstring ('Used during execution
  and after successful completion' is not useful to readers)
- Rename tool-header-text -> tool-header (returns propertized string,
  not plain text)
- Consolidate two near-identical split-face tests into one that
  covers bash, read/write/edit, and unknown tool names
- Separate font-lock survival test into its own focused test
@dnouri dnouri merged commit de3237d into master Feb 7, 2026
7 checks passed
@dnouri dnouri deleted the refactor/tool-block-faces branch February 7, 2026 22:06
dnouri added a commit that referenced this pull request Feb 25, 2026
* refactor: Replace tool-block-pending/success with single tool-block face

Remove the diff-added green background from successful tool blocks.
Tool blocks now use a single neutral theme-derived background for both
pending and completed states. Only errors get the diff-removed red.

- Rename tool-block-pending -> tool-block (base face)
- Remove tool-block-success (was inheriting diff-added)
- Rename update-tool-pending-face -> update-tool-block-face
- Success now keeps the same neutral background as pending

* feat: Italic tool headers with bold+italic tool name

Tool headers now use split face propertization for visual distinction:
- Tool name (edit, read, $) in bold+italic via pi-coding-agent-tool-name
- Arguments (path, command) in italic via pi-coding-agent-tool-command

Uses font-lock-face property so faces survive gfm-mode refontification.
Tests call font-lock-ensure to verify faces persist across font-lock cycles.

* refactor: Clean up tool header naming, docs, and tests

- Fix stale comment: 'pending-tool-block' -> 'tool-block'
- Remove history from tool-block docstring ('Used during execution
  and after successful completion' is not useful to readers)
- Rename tool-header-text -> tool-header (returns propertized string,
  not plain text)
- Consolidate two near-identical split-face tests into one that
  covers bash, read/write/edit, and unknown tool names
- Separate font-lock survival test into its own focused test
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