Skip to content

Simplify diff controls and preserve compact line comments - #2175

Merged
max-sixty merged 5 commits into
mainfrom
codex/simplify-diff-controls
Oct 10, 2026
Merged

max-sixty merged 5 commits into
mainfrom
codex/simplify-diff-controls

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Diff comments previously used a hover + that covered the line number, while optional wrapping and per-file review controls competed with reading the patch. File headers now use Leaf's shared thread icon; line comments retain the compact gutter and reveal a small + in its existing blank margin. Totals use the shared green/red inks, and wrapping/review tracking are removed from the package contract and its consumers.

Inline conversations stay within the visible reader while long code lines scroll horizontally. Comment captures the live native selection when pressed, so a source refresh no longer leaves the composer with an obsolete revision. Package guidance favors task-focused interfaces and shared presentation; a narrow instruction comparison supports shared-icon reuse, while both versions already chose a simple interface.

Validation: focused desktop/touch browser tests cover gutter geometry, hover/focus transparency, comment submission, source refresh, draft and focus preservation, filtering/navigation and print wrapping. All 275 runtime tests, package validation, and changed-file lint checks pass. Light/dark/phone before-and-after states and an independent live user test were reviewed.

Page-code startup failures also include failed-request details (resource type, browser error, frame, and URL); optional request failures alone remain nonfatal. A native failed-module/optional-image contrast and the existing plain-check integration cases pass.

This was written by Codex on behalf of max-sixty

Keep line comments visible in a dedicated gutter lane and use the shared thread icon. Remove wrapping and per-file review tracking, including their state contract and assertions, while retaining filtering, navigation, source refresh and print wrapping.

Size inline conversations to the visible reader, keeping long source lines independently scrollable. Capture native selections at the explicit Comment gesture so a source refresh does not strand composer focus on an obsolete revision.

Document task-focused widget interfaces and shared icons; add a narrow instruction probe and light, dark and touch comparison states.
Use the thread symbol only for file comments. Keep native line-number geometry and reveal a small plus in its existing blank margin when the pointer reaches a source line or number. The transparent full-number-row press supports touch without enlarging every row.

Compare bound commentable diffs with native inline rendering to protect gutter width and row height, and verify hover paint leaves the number unobscured.
A line gutter is a transparent overlay rather than a filled action button. Keep the number readable under hover and focus, and keep the hit region within its native source row.
leaf-agent
leaf-agent previously approved these changes Oct 9, 2026

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

The test job is red on this head for two changes in this PR:

  • Removing lf-diff's review action from registry.json leaves the public verb table in docs/event-log.html listing lf-diff / review / file / none. test_the_event_log_page_quotes_the_registry fails on that stale row, and the published page would describe an action readers can no longer take. Remove that row with the contract change.
  • The new browser test closes its context explicitly. test_the_resources_a_fixture_owns_are_taken_from_that_fixture fails because the browser fixture owns teardown; the inline suggestion removes that call.

Comment thread tests/test_render_diff_controls.py Resolved
@leaf-agent
leaf-agent dismissed their stale review October 9, 2026 21:09

CI test job failed on two changes in this PR.

leaf-agent
leaf-agent previously approved these changes Oct 9, 2026
Page-code failures now include the browser request type, error, frame and URL,
so a module startup failure can be distinguished from a resource or delivery
failure. Optional failed requests alone retain the existing passing result.

Validated with a native failed-script/optional-image contrast and both existing
plain page-check integration cases.
@max-sixty
max-sixty merged commit 728013c into main Oct 10, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex/simplify-diff-controls branch October 10, 2026 00:11
max-sixty added a commit that referenced this pull request Oct 10, 2026
…rked controls

main made the page tab strip sticky in every non-side tab set and kept
its panels' reset landing room, which the derived focus margin does
without, so that line goes. main's visual review (#2098) puts the case
picker on its own row in a narrow review, so the sticky header states
two rows there. The visual review's navigation test opens the inspector,
which now folds into a disclosure, and names Next exactly beside Next
unreviewed. The sticky-header creep test drops the diff's file action:
an inline diff has no file press since #2175 removed review marks, and
the test failed on main for it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 10, 2026
#2175 removed review tracking from the `<lf-diff>` package contract. The
standing-action replay fixture still appended a diff `review` event, so
[main CI](https://github.com/max-sixty/leaf/actions/runs/38013241865)
failed at admission before it could test replay. This removes that
obsolete fixture event. The test still requires its standing actions to
cover every verb declared by the served registry.

`test_the_render_gate_applies_every_standing_action_a_second_time`
failed before the change and passes after it.

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 10, 2026
The sticky-header focus check uses an inline diff;
[#2175](#2175) removed its file
review button. It tried to focus that absent button and stopped before
checking either scroll position. Remove the absent action from this
fixture's focus sequence. The test still checks the file summary and
page tab, then Tab into the code scroller.

The focused browser case failed on `main` before this change and passed
afterward: `uv run pytest
tests/test_render_widgets.py::test_focus_in_a_stuck_header_leaves_the_page_where_it_is
-q -n0`.

This addresses one failure in [main CI run
38013241865](https://github.com/max-sixty/leaf/actions/runs/38013241865).

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 24, 2026
…alk key and a stale kind list

- `widget-api.js`: the comment over `dragging`, `el`, `reachedForWords`
  and `worksInside` called them "the one watcher of the page's readings".
  None of them watches readings: they are the drag and press helpers
  `module-input.md` documents. Dropped.
- `history.py`'s header listed by hand the kinds kept out of history, and
  the list had drifted from `SHOWN`, which leaves out more. It now points
  at `SHOWN`.
- Five test docstrings said the obligation walk answers `d` or `a`; the
  walk is `m` (`queue-walk.js`, `queue.walk`) and every test presses `m`.
  One named `commentOnAddressable`, which no longer exists.
- `test_render_diff_controls.py` asserted that `.lf-diff-wrap`,
  `.lf-diff-review` and `.lf-diff-next` were absent. No code writes those
  classes since #2175, so the assertion passed whatever the diff drew.
  Removed.
leaf-agent added a commit that referenced this pull request Nov 24, 2026
…alk key and a stale kind list (#6972)

This fixes comments, docstrings and one test assertion that the rolling
survey found describing code that no longer exists. No behavior changes.

- **`browser/runtime/widget-api.js`**: the comment over `dragging`,
`el`, `reachedForWords` and `worksInside` called them "the one watcher
of the page's readings" and pointed to `module-reading.md`. None of them
watches readings: they are the drag and press helpers `module-input.md`
documents. A package author reading the public API file was sent to the
wrong reference. The comment is dropped.
- **`src/leaf/history.py`**: the header listed by hand the kinds kept
out of history, and the list had drifted from `SHOWN`. It left out
`activation`, `plan`, `render`, `seen` and others. It now points at
`SHOWN`.
- **Test docstrings**: five said the obligation walk answers `d` or `a`
(four in `tests/browser/widgets/test_obligations.py`, one in
`tests/browser/projection/test_thread_replies.py`). The walk is `m`
(`queue.walk` in `browser/runtime/queue-walk.js`), and those tests press
`m`. One comment also named `commentOnAddressable`, which no longer
exists.
- **`tests/journeys/test_render_diff_controls.py`**: the test asserted
that `.lf-diff-wrap`, `.lf-diff-review` and `.lf-diff-next` were absent.
No code has written those classes since #2175, so the assertion passed
whatever the diff drew (`tests/AGENTS.md`, "Absences"). It is removed.

Ran pre-commit on the changed files and `tests/model -k history` (36
passed). The journey test runs in this PR's CI because its file changed.

Co-authored-by: leaf-agent <[email protected]>
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