Skip to content

Conversation

@chrarnoldus
Copy link
Contributor

@chrarnoldus chrarnoldus commented Jul 3, 2025

Kilo Code PR: Kilo-Org/kilocode#981

Related GitHub Issue

Contributes to #4784, not sure if it resolves it completely.

Description

When Roo edits a file the diff view steals focus from whatever had focus (probably the chat window text area). Specifying preserveFocus here prevents this from happening (in some cases at least). Since preserveFocus is specified in many places in the code base, here might be an oversight/regression.

Test Procedure

  • Open a new chat in Code mode.
  • Ask Roo to create a file.
  • Verify that the chat window's text area keeps focus while the edit is in progress.

Get in Touch

chrarnoldus on Discord, Christiaan on Kilo Code Slack


Important

Adds preserveFocus to showTextDocument in DiffViewProvider.ts to maintain focus during diff editor opening, with corresponding tests in DiffViewProvider.spec.ts.

  • Behavior:
    • Adds preserveFocus: true to showTextDocument in DiffViewProvider.ts to prevent focus loss when opening diff editor.
    • Updates test in DiffViewProvider.spec.ts to check for preserveFocus option in showTextDocument call.
  • Tests:
    • Verifies showTextDocument is called with preserveFocus: true in DiffViewProvider.spec.ts.
    • Ensures executeCommand follows showTextDocument in DiffViewProvider.spec.ts.
    • Tests handling of showTextDocument failure in DiffViewProvider.spec.ts.

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

@chrarnoldus chrarnoldus requested review from cte, jr and mrubens as code owners July 3, 2025 17:46
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. UI/UX UI/UX related or focused labels Jul 3, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 3, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jul 3, 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 Jul 3, 2025
@daniel-lxs
Copy link
Member

daniel-lxs commented Jul 4, 2025

Thank you @chrarnoldus!

It seems that #5349 already addressed these fixes.

@daniel-lxs daniel-lxs closed this Jul 4, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Jul 4, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 4, 2025
@chrarnoldus chrarnoldus deleted the christiaan/preservefocus branch July 23, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR - Needs Preliminary Review size:S This PR changes 10-29 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants