Repository navigation
Read a thread's word, name and id from one owner on every surface - #3075
Conversation
Threads, the margin, Page Map, Questions and the activity feed each assembled a thread's status word, name and id themselves, and three of them disagreed: - A thread an open to-do holds read To-do open or Working on its Threads card and Page Map row, and nothing in the margin. `margin-model.js` `threadMarks` now derives the margin item's and the Page Map row's line, turn and receipt from `threadAttention`, the reading Threads paints as its status, and `readingContext` lets one item say its own line. - A reply streaming read Replying in Threads and Working on the margin and Page Map control carrying it. `workflow.js` `progressFace` now owns the face, and the control says the receipt's own `workflowLabel`. - An untitled thread (after a failed title request, say) was named by its opening's Markdown source in Threads, Questions and the margin (a blank for a drawing), and by rendered, clipped words or "a drawing" in the activity feed; the margin never read the title at all. `messages.js` `threadName` is now the one name: the title, else the words the opening renders, else Drawing. `threadSummary(thread).topic` returns it to packages, and lf-activity reads it from the live thread, so `history.py` serves a row's thread by id alone. The copies that agreed but would drift move onto owners too: `drawnThreadId` reads the id a drawn thread carries, `threadNamed`/`threadIdNamed` index a publication's thread names once instead of rebuilding them per call, and `drafts.js` names a thread's reply and rewrite drafts (`replyContext`, `rewriteContext`, `threadDraft`) in place of prefixes spelled at each site. The question index in `skills/leaf/assets/AGENTS.md` gains a row for each. Two attributes still carry the id, `data-id` on a Threads card and `data-thread` elsewhere, because selectors in the runtime and the suite use the attribute to name the surface; `drawnThreadId`'s comment says so. Tests: margin-model, margin-workflow and thread-reading runtime cases, and a margin browser test, each fail on the old reading. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The widget to-do beside the page and a thread's attention each spelled Working and To-do open; `workflow.js` `todoLabel` now says it for both. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…kup once - A margin marker or disclosed reading for a thread now says its line (To-do open, Working) in its accessible name, as it does visibly (`margin-model.js` `spokenContext`); before, the name said only the user's turn or an unread count. - `openInlineThread` reads `threadNamed` instead of rebuilding the index, and anchor placement says why it keeps its own. - lf-activity says why a thread Threads does not list goes as "a thread". - The margin browser test now holds the name on Threads, Page Map and the activity feed, and a title replacing it on each. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…d the data flow The tab names each kind of record by layer (recorded in the page directory, folded by the server, combined in the browser, owned by one browser), draws how threads, messages, updates, workflows, asks and to-dos relate, and follows the data from the log to each surface. Its last table lists what every surface says about a thread and the one owner each reading has, pointing at the runtime's owner table. Also fixes margin-model.js's readingContext comment, which named `threadLine` for `threadMarks`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ow, Thread readings Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/AGENTS.md # skills/leaf/assets/runtime/annotation-inventory.js # skills/leaf/assets/runtime/annotation-overlay/margin-projection.js # skills/leaf/assets/runtime/composing/surface.js # skills/leaf/assets/runtime/drafts.js # skills/leaf/assets/runtime/queue-panel.js # skills/leaf/assets/runtime/queue-walk.js # skills/leaf/assets/runtime/thread/destination.js # skills/leaf/assets/runtime/thread/focus.js # skills/leaf/assets/runtime/thread/model.js # skills/leaf/assets/runtime/thread/page-comment.js # skills/leaf/assets/runtime/thread/placement.js # skills/leaf/assets/runtime/thread/replies.js # skills/leaf/assets/runtime/thread/selectors.js # skills/leaf/assets/runtime/thread/state.js # skills/leaf/assets/runtime/thread/thread-card.js # skills/leaf/assets/runtime/widget-api.js # skills/leaf/packages/default/widgets/lf-activity.js # skills/leaf/references/module-authoring.md
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Data flow moves to the Data tab, after Current state, and Thread readings to the Threads page, after Titles. The lists take the glossary's names, On me, On <agent> and Done, and the surfaces name the On panel and the floating panel. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…its thread Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/kernel/kernel.json
# Conflicts: # skills/leaf/kernel/kernel.json
leaf-agent
left a comment
There was a problem hiding this comment.
history.py now serves a history row's thread as {id}, but the registry remains at protocol 7. A page vendored before this change still runs its older lf-activity, whose topicOf reads thread.opening; a thread row now passes undefined to markdownWords and the feed fails to render. The page protocol contract covers server readings and requires a bump when a field an older page reads is dropped. Bump the protocol for this wire change and update the x-history description, which still promises the title.
The new “Thread readings” section on the user-facing Threads guide describes module owners (threadName, threadMarks, threadDraft) and sends readers to AGENTS.md. This is maintainer wiring in a guide introduced as “using leaf”; it makes readers parse implementation names to learn what they will see. The owner table belongs in How it works or the runtime instructions, while this section can describe the visible names and statuses in ordinary terms.
…in, and keep the Threads guide in user terms
- History rows now carry a thread as `{id}` and the feed names it from the live
thread, so an lf-activity vendored before this reads `thread.opening` as
undefined. The page protocol moves from 7 to 8 and earlier pages must be
re-vendored with `leaf page init`; the `x-history` description says what a row
carries now.
- A workflow under a condition paints no progress on the margin control, so a
thread whose response failed said nothing there; its line now says Threads'
word ("Not answered").
- The Threads page's Thread readings drops the module owners, which the How it
works Data flow section and the runtime's owner table carry.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/runtime/protocol.js # skills/leaf/kernel/kernel.json
# Conflicts: # skills/leaf/kernel/kernel.json
Workstream #8 of the duplicate-logic sweep: each surface used to work out a thread's word, name and id for itself, and the copies had drifted. Every surface that shows a thread (Threads, the margin, the Page Map, the On panel, the floating panel, the activity feed) now reads each of these from one owner, and four visible bugs that came from the copies are fixed.
User-visible fixes
margin-model.jsthreadMarksreads the line fromthreadAttention, the reading Threads paints as its status, and the margin entry's accessible name says it too.workflow.jsprogressFacepicks the animated face andworkflowLabelthe word;todoLabelowns an open to-do's word.messages.jsthreadNamegives the title, else the rendered words of its opening message, else "Drawing". The margin ignored the title, and some surfaces showed raw Markdown or nothing. Packages get the same name throughthreadSummary(thread).topic. The activity feed reads the name from the live thread, sohistory.pynow serves a row's thread as{id}only.Page protocol 8
A history row now carries its thread as
{id}only, and the activity feed names the thread from the live thread. A page vendored before this runs anlf-activitythat reads the row's oldtitleandopening, so the page protocol moves from 7 to 8: re-vendor earlier pages withleaf page init. Thex-historydescription says what a row carries now.Copies that agreed today but would have drifted
thread/selectors.jsdrawnThreadIdis the one reader of the id a drawn thread carries (data-idon a Threads card,data-threadelsewhere). It replaces readers in focus, navigation, composing, held news, destinations, the queue walk and the floating panel.thread/state.jsthreadNamed/threadIdNamedindex the name-to-thread lookup once per thread list; seven call sites rebuilt it on every call.drafts.jsreplyContext,rewriteContextandthreadDraftown thereply:/rewrite:draft names, which were spelled out at each site.skills/leaf/assets/AGENTS.md"One answer for each question";tests/model/test_owner_index.pyholds the rows.Docs
Kept as is, on purpose
drawnThreadId's comment says so.Testing
test_a_thread_an_open_to_do_holds_says_so_beside_the_page: the margin's line and accessible name, the Page Map row, the Threads card, the On panel row and the activity feed, before and after a title arrives. The runtime tests and the browser test each fail on the old logic. The On panel assertion is the exception: for a plain comment the old code gave the same name.pnpm run test:runtime(495),check:browser, the docs page tests and render gate, the model tests, and about 400 focused margin, threads, drafts, floating panel and navigation browser tests pass.