Skip to content

fix: recompute debug inline positions when editor mounts during active debug#684

Merged
thiagoralves merged 1 commit into
developmentfrom
fix/debug-inline-mount-timing
Mar 12, 2026
Merged

fix: recompute debug inline positions when editor mounts during active debug#684
thiagoralves merged 1 commit into
developmentfrom
fix/debug-inline-mount-timing

Conversation

@thiagoralves
Copy link
Copy Markdown
Contributor

@thiagoralves thiagoralves commented Mar 12, 2026

Summary

  • When an ST tab is opened after the debugger is already running, editorRef is null during the initial debugVarPositions memo computation
  • Since ref changes don't trigger re-renders, the memo never recomputes and no inline value badges appear
  • Adds an editorMounted state flag set in handleEditorDidMount so the position-scanning memo re-runs when the editor becomes available

Test plan

  • Start debugger, then open an ST/IL tab — verify green inline value badges appear
  • Verify badges still work when ST tab is already open before debugger starts

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved Monaco editor initialization handling to ensure proper state synchronization during component mounting, enhancing editor stability and responsiveness.

…e debug

When an ST tab is opened after the debugger is already running, editorRef
is null during the initial debugVarPositions memo computation. Since ref
changes don't trigger re-renders, the memo never recomputes and no badges
appear. Add an editorMounted state flag set in handleEditorDidMount so the
position-scanning memo re-runs when the editor becomes available.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thiagoralves thiagoralves merged commit 6e1daaf into development Mar 12, 2026
8 of 9 checks passed
@thiagoralves thiagoralves deleted the fix/debug-inline-mount-timing branch March 12, 2026 20:23
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 87d3bbda-678d-4fba-9e12-996057249e6c

📥 Commits

Reviewing files that changed from the base of the PR and between 4a9f400 and eea9b84.

📒 Files selected for processing (1)
  • src/renderer/components/_features/[workspace]/editor/monaco/index.tsx

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

This PR adds editor mount state tracking to the Monaco editor component. A new editorMounted boolean state is introduced and set to true in mount callbacks, then added as a dependency to the Phase 1 debug variable position calculation to ensure proper re-evaluation after the editor is mounted.

Changes

Cohort / File(s) Summary
Monaco Editor Mount Tracking
src/renderer/components/_features/[workspace]/editor/monaco/index.tsx
Introduces editorMounted state initialized on component mount callbacks and adds it as a dependency to the Phase 1 debug variable position calculation logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 The Monaco editor now knows when to awake,
Mount state tracked with every break,
Phases recalculate with perfect timing,
Variables positioned, logic chiming! ✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/debug-inline-mount-timing
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

thiagoralves pushed a commit that referenced this pull request Mar 30, 2026
…e debug

Cherry-pick of PR #684 (eea9b84) applied to both src_old/ and the
migrated src/frontend/ copy. When an ST tab is opened after the debugger
is already running, editorRef is null during the initial debugVarPositions
memo computation. Adds an editorMounted state flag set in
handleEditorDidMount so the position-scanning memo re-runs when the
editor becomes available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@thiagoralves thiagoralves mentioned this pull request Mar 31, 2026
9 tasks
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