Repository navigation
Show a to-do on the user where they land on it - #3880
Merged
Merged
Conversation
A user to-do now has a place on the page (its subject, or the page's head), so it gets the margin's On me mark named by its title, the location ring and the obligation view's arrival, and the queue walk's private to-do path goes. Standing on an open to-do is a stance: the panel's field reads "To-do · <title>" and the row's end offers Done. A to-do on a thread shows its title and Done at the top of the thread. Closes #3617 Closes #3618 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # dist/kernel/kernel.json # dist/kernel/leaf.js # dist/kernel/runtime/bundle-surfaces.js
leaf-agent
approved these changes
Oct 25, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 25, 2026
main's #3850 renamed `leaf task open` to `create` with `--title`, and `start` now takes its status line as `--text`, so the On Claude test creates its to-dos that way. main's #3880 test pressed Show on a folded On me card; it now opens the card first. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 25, 2026
The thread-head to-do test added in #3880 called `todos.cmd_open`, which #3850 had renamed to `cmd_create`. It failed during setup before exercising the title and Done control in [main CI](https://github.com/max-sixty/leaf/actions/runs/40161766827). Use the current creation API, as the adjacent thread-task test already does. The focused test fails with `AttributeError` before this change and passes afterward, including immediate removal of the to-do line while delivery is held. Product behavior is unchanged. Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 3, 2026
…lace on the page (#5223) Things Leaf couldn't place collected at the top. A to-do on the page as a whole stood at the page's first heading. In an `lf-text-document` bound to page data, the first data update took every comment off its lines, unchanged lines included, and their margin entries gathered at the document's top as one cluster. A comment on a line the document holds twice sat at the top from the start. Now what has a place keeps it, and what has none gets no pin: it lives in On me or Threads, as a general thread does. **Cause.** A comment in a text document anchors to a datum, here the whole document, and a datum with no identity is bound to its revision, so any update made each comment "Earlier data", which falls back to the whole widget. A quote inside a datum recorded no surrounding words, so a repeated line couldn't be told from its other copy and fell back to the datum too. `subjectPlace` sent a whole-page subject to `pageHead()`, the first heading (#3880). **Text documents** (`lf-text-document.js`, `anchor-resolution.js`, `passages.js`) - `lf-text-document` gives its reading an identity, its key, so a comment follows its words across source replacements. Unchanged lines stay marked and their entries stay beside them. - A quote inside a datum captures a prefix and suffix from the datum's own words (`fencedAt`), and detaches where those can't tell it from another copy, as a quote of authored text does. - A quote captured with datum words around it names a passage in the datum. Once a replacement takes its words, it resolves nowhere, and its thread reads as page-level with no pin. A quote that was all of its datum's words still falls back to the datum, as a row's changed label does. `projection/data.js` and `events.md` state the rule. **Page to-dos** (`obligations/place.js`, `queue-walk.js`, `current-target.js`, `floating-panel.js`) - `subjectPlace` gives the page as a whole no place, and `pageHead` goes. A page to-do has no margin entry or ring; On me lists it under "The whole page", after placed items. - `m` arrives at it on its On me card (`showOnMe(obligation)`), and the page doesn't scroll. A user on an On me card is on the item that card shows (`ON_CARD` in `currentLocationOrigin` and `currentLocationStop`), so the walk steps on from it and `x` ends it there. On a card, `x` ends that card's to-do even where another to-do shares its place; it used to end the first to-do there. **Left as it was.** Comments on `lf-diff` and `lf-call-diff` lines still go to "Earlier data" at the file header once the patch changes, since a diff line's key is its line number in one revision of the patch. Page to-dos come after placed items in On me, as general threads come after placed ones in Threads. The text document's caption counts as words around a quote, so a selection of a document's whole text is a passage and loses its pin when that text is replaced. **Test.** `test_a_text_document_keeps_comments_on_their_lines_across_updates` (Chromium and Firefox) comments on a line at a run's edge and on the second copy of a repeated line, prepends one line and then 200, then rewrites the first commented line, and checks that no entry stands at the document's top. It and the rewritten to-do tests in `navigation/test_on_panel.py` fail on main and pass here, and removing the null rule in `resolveAnchor` or the card branch in `doneTodo` fails them again. Tests that expected the old placements now expect the new: a page to-do on its card, and a page-level quote where they expected "Earlier data". `pnpm run test:runtime` and `pnpm run check:browser` pass. > _This was written by Claude Code on behalf of max-sixty_
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.
A to-do the agent opens on the user now shows its words where the user meets it. Its subject carries the margin's On me mark, named by the to-do's title. Wherever
m, Show, a click or Tab puts the user on it, the floating panel's empty field reads "To-do · <title>" and the row's end offers Done as a check, so a finger ends it there instead of going back into On me. A to-do on a thread shows its title and a Done at the top of the thread, in a margin or page card and in the panel's thread view. This is presentation A from the triage of #3617 and #3618, which Max picked.Closes #3617
Closes #3618
Supersedes #3620: its reproduction test is rewritten here to assert the fixed behavior.
How it works
The browser already received each user to-do as an obligation record (
source.kind: "todo").obligationPlacethrew away its place, so nothing on the page knew where it stood, and the queue walk carried its own path for to-dos (pageandwidgetstops, its own page head, its own rule for which to-doxends).obligations/place.jsnow places a to-do at its subject: the element or widget it names, or the page's head for a page to-do (subjectPlace). A to-do has a node and no source, since no element takes its answer. The page head is the firsth1, else the first heading, else the first block ofmain; the walk usedmainitself, which would have put the user "on" a page to-do anywhere on a page with no heading.obligationHolding, and arrival through the obligation view'sarriveAtRecord. The walk'spagestop and its to-do location rule are gone. One non-obligation stop remains,subject, for an update handed back to the user and for an On card's to-do, both arrived at where their subject stands.obligationsInstill counts only widgets' obligations: a to-do has no source, solf-tally,lf-tabsandwork.jscount what a region's widgets ask, asmodule-reading.mdalready says. The triage expected regions to count to-dos too; I left them out becausework.jsreads each member as a widget and a tally's "to answer" means a widget's answer.todoscope is now a stance (keyboard/touch-controls.js): itsxrow is the scope'sexit, which the panel's row offers at its end, and the scope's newsaysgives the field "To-do · <title>". An exit row can name itsicon; the to-do's is a check, and every other stance keeps its ✕. The exit seat has a fixed width, so a worded "Done" would have moved the counts. The scope now stands outside Draw and Design mode in the keyboard stack, so a mode entered while on a to-do keeps its own ✕ and words; nothing else bindsx.xand the row's Done end, and then on the second.obligationContextasks only widgets' obligations, so a to-do standing inside anlf-ask, open or ended, leaves the question's number keys working.queueActions.done, so the line goes in the turn it is pressed.Behavior changes beyond the to-do
obligationHoldingbreaks a tie between two obligations at one place in favor of the first the inventory lists (widgets' obligations come before to-dos), so a to-do on a widget never takes the widget's own question's ring and digits.#step, the user standing there was on nothing rather than on the open to-do of the section around it. The same now holds for a widget: inside an answered question within an open proposal,msteps off the proposal instead of arriving at it.z(align current item) inside a section with a to-do aligns the section, as it does inside anlf-ask.zand for the location ring when focus is on the subject itself.markerName), which is how the to-do's title reaches a screen reader. Widget markers, whose words are their subject's name, read as before.Tests
pnpm run test:runtime: 546 passed, andpnpm run check:browsermatches the committed bundles, including a newobligation-placecase for to-do placement, the page head, the widget tie and region membership.tests/browser/navigation/test_on_panel.py: test: reproduce hidden to-do text after On me navigation #3620's test, rewritten astest_a_todo_on_you_says_its_words_where_you_land_on_it(margin marks named by title, then the field words and row Done afterShift+mand after Show), andtest_a_finger_ends_a_todo_on_you_where_show_lands, which replaces the finger test whose docstring said the panel's row offers no step. The first also enters Draw mode on the to-do and checks the row offers the mode's exit.test_two_todos_on_one_element_are_one_stop_ended_in_turncovers the shared element; it fails with the stop dedupe removed. All pass, as do the other to-do, walk, tally and completed-obligation cases in the file.tests/browser/threads/test_agent_replies.py::test_a_thread_heads_with_the_task_it_holds_on_me: the thread's line and Done, gone before the server answers.tests/browser/margin/test_entries.pymarker label and selection cases pass.skills/leaf/references/conversation-loop.mdnow says where a to-do's press lands and what the user reads there, so the title must name the action on its own.