Repository navigation
feat: add authored notes to diff source lines - #4759
Merged
Merged
Conversation
Preserve declared prose members when reading data widgets, so existing code notes and new diff notes can be quoted independently of source notation. Diff notes use source file, side and line coordinates, survive deferred rendering and refreshes, and mark missing coordinates instead of disappearing. Closes #4707
This was referenced Oct 31, 2026
max-sixty
pushed a commit
that referenced
this pull request
Nov 1, 2026
Three browser tests still read file identity from the outer diff container. #4759 intentionally moved that identity to the file header so authored notes keep their own prose anchors. The tests now inspect the header and retain their checks of file comments, stored source coordinates, call-tree navigation and precise line selection. Runtime behavior is unchanged. The original unloaded-file assertion reproduced on main `7844f4d04`. With the corrected locators, all four focused checks pass: `test_a_manifest_diff_can_comment_on_one_unloaded_file`, `test_call_diff_projects_stable_commentable_rows`, `test_a_data_bound_diff_aims_and_selects_one_source_line`, and `test_author_notes_follow_source_lines_and_survive_deferred_refresh` (24.23s). Ruff lint, formatting and `git diff --check` pass. Closes #4903 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 1, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 1, 2026
Authored diff notes now reserve the one-pixel inline borders of the file they enter during upgrade, preventing the reported two-pixel width loss. This preserves #4759's final note layout and wrapping; only the initial authored note is inset. The package quality check reproduced both reported findings on current main and passes with the fix. The existing desktop/touch first-paint test now compares note width across upgrade; its new assertion fails on the original CSS and both cases pass with the correction. Visual comparison with `leaf-dev stills HEAD^ --state diff-author-notes --state diff-author-notes-dark --state diff-author-notes-touch` found all three presented states unchanged. A served base/candidate startup comparison kept 42 code requests and 39 JavaScript requests through upgrade and presentation, with JavaScript bytes unchanged and 150 additional CSS bytes to reserve the inset before rendering. <details><summary>First-paint comparison</summary> In the same gallery, with the runtime entry held, the old note measured 907.609375px before upgrade and 905.609375px afterward. The corrected note measured 905.609375px on both sides. The initial border and text inset move inward by one pixel on each edge: | Before | After | | --- | --- | |  |  | The focused Python checks passed (3 cases), Ruff passed, and all 737 runtime tests passed. </details> Closes #4950 — automated triage Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
lf-diff-notechildren addressed byfile,side="old|new"andat, so an author can explain a patch inline without repeating its source in a code block. Notes follow their file disclosure, wrap within the visible reader width, survive deferred loading and source refreshes, and show an unmatched address when their line disappears.The shared passage reader now admits declared prose members independently of a data widget's source notation, covering existing code notes too. File data identity belongs to the file header instead of its entire body: selecting a note captures an authored prose anchor rather than a source-revision-bound file datum. File comment controls and inline conversation placement retain their existing routes; closing a file comment returns focus within that file, now at its header.
Validation passed:
pnpm run check, the final browser build check, and pre-commit checks.Visual and startup verification
Reviewed before/after captures of the committed diff gallery in light, dark and phone states. Reproduce them with:
Screenshot publication is blocked:
leaf-dev publish-mediareceived HTTP 403 becauseleaf-agentcannot push tomax-sixty/leaf-assets. The captures stayed in this run's.tmp/stills/; no image or asset pin was committed. The named states let the reviewer regenerate and inspect the comparisons.A base/candidate startup probe of the same small served patch kept 39 code requests and 36 JavaScript requests through both upgrade and presentation. Code bytes increased by 5,451, including the note placement, prose styling and first-paint height reservation. The reservation must precede the source renderer to keep content below an annotated diff in place; the desktop/phone checks cover that guarantee.
Closes #4707 — automated triage