docs/plans/2026-04-11-slate-v2-semantic-islands-active-corridor-adaptive-occlusion-plan.md
Read the full docs/slate-v2 corpus and synthesize one concrete plan for:
The plan must follow current roadmap truth instead of drifting back toward:
I read all 36 files currently under docs/slate-v2.
The highest-signal sources for this plan were:
The docs and current perf evidence point to one clear conclusion:
The same-turn rerender-breadth lane backs that read:
#5131: only useSlate() is broad, by contract#3656: sibling-leaf rerender breadth is green#4141: ancestor-chain rerender breadth is greenSo another generic rerender cleanup pass would be cargo cult.
The first production attempt at this layer was rejected and reverted.
What was tried:
EditableBlockscontent-visibility / intrinsic-size occlusion on inactive groupsWhy it was rejected:
10000 blocksHard rule for the next implementation attempt:
Ctrl+A / paste must not fall back into a synchronous full-tree modeFrom chunking-review.md:
Implication:
getChunkSize()-style public control as the main designFrom architecture-contract.md:
slate-react remains selector-firstImplication:
From both architecture-contract.md and chunking-review.md:
Pretext or any deterministic planner is only for inactive islandsImplication:
<Activity> is allowed, but not as an active-surface crutchFrom architecture-contract.md:
<Activity> is first-class for hidden/background UIImplication:
<Activity> only for inactive editors, side panes, inspectors, or
background-prepared surfacesActivityFrom chunking-review.md:
content-visibility: autocontain-intrinsic-sizeImplication:
From chunking-review.md:
Implication:
Goal:
Keep and use:
pnpm bench:replacement:huge-document:localpnpm bench:replacement:huge-document:chunking:compare:localpnpm bench:react:rerender-breadth:localAdd one more kept lane before heavy implementation:
pnpm bench:replacement:huge-document:islands:localThat new lane should compare:
At minimum on:
1000500010000Primary metrics:
Secondary metrics:
Goal:
Design:
Do not start with:
Why:
Likely files:
/Users/zbeyens/git/slate-v2/packages/slate-react/src/components/editable-text-blocks.tsx/Users/zbeyens/git/slate-v2/packages/slate-react/src/large-document/create-island-plan.tsclassify-island-kind.tsisland-types.tsImplementation rules:
Goal:
Corridor inputs:
Corridor contents:
Recommended starting posture:
2 sibling islands before2 sibling islands after1 sibling island on each sideDo not expose these numbers publicly yet. They are runtime tuning knobs, not user-facing API.
Likely files:
packages/slate-react/src/large-document/create-corridor-plan.tspackages/slate-react/src/large-document/use-active-corridor.tseditable-text-blocks.tsxCritical rule:
Goal:
Default outside-corridor posture:
content-visibility: autocontain-intrinsic-sizeRecommended three-state model:
active
near
far
This is better than a binary active/inactive split because it avoids flapping when the user moves locally through a large doc.
Likely files:
packages/slate-react/src/large-document/island-shell.tsxpackages/slate-react/src/large-document/get-island-visibility-state.tspackages/slate-react/src/large-document/island-style.tsGoal:
Allowed uses:
Not allowed:
If this layer lands, keep it explicitly optional and isolated behind internal helpers. The docs are too clear on this point to ignore.
Goal:
19 where it actually helpsUse <Activity> for:
Do not use it for:
This should be a separate follow-up batch unless the implementation naturally needs a small internal hook boundary for it.
pnpm bench:react:rerender-breadth:local
pnpm bench:replacement:huge-document:local
1000-block gate must stay greenpnpm bench:replacement:huge-document:chunking:compare:local
5000 and 10000 typing must improve materiallypnpm turbo build --filter=./packages/slate-reactpnpm turbo typecheck --filter=./packages/slate-reactpnpm --filter slate-react testpnpm lint:fixMinimum bar for keeping the large-document layer:
5000 typing improves materially over current default10000 typing improves materially over current default1000 gate does not regress into red#3656 and #4141 breadth do not regressslate-react runtime testsRecommended “actually worth it” bar:
5000 ready no longer loses to chunking5000 typing gap to chunking shrinks substantially10000 typing gap shrinks enough that the next remaining bill is clearly
view/paint, not invalidation chaosRisk:
Mitigation:
Risk:
contain-intrinsic-size guesses can destabilize scroll anchorMitigation:
Risk:
Mitigation:
Risk:
Mitigation:
If the new huge-doc lane still loses badly after semantic islands + corridor + occlusion, then:
If the lane improves enough, then:
<Activity> as a separate hidden/background surface improvementDo not build a giant “large document framework.”
Build the smallest internal slate-react layer that does this:
That is the most complete plan the corpus supports without drifting back into legacy chunking or forward into premature virtualization.