Reviewed linked issue and PR details.
UnderstandAnalyzed code changes in PR.
UnderstandChecked for changelog entry.
UnderstandAdded changelog entry for fix.
EditMerged PR and updated main branch.
CleanupYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/pull/947
For each PR URL, do the following in order:
packages/*/CHANGELOG.md files. Report whether an entry exists. If missing, state that a changelog entry is required before merge and that you will add it if the user decides to merge. Follow the changelog format rules in AGENTS.md. Verify:
### Breaking Changes, ### Added, ### Fixed, etc.)Fixed foo ([#123](https://github.com/badlogic/pi-mono/pull/123) by [@user](https://github.com/user))### Breaking Changes, not just ### FixedOutput format per PR: PR: Changelog:
If no issues are found, say so under Bad and Ugly.
Let me read the linked issue #645 and the relevant code file:
Let me continue reading the rest of the file, specifically around line 1575-1580 where the change is:
Let me check if there's a changelog entry for this specific fix in the Unreleased section and also check the related code more closely:
Now let me check if the README.md or docs need updates for this fix:
Now I have enough context. Let me provide the review:
PR: https://github.com/badlogic/pi-mono/pull/947
### Fixed if user decides to merge.setEditorComponent() copied onExtensionShortcut from defaultEditor at creation time, capturing undefined because setupExtensionShortcuts() hadn't run yet.(data: string) => this.defaultEditor.onExtensionShortcut?.(data) ensures the call happens at runtime rather than copy time.?.) is appropriate since onExtensionShortcut may still be undefined and should just be a no-op in that case.registerShortcut() and setEditorComponent(), which would benefit from a test to prevent future regressions.onEscape, onCtrlD, and onPasteImage on lines 1573-1575. Those are set earlier in the initialization flow (via setupKeyHandlers() and setupEditorSubmitHandler() which run in init() before initExtensions()), so they are already defined when setEditorComponent() is called during session_start. However, if the order ever changes, similar bugs could appear. Worth considering whether those should also be delegated for consistency, though this is out of scope for this PR.this.defaultEditor.onExtensionShortcut to a closure that delegates to this.defaultEditor.onExtensionShortcut?.(data) at call time. This ensures that when a custom editor component calls onExtensionShortcut, it correctly invokes the handler that was set up later by setupExtensionShortcuts().registerShortcut() and setEditorComponent() in the session_start handler, then verify the shortcut fires correctly.merge via gh cli, pull from orogin
Now let me add the changelog entry for this fix: