-
-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Hi @simonw,
Thanks for this great tool! Actually, almost all of my code is generated by Claude these days. During my exchanges with Claude, relevant information often emerges that is very important for the projects. Until now, I had to laboriously copy and paste it into Markdown files. This tool is a huge help.
It would be great if the tool could automatically generate a transcript of the session right before auto-compacting starts. I’m often caught off guard by the auto-compacting while I’m right in the middle of working!
See: anthropics/claude-code#15923
Bug Description
The user_content macro in macros.html doesn't wrap content in a truncatable div, unlike other content types like tool_result, tool_use, write_tool, edit_tool, and bash_tool.
This causes long user messages (e.g., when a PDF document is included in the conversation) to display in full, making the page very long and hard to navigate.
Steps to Reproduce
- Convert a session that contains a long user message (e.g., a PDF document)
- The user message div has no "Show more" button and displays the entire content
Expected Behavior
Long user messages should be collapsed by default with a "Show more" button, consistent with how tool results and other content types behave.
Proposed Fix
In src/claude_code_transcripts/templates/macros.html, change the user_content macro from:
{% macro user_content(content_html) %}
<div class="user-content">{{ content_html|safe }}</div>
{%- endmacro %}
to:
{% macro user_content(content_html) %}
<div class="user-content"><div class="truncatable"><div class="truncatable-content">{{ content_html|safe }}</div><button class="expand-btn">Show more</button></div></div>
{%- endmacro %}
This matches the pattern used by tool_result and other macros.