Repository navigation
fix(wework): refresh environment diff stats - #1933
Merged
Merged
Conversation
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughEnvironment info loading now supports forced cache bypasses, refreshes periodically during runtime tasks and after completion, and is validated through unit, layout, and desktop E2E tests. English and Chinese documentation describe the refresh behavior. ChangesEnvironment refresh behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RuntimeTask
participant Workbench
participant EnvironmentLoader
participant WorkspaceGit
RuntimeTask->>Workbench: Start or finish task
Workbench->>EnvironmentLoader: Request forced environment refresh
EnvironmentLoader->>WorkspaceGit: Read current Git state
WorkspaceGit-->>EnvironmentLoader: Return change statistics
EnvironmentLoader-->>Workbench: Update environment info
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
qdaxb
marked this pull request as ready for review
July 13, 2026 14:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
Environment info was reloaded only when the workspace target changed or when a closed floating panel was reopened. A docked panel therefore kept the initial diff statistics throughout task execution. Explicit refreshes could also reuse the 1.5-second environment cache and return the same stale values.
Impact
The change count now updates every five seconds without a loading flicker while an agent is working, refreshes once more when the task becomes idle, and always performs a fresh Git read when the user explicitly refreshes the panel.
Validation
pnpm --filter wework exec vitest run src/api/environment.test.ts src/components/layout/DesktopWorkbenchLayout.test.tsx(159 tests passed)pnpm --filter wework typecheckpnpm --filter wework e2e:desktopusing an isolated real Tauri app, Executor, and Codex tool execution; asserted Environment info changed from+0/-0to+1/-0Summary by CodeRabbit
Improvements
Documentation