refactor(editor): share the repeated viewer and contribution helpers - #1327
Open
bobzhang wants to merge 1 commit into
Open
refactor(editor): share the repeated viewer and contribution helpers#1327bobzhang wants to merge 1 commit into
bobzhang wants to merge 1 commit into
Conversation
Collaborator
Author
|
The two red Nightly core dropped Every stable gate passes: native, JS and wasm checks with |
This is the half that needs a careful read: these hunks add or remove something SHARED, so correctness depends on code outside the hunk you are looking at. What to check, hardest first: 1. **An extracted helper must be equivalent at every call site it replaced.** The trap is a call site that passed a different argument, or read state at a different moment, than its neighbours. 2. **A merged or-pattern arm must have had identical bodies.** 3. **A reshaped loop must keep its iteration order and its early exits.** The purely local rewrites these were mixed with have been split into a separate pull request, so everything left here is shared-surface change. Verified on this branch alone, with no other part of the refactor applied: `moon fmt --check`, the native and JS workspace checks with `--deny-warn`, both full test suites, and from `editor/` `moon check --target all --warn-list +73 --deny-warn` plus `moon test --target all`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JiBNGzCsZpN6e5Y4p9pXdn
bobzhang
force-pushed
the
simplify/structural-editor
branch
from
September 6, 2026 14:07
e184df6 to
02dc88c
Compare
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This half needs a careful read. Every hunk here adds or removes something
SHARED, so correctness depends on code outside the hunk you are looking at. The
purely in-function rewrites this was mixed with have moved to a separate pull
request, so what is left is all shared-surface change.
What to check, hardest first:
The trap is a call site that passed a different argument, or read state at a
different moment, than its neighbours.
differed and the difference moved inside the arm, the fold buys less than it
appears to.
Scope:
editor/. The largest pieces are the cursor-key registration pairs, the shared listener disposal sweep, the repeated Option ladders in the code editor widget, and the shared decode helpers in the remote protocol.Verified on this branch alone
moon fmt --check, the native and JS workspace checks with--deny-warn, bothfull test suites, and from
editor/moon check --target all --warn-list +73 --deny-warnplusmoon test --target all, with no other part of the refactorapplied. No
.mbtichanged.The refactor is split so each pull request asks one kind of question. Every file
appears in exactly one of them, each was verified on its own branch with no
other part applied, so they merge in any order.
desktop/editor/🤖 Generated with Claude Code
https://claude.ai/code/session_01JiBNGzCsZpN6e5Y4p9pXdn