Skip to content

Update diffs to latest 1.3.0-beta.9#116

Merged
cpojer merged 5 commits into
nkzw-tech:mainfrom
amadeus:update-diffs
Jul 10, 2026
Merged

Update diffs to latest 1.3.0-beta.9#116
cpojer merged 5 commits into
nkzw-tech:mainfrom
amadeus:update-diffs

Conversation

@amadeus

@amadeus amadeus commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Ports things over to use thew new custom CodeView header api and also take advantage of the new hydration APIs.

You'll see the history updates to 2 different versions, Fable noticed a bit of an issue that was worth resolving in a secondary update.

Pretty much all this code was vibed, and since i don't have a strong understanding of the internals, unclear if this is the correct way forward on this stuff.

If it sucks, blame Fable 🤣

amadeus and others added 5 commits July 8, 2026 18:15
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Patch-only sections now expand unchanged context via the library's partial
diff hydration: clicking a hunk separator triggers a fetch over IPC and the
FileDiffMetadata is hydrated in place, replacing the eager Load flow that
re-parsed the whole section through React state. Loaded contents are kept in
a module-level side cache so whitespace re-parses and markdown previews still
see full contents. The eager Load flow remains for deferred/too-large
sections; diff search keeps preloading patch-only sections into state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The PR/commit description card was a fake CodeView file item whose body was
smuggled through a line annotation, visually stripped with unsafeCSS, and
re-measured via a manual layout-pass state. Beta.8's renderCodeViewHeader
renders it as a non-virtualized element at the top of the scroll content and
re-measures height changes with a ResizeObserver, so the fake item, the
layout-pass hack, the unsafeCSS block, and the sourceDescriptionFooterKey
threading are all gone. The title bar keeps sticking to the top of the
scroller (position: sticky within the card).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Inside CodeView the library hydrates a clone of the partial FileDiffMetadata
and keeps it internally, so the app-side cached object never becomes full.
Any later item version bump (e.g. creating a comment) re-delivered the stale
partial and reset the expanded diff. Evict the parsed-diff cache entry when
loaded contents arrive and re-parse via the library's hydratePartialDiff so
the rebuilt object has identical hunk geometry to the internal clone —
preserving the renderer's expansion state across the swap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Includes the upstream fix for CodeView partial hydration mutating a clone
instead of the caller's object (pierrecomputer/pierre#953), so the parsed-diff
cache eviction workaround is no longer needed: cache hits keep returning the
object CodeView hydrated in place. The hydrated re-parse branch stays to keep
whitespace-toggle re-parses full from the loaded-contents cache.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh, not sure why it deleted all this lol, just lmk if it should stay and i'll get it to add it back

@cpojer cpojer merged commit be9ee16 into nkzw-tech:main Jul 10, 2026
@amadeus amadeus deleted the update-diffs branch July 10, 2026 02:19
@cpojer

cpojer commented Jul 10, 2026

Copy link
Copy Markdown
Member

arigatou!

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