Skip to content

Show shared threads inline in code diffs - #288

Merged
max-sixty merged 9 commits into
mainfrom
codex/inline-diff-threads
Sep 5, 2026
Merged

max-sixty merged 9 commits into
mainfrom
codex/inline-diff-threads

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 5, 2026 •

Copy link
Copy Markdown
Owner

Line comments should remain beside the changed code while using the same Thread model, replies, reactions, and settlement as the global Threads panel.

This adds registry-declared widget thread surfaces. Widgets provide outlets for exact projected datums; core renders retained Thread views and reconciles local placements before the living-margin fallback. The diff widget seats conversations below their lines and returns them to the fallback when files are collapsed, filtered, unloaded, or outdated. Adapter failures are reported and release that widget's views to the fallback without interrupting other conversations; core rendering errors still fail the state application. Outlet removal uses canonical conversation cleanup, including releasing any reaction picker that owns the keyboard.

Data projections and fragment loads carry the snapshot that supplied their records. Anchors record source revisions, so source replacement preserves old conversations and drafts without attaching them to replacement content. Returning from the panel waits for the diff outlet, and intervening reader input cancels delayed focus and scrolling. Shared DOM reconciliation preserves retained controls, focus, and caret.

Export and print retain conversation messages while removing live controls across shadow roots. Inline and panel controls use the shared button styles, including a neutral disabled state. The feature gallery, registry reference, and widget authoring contracts document and exercise the complete path.

Verification

All 858 everyday tests and formatting/lint checks pass after integrating main. Browser integration checks cover anchors, navigation, visual targets, data projection, startup, and export, including light/dark lifecycle checks. Regression checks reproduce adapter failures and stale reaction-picker keyboard ownership before the fixes, and confirm that reverting the disabled-button fixes fails the new assertions. Browser inspection covered light/dark themes, narrow layouts, drafts, and print.

This was written by Codex on behalf of max-sixty

…eads

# Conflicts:
#	skills/leaf/CLAUDE.md
#	skills/leaf/assets/registry.json
#	skills/leaf/assets/runtime/anchors.js
#	skills/leaf/assets/runtime/banner-shelf.js
#	skills/leaf/assets/runtime/decisions/view.js
#	skills/leaf/assets/runtime/living-margin.js
#	skills/leaf/assets/runtime/presentation.js
#	skills/leaf/assets/runtime/projection/data.js
#	skills/leaf/assets/theme.css
#	skills/leaf/packages/command-hub/widgets/lf-worktree.js
#	skills/leaf/packages/default/widgets/lf-source.js
#	skills/leaf/packages/diff/widgets/lf-diff.js
#	skills/leaf/packages/pr-review/widgets/lf-call-diff.js
#	skills/leaf/packages/pr-review/widgets/lf-pull-request.js
#	skills/leaf/references/packages.md
#	skills/leaf/scripts/leaf/data.py
#	skills/leaf/scripts/leaf/render-checks/standalone.js
#	tests/render_cases_navigation.py
#	tests/test_render_export.py
#	tests/test_render_startup.py
…eads

# Conflicts:
#	docs/registry.html
#	skills/leaf/assets/runtime/anchors.js
#	skills/leaf/assets/runtime/composing/surface.js

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

One seam finding on the new registerThreadSurface boundary; everything else on the claimed path reads correct to me. The x-data snapshot threading, the revisions ledger in data.json, and datum_anchor_error's admit-outdated/refuse-future rule line up across the three runtimes, and I checked every projectData call site in a widget declaring x-data — lf-diff's unbound inline path is the only one that can reach the helper with snapshot === undefined, and both of its calls there sit behind if (bound).

Separately, worth watching the merge order with #286: both PRs edit living-margin.js and live-leaves.js, and this one's idle-work reductions (the deferred foldShelf, marginKeysAvailable, the guarded style writes, paintReviewAvailability) are the same kind of change #286 is dedicated to. Not a correctness concern — clocked is a pass-through — just conflict surface that would be smaller if those hunks rode with #286.

@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 isolation reads right to me: the identity re-check after end, claiming only the finished layout, clearRegistration giving the adapter a begin/end teardown on disconnect, and keeping renderThreadSurface outside the catch so a core message-rendering fault still fails the whole application. reportPageError's per-message dedup and 20-message cap also mean a permanently broken adapter reports once rather than on every poll, which is what makes "the next ordinary reconciliation retries the adapter" affordable.

One finding on clearOutlets, inline.

@max-sixty
max-sixty merged commit 519a5cd into main Sep 5, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex/inline-diff-threads branch September 5, 2026 05:25
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