Skip to content

Read a thread's word, name and id from one owner on every surface - #3075

Merged
max-sixty merged 14 commits into
mainfrom
thread-presentation-one-reading
Oct 16, 2026
Merged

max-sixty merged 14 commits into
mainfrom
thread-presentation-one-reading

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

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

  • A thread held by an open to-do now says so in the margin. Threads already said "To-do open" (or "Working" while a start runs on it), but the margin entry and the Page Map row said nothing. margin-model.js threadMarks reads the line from threadAttention, the reading Threads paints as its status, and the margin entry's accessible name says it too.
  • A reply still streaming reads "Replying" on the margin and Page Map control. It used to read "Working" there while Threads said Replying. workflow.js progressFace picks the animated face and workflowLabel the word; todoLabel owns an open to-do's word.
  • A thread whose response failed says so in the margin. A workflow under a condition paints no progress on the margin control, so the line now says Threads' word for it ("Not answered").
  • An untitled thread has one name everywhere. messages.js threadName gives 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 through threadSummary(thread).topic. The activity feed reads the name from the live thread, so history.py now 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 an lf-activity that reads the row's old title and opening, so the page protocol moves from 7 to 8: re-vendor earlier pages with leaf page init. The x-history description says what a row carries now.

Copies that agreed today but would have drifted

  • thread/selectors.js drawnThreadId is the one reader of the id a drawn thread carries (data-id on a Threads card, data-thread elsewhere). It replaces readers in focus, navigation, composing, held news, destinations, the queue walk and the floating panel.
  • thread/state.js threadNamed / threadIdNamed index the name-to-thread lookup once per thread list; seven call sites rebuilt it on every call.
  • drafts.js replyContext, rewriteContext and threadDraft own the reply: / rewrite: draft names, which were spelled out at each site.
  • Each new owner has a row in skills/leaf/assets/AGENTS.md "One answer for each question"; tests/model/test_owner_index.py holds the rows.

Docs

  • How it works gains an Ontology tab: the kinds of record by layer (recorded, folded by the server, combined in the browser, owned by one browser) and a diagram of how threads, messages, updates, workflows, asks and to-dos relate.
  • The Data tab gains a Data flow section, from current state to each surface.
  • The Threads page gains Thread readings: what each place says about a thread, in user terms. The Data flow section links the runtime's owner table.

Kept as is, on purpose

  • The two id attributes stay: about 450 selectors in the runtime and the tests use them to tell a Threads card from a page thread. drawnThreadId's comment says so.
  • At Sent and Queued, a thread's margin entry shows no line, as before. Only the user's turn and the unread count are named there, and an existing margin test expects that.
  • In the activity feed, a reaction-only thread, which Threads doesn't list, is named "a thread".

Testing

  • New runtime tests: the margin entry and Page Map row say Threads' word; a streaming reply paints the working face under its own word; the untitled-thread name; a failed response's word on the margin line.
  • New browser test 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.

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

max-sixty and others added 10 commits October 12, 2026 13:49
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
leaf-agent
leaf-agent previously approved these changes Oct 16, 2026
# Conflicts:
#	skills/leaf/kernel/kernel.json

@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.

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.

max-sixty and others added 2 commits October 15, 2026 23:12
…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
leaf-agent
leaf-agent previously approved these changes Oct 16, 2026
# Conflicts:
#	skills/leaf/kernel/kernel.json
@max-sixty
max-sixty merged commit 7933ec3 into main Oct 16, 2026
3 checks passed
@max-sixty
max-sixty deleted the thread-presentation-one-reading branch October 16, 2026 06:35
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