A tab body keys memos and effects off `scope` (the diff pane resolves its
media/html routes from it, the editor restores its preview scroll, the side
chat rebuilds its prose-rewrite cache), but the tab cell built
`{ sessionId, cwd }` fresh on every render. Every such dependency therefore
looked changed whenever the cell re-rendered — which the memo comparator
allows exactly when a COMPARED field moves: `expanded` on a directory toggle,
plus `revealed`, `localeRevision`, `tabsVersion`. The diff preview then
re-ran its whole-document rewrite and its content tab re-issued a whole-file
`fs.read`, flashing its loading row.
`useSessionScope` is now the one place a scope for a component tree is built;
the tab cell, the diff tab, the native tab adapter, and the shell's badge /
rightActions / `+` menu / lifecycle-callback seams all use it. Those last
ones are documented external plug-in surfaces, so a plug-in memoizing on
`scope` stops churning on every unrelated re-render too.
Stabilizing the object removes the only path the diff pane's `content` tab
had to re-read after the file changed on disk, so the header's refresh button
now drives it explicitly (the pane owns the gesture; the loader no longer
leaks its internal counter).
Seven comments asserted that the scope object's identity churns on every
render; that premise is gone, so the ones that still apply say what they
actually guard.
Markdown surfaces the plugin draws (editor preview, side-chat transcript,
changes reading pane, task note) now open local markdown links in the sidebar
and follow same-page / cross-file heading anchors.
The host renderer decides what a local destination even is: without a
`MarkdownDelegateProvider.openFile` a local link renders as plain text (there is
no `a[href]` to intercept), and `parseFileLink` accepts a fragment only in the
line grammar (`#L24`), so a heading fragment makes the whole destination
unparseable. So the claim is scoped by the provider (one per surface) and a
SOURCE pass carries a heading fragment past the parser as `%23` — the same shape
markdown-images.ts already uses for relative image destinations. Destinations
the plugin does not claim (non-markdown, remote, queried) keep rendering exactly
as they do today.
- `markdown-navigation.ts`: pure link judge + GitHub heading slugs (Chinese kept,
duplicates `-1`, authored ids reserved first), collapsed-anchor hiding, the
source rewrite, the jump that scrolls the surface's OWN scroller (never
`window`/`scrollIntoView`), and the session+path keyed pending fragment table.
- `use-markdown-surface.ts`: one hook per surface — the container callback ref
(DOM pass + mutation re-runs + pending fragment) and the delegate's `openFile`.