Repository navigation
Description
Leaf's margin, the comment markers, pins and thread cards beside a page's text, is core code (browser/runtime/annotation-overlay/). Long term it could be a widget outside core that subscribes to the page's margin items and draws them. Any widget could then present those items in its own design, as popovers, a horizontal strip or anything else, and Leaf's rail would move to that form as one presentation among them.
What exists. #6161 (open) completes the public route a page widget uses to present annotations: data-annotations="page", placePageThreads, consumeAnnotations, threadSummary, anchorTo and watchAnnotationLayer. It ships lf-x-margin in the feature gallery as a sample that draws marks and cards through that route alone.
What stands between that and moving Leaf's margin.
- No registry declaration mounts a package's widget on every page.
- Core's margin code reads 231 names from 66 other core modules, of which a package can import 46 (counted on Let a page draw its own margin through the public interface, with lf-x-margin as the example #6161's branch). The rest, such as placing pins clear of words, folding clusters, keeping a card beside its marker and inside the window, and keeping layout work from growing with the page, would join the public interface or be rewritten in the widget. A bundled package imports only the public interface (
browser/AGENTS.md, "Runtime ownership"), which is why Move the annotation overlay into the kernel, and hold the default package to widget-api #2517 moved the margin's code back into core in October. - Only core's margin reads pointing at commented words, which previews their thread. Who reads it on a page that draws its own margin is still undecided.
This direction also makes #6121's placeMarginRail unnecessary, since a widget that presents margin items places them itself.
First step when this is taken up. Run the margin tests (tests/browser/margin/, tests/journeys/margin/) against lf-x-margin. Sort each by whether any presentation needs the behavior or only Leaf's rail design does, and split the failures into gaps in the public interface and work the widget hasn't done.
Waits until #6161 lands and the maintainer takes it up.
This was written by Claude Code on behalf of max-sixty
Activity