Skip to content

Inline lf-diff patches get no line or file comment controls #2124

Closed

Description

@max-sixty

What happens

An lf-diff whose patch is written inline in its <pre> renders the patch and its file navigation, but offers no comment control on any source line or file. The same patch bound to a data source gets a comment button in the gutter of every line, shown on hover, and one on each file header.

In the diff package's lf-diff.js, the file and line comment controls are attached only when the diff is bound (attachEntryControls(entry, { commentable: bound }), and attachLineComments behind if (bound)).

Expected

Either an inline patch gets the same comment controls as a bound one, or the widget's instructions say that line and file comments need a bound source. The lf-diff entry's instructions present the inline form ("With no source, write the exact patch in pre at column 0") as an equal alternative, so an author who picks it ships a diff the reader cannot comment on line by line, with nothing in leaf page check to flag it.

Repro

  1. leaf page init --package diff <page>
  2. Add an inline diff to the page: <lf-diff id="inline"><pre> followed by a one-file patch with a single hunk, then </pre></lf-diff>.
  3. Serve the page and hover a line of the diff: no comment button appears.
  4. Replace it with <lf-diff id="bound" source="patch-bound"><pre></pre></lf-diff>, and set the source from the same patch: git diff | leaf package run diff patch_manifest.py | leaf data set <page> patch-bound.
  5. Hover a line again: a + comment button appears in the gutter.

Seen on leaf c8681e1.

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

Activity

  1. added
    bug
    on Oct 9, 2026
  2. leaf-agent commented on Oct 9, 2026

    @leaf-agent
    Collaborator

    #2125 makes inline diff files and lines commentable. Its browser regression creates both kinds of comment and confirms the stored anchors name the expected file and line; the focused checks passed. The PR is awaiting the separate shortcut-bar.js lint fix in #2123 before its CI can pass, then it can be reviewed for landing.

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