Skip to content

An lf-options choice in a thread on an lf-diff line draws as run-together text, and fails the render check #5944

Closed

Description

@max-sixty

An lf-options group sent in a thread message's --markup draws as plain inline text when the thread is anchored on a line of an lf-diff. The same group in a thread on a paragraph draws as option cards.

What happens

In the thread under the diff line, the two options run together on one line with no cards: "choose one recommended Keep steelchoose oneGo back to plastic Lighter, and it carries less." The "Add another option…" field below them draws normally.

Measured in the browser on the page below:

thread on a diff line thread on a paragraph
the group's root node lf-diff's shadow root the document
lf-options computed display inline grid
lf-option computed display inline flow-root
lf-option padding-top 0px 16px
lf-option height 16px 74px
part attribute on lf-options lf-a1 none

leaf page check <page> --render then fails the page with undeclared-attr ({"tag": "lf-options", "attr": "part"}), though the page source and the message markup carry no part.

Expected

The group draws as option cards wherever its thread is anchored, and the render check passes.

Repro

  1. leaf page init --package diff <page>, with this index.html body:

    <main class="layout-column">
      <h1 id="title">A choice in a thread on a diff line</h1>
      <p id="intro">One small patch, with a thread on its second line.</p>
      <lf-diff id="mount-diff"><pre>
    diff --git a/feeders/mount.py b/feeders/mount.py
    --- a/feeders/mount.py
    +++ b/feeders/mount.py
    @@ -1,2 +1,2 @@
     def bracket():
    -    return "plastic"
    +    return "steel"
    </pre></lf-diff>
      <p id="after">A paragraph after the patch.</p>
    </main>
  2. Serve it. In the browser, use the diff's "Comment on feeders/mount.py · new line 2" control and send a comment.

  3. Answer that comment with a choice:

    leaf thread reply <answer.ref> --text "Which should the bracket be? I'd keep steel." --markup '<lf-options id="bracket-material" choose><lf-option id="bracket-material-steel"><small class="tag ok">recommended</small> <strong>Keep steel</strong></lf-option><lf-option id="bracket-material-plastic"><strong>Go back to plastic</strong> Lighter, and it carries less.</lf-option></lf-options>'
  4. Reload the page: the options under the diff line are run-together text.

  5. Control: leaf thread create <page> --section after --text "The same choice, in a thread on a paragraph." --markup '<the same group with new ids>' draws as cards.

  6. leaf page check <page> --render reports undeclared-attr for lf-options' part.

Seen in Chromium 156, headless, on Linux, at a 1280x900 window.

Seen on leaf 624c282, installed 2026-11-13T20:09:37-08:00.

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

Activity

  1. added
    bug
    on Nov 14, 2026
  2. leaf-agent commented on Nov 14, 2026

    @leaf-agent
    Collaborator

    I reproduced both symptoms and opened #5945 to fix them.

    • Unstyled options: a package's defaults.css reached only the document. A diff seats a line thread in its shadow tree, so widgets in that thread's messages lost their look. With fix: style message widgets in a thread seated in a widget's shadow tree #5945, each shadow tree also takes those rules, scoped to the thread transcript and in the same cascade position they hold in the document.
    • undeclared-attr on part: the runtime itself sets that attribute so the document can anchor a box inside a shadow tree. The render check now treats part as a platform attribute, like class.

    The new browser test fails on main and passes on the branch. In the diff thread the options now measure 16px padding-top and 74px tall, matching your paragraph-thread values. The fix costs about 17 KB gzipped in shadow.css; the PR body has the measurements and a cheaper lazy-sheet alternative. CI and landing for #5945 are with tend-land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions