Skip to content

Conversation

@f14XuanLv
Copy link
Contributor

@f14XuanLv f14XuanLv commented Aug 11, 2025

Related GitHub Issue

Closes: #6919

Roo Code Task Context (Optional)

N/A

Description

This PR fixes a UI state management issue where the context condensing indicator persists incorrectly when switching between tasks.

The fix adds setIsCondensing(false) to the task switching effect in ChatView.tsx, ensuring the condensing state is properly reset when users switch tasks. The change is minimal and focused - just one line of code with appropriate comments.

Test Procedure

  1. Open any task in Roo Code with sufficient context
  2. Click the context condensing button (fold icon)
  3. While condensing is in progress (showing "正在智能压缩上下文..."), switch to another task
  4. Verify the condensing indicator does NOT appear on the new task
  5. Confirm the fix by switching between multiple tasks during condensing operations

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - This is a state management fix with no visual UI changes, only behavioral correction.

Documentation Updates

  • No documentation updates are required.
  • Yes, documentation updates are required.

Additional Notes

  • Single line fix in webview-ui/src/components/chat/ChatView.tsx (line 440)
  • Added explanatory comment about not resetting sendingDisabled
  • Grouped with other UI state resets for code organization
  • This prevents user confusion when the condensing indicator appears on unrelated tasks

Get in Touch

N/A - Available via GitHub @f14XuanLv


Important

Fixes UI state issue in ChatView.tsx by resetting isCondensing when switching tasks to prevent indicator persistence.

  • Behavior:
    • Fixes UI state issue in ChatView.tsx by resetting isCondensing to false when switching tasks.
    • Ensures condensing indicator does not persist on new tasks after switching.
  • Code Changes:
    • Adds setIsCondensing(false) in the task switching useEffect in ChatView.tsx.
    • Includes a comment explaining why sendingDisabled is not reset.

This description was created by Ellipsis for 872bf4a. You can customize this summary. It will automatically update as commits are pushed.

Previously, when users initiated context condensing and switched to another task before completion, the 'condensing context' indicator would persist on the new task.

This fix ensures the condensing state is properly reset in the task switching effect, preventing the indicator from appearing incorrectly on different tasks.
@f14XuanLv f14XuanLv requested review from cte, jr and mrubens as code owners August 11, 2025 05:09
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Aug 11, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! This is a clean, targeted fix that properly addresses the bug described in issue #6919. The implementation is correct and follows the existing patterns in the codebase. I have one suggestion for improvement regarding test coverage.

setExpandedRows({})
everVisibleMessagesTsRef.current.clear() // Clear for new task
setCurrentFollowUpTs(null) // Clear follow-up answered state for new task
setIsCondensing(false) // Reset condensing state when switching tasks
Copy link
Contributor

Choose a reason for hiding this comment

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

Good fix! The placement here with other UI state resets is logical and maintains consistency. However, would you consider adding a test case to verify that is properly reset when switching tasks? This would help prevent regression of this bug in the future.

You could add a test in one of the existing ChatView test files that:

  1. Sets up a task with set to true
  2. Switches to a different task
  3. Verifies that is reset to false

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 11, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 13, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 13, 2025
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

Thank you @f14XuanLv for your contribution!

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Aug 14, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 14, 2025
@mrubens mrubens merged commit e5d93f2 into RooCodeInc:main Aug 14, 2025
28 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 14, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 14, 2025
fxcl added a commit to tameslabs/Roo-Cline that referenced this pull request Aug 16, 2025
* main: (70 commits)
  fix: use native Ollama API instead of OpenAI compatibility layer (RooCodeInc#7137)
  feat: add support for OpenAI gpt-5-chat-latest model (RooCodeInc#7058)
  Make enhance with task history default to true (RooCodeInc#7140)
  Bump cloud version to 0.16.0 (RooCodeInc#7135)
  Release: v1.51.0 (RooCodeInc#7130)
  Add an API for resuming tasks by ID (RooCodeInc#7122)
  Add support for task page event population (RooCodeInc#7117)
  fix: add type check before calling .match() on diffItem.content (RooCodeInc#6905) (RooCodeInc#6906)
  Fix: Enable save button for provider dropdown and checkbox changes (RooCodeInc#7113)
  fix: Use cline.cwd as primary source for workspace path in codebaseSearchTool (RooCodeInc#6902)
  Hotfix multiple folder workspace checkpoint (RooCodeInc#6903)
  fix: prevent XML entity decoding in diff tools (RooCodeInc#7107) (RooCodeInc#7108)
  Refactor task execution system: improve call stack management (RooCodeInc#7035)
  Changeset version bump (RooCodeInc#7104)
  feat(web): fill missing SEO-related values (RooCodeInc#7096)
  Update contributors list (RooCodeInc#6883)
  Release v3.25.15 (RooCodeInc#7103)
  fix: add /evals page to sitemap generation (RooCodeInc#7102)
  feat: implement sitemap generation in TypeScript and remove XML file (RooCodeInc#6206)
  fix: reset condensing state when switching tasks (RooCodeInc#6922)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Preliminary Review size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Bug: Context condensing indicator persists when switching tasks

4 participants