Skip to content

Draw a reply's widgets in its margin card - #3417

Merged
max-sixty merged 3 commits into
mainfrom
inline-interactive-replies
Oct 21, 2026
Merged

max-sixty merged 3 commits into
mainfrom
inline-interactive-replies

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

A reply carrying widget markup (an lf-ask, lf-options) keeps one live instance of its widgets (prepareAuthoredMessage), and only the primary reader, the floating panel by default, drew it. A margin card or another page drawing of the thread showed "Open interactive reply" in its place, a button that opened the same thread in the panel, and a route to a message (the On me walk to an ask, first unread, opening a rewrite) went to the panel alone, so the thread could stand twice: in its card without the question, and in the panel with it.

Now every drawing of a message may hold its widgets, and one does at a time (authoredHolders, messages.js): of the drawings shown, the primary reader's, then a margin card, then a seat on the page, the first among equals. A drawing takes them as it draws while shown, and after each draw the holder is settled again among the drawings shown, so one hidden in a fold or a closed card gives them to one in view; a card not yet placed waits for that settling. Whichever drawings gain or lose them draw again at once, so the one without them offers the way there instead. A message route goes to the primary where it holds the message's widgets, and otherwise where a thread route goes: the panel declines a thread about a passage and the page's drawing takes it, showing what it held back of the thread and landing on the message there; the panel takes it only where nothing on the page shows it, or where its thread view already shows the thread. The button now stands only where another drawing of the message holds its widgets, such as a seat beside an open card, or a card beside the panel's On list.

Behavior changes, with their tests: the shipped long thread's card draws its follow-up options in place (test_card_placement); a compact reader answers its native widget in place (test_compact_reader_draws_the_native_interactive_message); m from the page reaches an ask in a reply through the thread's margin card, with Escape stepping back to the passage and then putting the card away (test_obligation_walk); a widget's inline thread draws the message's options until the panel opens it (test_threads); a card draws its reply's widget where the panel used to (test_render_floating_panel); a seated thread draws its reply's widget in place, a summary's open fold its reply's markup, and a reply the panel folds away keeps its markup in the seat that shows it (test_summaries). The shipped long thread's card measures its whole height at 1436x1000, since it now draws the reply's options. The render gate's thread reading, which already described widgets rendering in the margin card, now finds them there.

This was written by Claude Code on behalf of max-sixty

A reply carrying widget markup (an `lf-ask`, `lf-options`) keeps one live
instance of its widgets (`prepareAuthoredMessage`), and only the primary
reader, the floating panel by default, drew it. A margin card or another
page drawing of the thread showed "Open interactive reply" in its place,
a button that opened the same thread in the panel, and a route to a
message (the On me walk to an ask, first unread, opening a rewrite) went
to the panel alone, so the thread could stand twice: in its card without
the question, and in the panel with it.

Now every drawing of a message may hold its widgets, and one does at a
time (`authoredHolders`, messages.js): the primary reader's, then a
margin card, then a seat on the page, the first among equals, until it
retires or its card closes, when the highest drawing still standing takes
them. A drawing that takes them has the one it displaced draw again, so
that one offers the way there instead. A message route goes to the
primary where it holds the message's widgets, and otherwise where a
thread route goes: the panel declines a thread about a passage and the
page's drawing takes it, showing what it held back of the thread and
landing on the message there; the panel takes it only where nothing on
the page shows it, or where its thread view already shows the thread.
The button now stands only where another drawing of the message holds
its widgets, such as a seat beside an open card, or a card beside the
panel's On list.

Behavior changes, with their tests: the shipped long thread's card draws
its follow-up options in place (`test_card_placement`); a compact
reader answers its native widget in place
(`test_compact_reader_draws_the_native_interactive_message`); `m` from
the page reaches an ask in a reply through the thread's margin card,
with Escape stepping back to the passage and then putting the card away
(`test_obligation_walk`); a widget's inline thread draws the message's
options until the panel opens it (`test_threads`); a card draws its
reply's widget where the panel used to (`test_render_floating_panel`);
a seated thread draws its reply's widget in place, and a summary's open
fold its reply's markup (`test_summaries`). The render gate's thread reading, which already
described widgets rendering in the margin card, now finds them there.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A hidden higher-ranked drawing can keep a reply's live widgets.

max-sixty and others added 2 commits October 20, 2026 21:27
The review on #3417 found that a higher-ranked drawing kept a reply's
widgets while hidden, as when the panel folds the reply under a summary
beside a seat that shows it, which then offered its button instead. A
drawing now takes the widgets as it draws only while shown (or as the
first to draw them), and after each draw the holder is settled again
among the drawings shown, so a hidden one gives them to one in view. A
drawing not yet placed, as a card before its owner places it, waits for
that settling.

`test_a_reply_folded_in_one_view_keeps_its_widget_in_view_in_another`
covers it and fails on the previous commit. The shipped long thread's
card test measures its whole height at 1436x1000, since the card now
draws the reply's options, which overran 900 by 15px on CI's fonts.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/kernel/kernel.json
@max-sixty
max-sixty merged commit 78ff9ce into main Oct 21, 2026
2 of 3 checks passed
@max-sixty
max-sixty deleted the inline-interactive-replies branch October 21, 2026 04:45
max-sixty added a commit that referenced this pull request Oct 21, 2026
…the widgets (#3436)

Since #3417, only one drawing of a reply holds its widgets (the panel
first, then a margin card, then a seat on the page, among the shown
ones), and every other drawing showed an "Open interactive reply" button
pointing at the holder. Whenever a non-holder is shown, the holder is
shown too, so the button only ever pointed at widgets already in view:
in practice a seated reply beside the panel's thread view of it. This
removes the button and its style, so a non-holding drawing shows the
reply's words alone.

`test_a_seated_reply_lends_its_widget_to_the_panel_and_takes_it_back`
opens a seated thread in the panel, checks the seat keeps only the words
while the panel holds the widget, and that Back returns the widget to
the seat.

Drawing the widgets in every drawing was tried and reverted on this
branch: the runtime and package widgets resolve a widget id to the first
element in the document (`elementById`, `document.getElementById`), so a
second copy breaks obligation standing, `m` walks, an option added
through "Another option", the panel's paint wait, `lf-board` columns and
anchors inside a reply. Making copies work needs id lookup scoped to the
drawing being asked about.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 21, 2026
#3417 lets a widget's inline thread hold and route to its own messages,
so the composer Send test's assertion that `surfaceFocusTarget(message)`
must be null no longer describes the intended behavior. This PR removes
that assertion while retaining the checks that Send lands on the visible
thread, the reply field is reachable, typing continues there, and the
sent event exists. It also removes the diagnostic re-export that the
deleted assertion alone used; the runtime's thread navigation still
imports the function from its owning module.

The focused unused-export test failed on the first commit and passes
after the repair. `pnpm run build:browser` and `pnpm run test:runtime`
pass. The composer Send cases passed in the first commit's CI run. No
runtime behavior changes.

---------

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants