这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@K-Mistele
Copy link
Contributor

@K-Mistele K-Mistele commented Oct 16, 2025

What problem(s) was I solving?

Write tool calls in the Claude Code conversation stream would collapse their diff view immediately after approval, hiding the file changes from view. This was problematic because:

  1. Users lost visibility of what files were being created or modified once they approved the change
  2. The behavior was inconsistent with Edit tools, which remain expanded throughout their lifecycle
  3. With "dangerously bypass permissions" enabled, Write tool diffs would instantly collapse, making it impossible to review what was written

This issue was tracked as ENG-2275.

What user-facing changes did I ship?

  • Write tool calls now always show their diff view - The file changes remain visible regardless of approval status (pending, approved, or denied) and completion state
  • Removed the collapsed state entirely - The single-line "File created" or "File written" message no longer appears; the diff is always visible
  • Consistent behavior with Edit tools - All file modification tools now maintain their expanded state throughout execution

How I implemented it

The fix was a targeted change to the WriteToolCallContent component:

  1. Removed conditional display logic: Changed showDiff from being conditional on approvalStatus to always being true
  2. Deleted collapsed message UI: Removed the entire block that rendered the collapsed state message
  3. Cleaned up unused code:
    • Removed unused imports (formatToolResultPreview, detectToolError)
    • Removed unused variables (hasError, preview, showDiff)
    • Removed unused component parameters (isCompleted, toolResultContent, isFocused)
  4. Simplified JSX: Since the diff is always shown, removed the conditional wrapper around the DiffViewer

The implementation ensures the diff viewer is unconditionally rendered, providing permanent visibility of file changes.

How to verify it

Automated Testing

  • Type checking passes: make -C humanlayer-wui check
  • Linting passes: make -C humanlayer-wui lint
  • Unit tests pass: make -C humanlayer-wui test
  • Build succeeds: make -C humanlayer-wui build

Manual Testing

  1. Create a Claude Code session and have it write a file
  2. Verify the diff remains visible when:
    • Tool call is pending approval
    • After approving the tool call
    • After denying the tool call
    • During tool execution
    • After successful completion
  3. Enable "dangerously bypass permissions" mode
    • Verify Write tool diffs stay expanded (don't instantly collapse)
  4. Test keyboard navigation:
    • Press 'i' on a Write tool call to expand into modal view
  5. Test with large files:
    • Create a Write tool call with >1000 lines
    • Verify performance remains acceptable

Description for the changelog

Keep Write tool diffs always expanded in conversation stream - file changes now remain visible throughout the entire tool lifecycle instead of collapsing after approval

Previously, Write tool calls would collapse their diff view after approval,
hiding the file changes from view. This was inconsistent with Edit tools
which remain expanded throughout their lifecycle.

Now Write tool diffs remain permanently visible regardless of approval or
completion status, improving visibility of file changes and providing a
consistent experience across all file modification tools.

Fixes ENG-2275
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 9a94ed0 in 1 minute and 24 seconds. Click for details.
  • Reviewed 72 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/ConversationStream/EventContent/WriteToolCallContent.tsx:27
  • Draft comment:
    Removed conditional logic (hasError, preview, showDiff) that previously provided error messaging and controlled diff rendering. Confirm this change is intentional and doesn't remove needed user feedback.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is asking for confirmation of intention, which violates the rule "Do NOT ask the PR author to confirm their intention". The comment is not making a clear assertion that the change is wrong, just asking if it's intentional. If there was a real issue with error handling, the comment should state that directly. Maybe the removal of error handling actually does cause real user experience issues that should be fixed? Even if there are UX issues, the comment should state them directly rather than asking for confirmation. Also, without seeing the broader application context, we can't be certain this is actually problematic. The comment should be deleted because it violates the rule against asking for confirmation of intention and doesn't make a clear assertion about what needs to be fixed.
2. humanlayer-wui/src/components/internal/ConversationStream/EventContent/WriteToolCallContent.tsx:17
  • Draft comment:
    Unused props (isCompleted, toolResultContent, isFocused) were removed from the function parameters. Ensure the related type definitions and overall component contract are updated accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_XnfdZhXPMXqbPSxI

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@K-Mistele K-Mistele merged commit 7bfc92d into main Oct 16, 2025
7 checks passed
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.

3 participants