Skip to content

Editors whose tab was not active on first render never landed in edit… - #603

Open
GabrielMalava wants to merge 10 commits into
TabularisDB:mainfrom
GabrielMalava:fix(editor)register
Open

Editors whose tab was not active on first render never landed in edit…#603
GabrielMalava wants to merge 10 commits into
TabularisDB:mainfrom
GabrielMalava:fix(editor)register

Conversation

@GabrielMalava

Copy link
Copy Markdown
Contributor

…orsRef, so Run fell back to executing the entire script instead of the statement under the cursor.

GabrielMalava and others added 3 commits August 5, 2026 08:49
…orsRef, so Run fell back to executing the entire script instead of the statement under the cursor.
@kilo-code-bot

kilo-code-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src/pages/Editor.tsx

Reviewed by step-3.7-flash · Input: 90.2K · Output: 27.4K · Cached: 1.1M

@debba

debba commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

I reviewed this locally and the fix looks correct.

The root cause checks out: @monaco-editor/react keeps the onMount callback provided when the editor first mounts, so editors belonging to initially inactive tabs never get registered in editorsRef. Passing onMount to every editor fixes that, and the active-tab guard correctly prevents background editors from stealing focus. The safer fallback for multi-statement scripts is also a good improvement.

Local verification passed:

  • TypeScript typecheck
  • ESLint for src/pages/Editor.tsx
  • Full Vitest suite: 220 files and 3,707 tests passed

My only non-blocking note is that the PR does not add a regression test for the exact flow it fixes: a tab that is inactive on initial render, then becomes active, followed by Run executing the statement under the cursor. Adding coverage for that interaction would make the fix safer against future regressions.

Looks good to merge from my side.

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.

2 participants