Skip to content

fix(wework): show actual file edit durations - #2059

Merged
qdaxb merged 1 commit into
mainfrom
fix/wework-file-edit-duration
Jul 20, 2026
Merged

qdaxb merged 1 commit into
mainfrom
fix/wework-file-edit-duration

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • match each file in the completed file-change summary to its corresponding edit tool call
  • show the real per-file duration from tool creation through streamed completion instead of the near-zero summary creation time
  • aggregate repeated edits of the same file from the first edit start through the final edit completion
  • document the duration behavior in the Chinese and English turn-file-change guides

Root cause

The rows shown in the conversation come from a file_changes summary block created at the end of the turn. The UI used that summary block's timestamps, so completed edits were typically displayed as 0.0s even when the edit tool had streamed for much longer.

Validation

  • pnpm --filter wework test — 180 files, 1820 tests passed
  • pnpm --filter wework typecheck
  • focused ToolBlocksDisplay and ToolBlockItem tests — 63 passed
  • ESLint, Prettier, typography, and all pre-push checks passed
  • isolated real-Tauri verification covered project creation and a live local task; screenshots were reviewed for the ready and running states

The isolated account selected a Kimi model without an edit/apply-patch tool, so that real task could not generate the completed file-edit state. The deterministic component regression covers two completed file edits with distinct 4.3s and 6.8s durations and verifies that 0.0s is absent.

Summary by CodeRabbit

  • New Features

    • File change summaries now display the actual editing duration for each file.
    • Durations account for multiple edits and streamed execution time, providing more accurate timing details.
  • Documentation

    • Updated English and Chinese user guides to explain how per-file editing durations are calculated.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fae6e4ab-8af4-47f9-9fe4-a72992f92ad3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Per-file edit durations are derived from matching completed edit tools, passed through tool and live preview rendering, and displayed for each changed file. English and Chinese documentation describe the timing boundaries, and tests verify distinct file durations.

Changes

Per-file edit duration display

Layer / File(s) Summary
Duration data and rendering
wework/src/components/chat/blocks/ToolBlockItem.tsx
Adds the FileEditDuration contract and renders matched per-file durations, falling back to the shared block duration when unavailable.
Duration correlation and component wiring
wework/src/components/chat/blocks/ToolBlocksDisplay.tsx
Correlates completed edit tools with changed files using normalized paths and passes the resulting map through current and live preview rendering.
Documentation and validation
wework/src/components/chat/blocks/ToolBlocksDisplay.test.tsx, docs/en/user-guide/coding/turn-file-changes.md, docs/zh/user-guide/coding/turn-file-changes.md
Tests distinct durations for multiple files and documents how per-file edit time is measured.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ToolBlocksDisplay
  participant CompletedEditTools
  participant ToolBlockItem
  participant FileChangeRows
  ToolBlocksDisplay->>CompletedEditTools: collect completed file-edit inputs and timestamps
  ToolBlocksDisplay->>ToolBlockItem: pass the per-file duration map
  ToolBlockItem->>FileChangeRows: render each matched file duration
Loading

Possibly related PRs

  • wecode-ai/Wegent#2032: Updates related tool and file duration rendering in ToolBlocksDisplay and ToolBlockItem.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: displaying actual per-file edit durations in Wework.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wework-file-edit-duration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qdaxb
qdaxb marked this pull request as ready for review July 19, 2026 23:39
@qdaxb

qdaxb commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@qdaxb
qdaxb merged commit 6e6c4f7 into main Jul 20, 2026
30 checks passed
@qdaxb
qdaxb deleted the fix/wework-file-edit-duration branch July 20, 2026 03:09
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