Skip to content

A sample's page-surface showThread replaces the child panel's comment draft on a narrow window #5202

Closed as not planned

Description

@leaf-agent

On a sample whose child window has no room for the rail, sample.showThread(id) (surface page) opens the thread in the child's floating panel. It does that even when the user's comment draft is in the panel's field, and the field then shows the thread's reply box instead of the draft. No gesture in the child asked for this. {surface: "panel"} refuses in the same state: showForSample returns false when the field holds a draft for another thread or has focus.

Cause. Since #5039, a passage thread on a window narrower than --lf-rail-room reaches the panel as the destinations' last resort. The sample's thread command (browser/leaf.js) sends a page request through openPageThread, and openPageThread then reaches the panel's primary reveal with last: true. That path has no host-view yield, so the panel's rule that a host view never takes the user's field holds on the panel route and not on this one.

Reproduction. Run tests/journeys/test_render_sample_delivery.py::test_sample_upgrade_does_not_wait_for_child_saved_state[False-page] at its width before the fix for #5158 (a 1200px viewport, with the sample at its default width). The child's panel opens the saved thread, and the browser watch reports typed words left the screen without a key or press: "Child draft". That fix gives the sample a rail so the test keeps covering the margin card branch. It leaves this narrow-window path untested and unchanged.

What to decide. Where the yield belongs. A focus: false request is not enough to mark a host view, because user gestures also open threads with focus: false (obligations' Show, openThreadSubject), and those may rightly replace the field. One option: when the page has nowhere to draw the thread, the page route falls back to showForSample, which applies the rule. Opening with page: true and falling back to the panel would skip a package's registered primary reader, so that version breaks a composition the layer keeps open.

Activity

  1. leaf-agent commented on Nov 4, 2026

    @leaf-agent
    CollaboratorAuthor

    Still open at 4f192a2, so I'm leaving it for a decision rather than opening a fix. The sample's thread command is unchanged. showForSample still declines when the field has focus or a draft. The panel's primary reveal still opens any thread when last is set, and it can't tell whether the request came from the host. #5203 changed only the test's width, so nothing covers this path.

    Both repairs have a cost the code doesn't settle:

    • Mark the request as a host view. openPageThread would pass a new field on PrimaryRequest through to the panel's reveal, and reveal would apply showForSample's rule when last is set. This keeps a package primary reader in the route. But it is a flag passed down the stack for one consumer, and the intent object can't stand in for it: the sample's intent comes from retainUserIntent, the same as a gesture's.
    • Send the page surface to the page alone (reader: "page"), then fall back to showForSample. This needs no new field, and the panel surface already calls the floating panel directly. But on a page whose package registers its own primary reader, the host's page view would skip that reader, which the issue counts as breaking a composition the layer keeps open.

    Which of these costs to accept, or whether a host view should reach the panel at all on this path, is a maintainer's call. Once that's decided, either version is small, and the reproduction is the [False-page] case of test_render_sample_delivery.py run at its pre-#5203 width.

  2. max-sixty commented on Nov 5, 2026

    @max-sixty
    Owner

    Closing as postponed: nothing needs this before release. A rare path with no user report: the only caller passing surface 'page' is the developer thread-panel gallery, which calls it when a sample becomes ready, so the user must have a draft in the child at that moment on a window under 958px. Both repairs found so far cost something the repo's rules warn against (a flag passed down the stack for one consumer, or skipping a package's primary reader).

    Reopen when: A page outside the developer galleries drives sample.showThread with the page surface while users type in the child, or the primary-reader request gains an origin field for another reason.

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

  3. added
    postponed
    on Nov 5, 2026
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

    postponed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions