Skip to content

perf(refactor): consolidate getState calls in resolveWebviewView#11318

Closed
0xMink wants to merge 1 commit intoRooCodeInc:mainfrom
0xMink:perf/consolidate-getstate-resolvewebview
Closed

perf(refactor): consolidate getState calls in resolveWebviewView#11318
0xMink wants to merge 1 commit intoRooCodeInc:mainfrom
0xMink:perf/consolidate-getstate-resolvewebview

Conversation

@0xMink
Copy link

@0xMink 0xMink commented Feb 8, 2026

Summary

  • Consolidate three separate this.getState().then(...) calls into a single await this.getState() with destructuring in resolveWebviewView()
  • Eliminates two redundant executions of getState() which includes CloudService calls, ContextProxy reads, and other work
  • No behavioral change — same defaults, same setter calls, same values

Test plan

  • Existing ClineProvider.spec.ts tests pass (90/90, 6 skipped unchanged)
  • Verify terminal settings (shell integration timeout, command delay, zsh options) are applied correctly on webview load
  • Verify TTS enabled/speed settings are applied correctly on webview load

Important

Refactor resolveWebviewView in ClineProvider.ts to consolidate multiple getState calls into a single call, improving performance without changing behavior.

  • Refactor:
    • Consolidate three this.getState().then(...) calls into a single await this.getState() in resolveWebviewView() in ClineProvider.ts.
    • Use destructuring to extract state values, reducing redundant getState() executions.
  • Behavior:
    • No change in behavior; same defaults, setter calls, and values are maintained.
  • Testing:
    • Existing tests in ClineProvider.spec.ts pass (90/90, 6 skipped unchanged).

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

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 8, 2026
@roomote
Copy link
Contributor

roomote bot commented Feb 8, 2026

Rooviewer Clock   See task

Reviewed 5519dcd against the previous review at e69da98. The consolidation of three getState() calls into a single await this.getState() is correct -- all destructured defaults, setter calls, and values match the original behavior. No new issues found.

Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@0xMink 0xMink closed this Feb 8, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Feb 8, 2026
@0xMink 0xMink deleted the perf/consolidate-getstate-resolvewebview branch February 8, 2026 22:40
Replace three separate this.getState().then() calls with a single
await this.getState() and destructuring. This avoids running the
full getState() method (CloudService calls, ContextProxy reads, etc.)
three times during webview view resolution.
@0xMink 0xMink reopened this Feb 9, 2026
@github-project-automation github-project-automation bot moved this from Done to New in Roo Code Roadmap Feb 9, 2026
@roomote
Copy link
Contributor

roomote bot commented Feb 9, 2026

Rooviewer Clock   See task

No issues found. The consolidation of three getState() calls into a single await this.getState() is correct -- all destructured defaults, setter calls, and values match the original behavior. All 88 existing tests pass.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@0xMink 0xMink force-pushed the perf/consolidate-getstate-resolvewebview branch from e69da98 to 5519dcd Compare February 9, 2026 00:01
@0xMink 0xMink closed this Feb 9, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant