Repository navigation
[diffs] Add a labels option for localizing diff text - #1271
Conversation
|
@unknwon is attempting to deploy a commit to the Pierre Computer Company Team on Vercel. A member of the Team first needs to authorize it. |
e10d8cb to
d2b705f
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2b705fe36
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Apps that translate their UI cannot change the English text the diff
renders, such as "12 unmodified lines" or "Expand all". This adds a
package-level `i18n` singleton the app configures once at boot, on the
server and the client, instead of passing text through component
options.
Translations are plain ICU MessageFormat strings, so one JSON config
serves both sides of the server/client boundary. The formatter supports
only what the strings need: `{name}` arguments and one plural block per
string with the CLDR categories, selected through `Intl.PluralRules`
for the configured locale. No dependencies are added.
`DEFAULT_TRANSLATIONS` defines the keys and the English templates;
`DiffsTranslations` is derived from it. `i18n.set()` replaces every
translation and the locale, falls back to English for anything left
out, validates and compiles before changing state, and notifies
subscribers only on a real change. Nothing reads the store yet; the
renderer and component subscriptions follow.
Hunk separators and the no-newline marker now take their text from the `i18n` singleton. The `labels` diff option, its `DiffLabels` type, the `DEFAULT_DIFF_LABELS` defaults, the `resolveDiffLabels` helper, and the hand-rolled English plural rule are removed; nothing is passed through component options any more. `createSeparator` and `createNoNewlineElement` call `i18n.t()` themselves, so their signatures return to what they were before the option existed. With the default English translations the rendered output is unchanged.
Switch languages with `i18n.set()` while a diff is on screen and its
hunk separators, no-newline marker, and merge-conflict buttons now
update in place, like a theme change does. Before, new translations
only showed up on the next render for an unrelated reason.
`FileDiff` subscribes to the i18n store where it subscribes to theme
changes, unsubscribes in `cleanUp`, and handles the change with a
plain `rerender()`: separators and injected rows are rebuilt from the
cached highlight on every forced render, so no cache is cleared.
`VirtualizedFileDiff` and `UnresolvedFile` inherit it. `CodeView` does
not subscribe; its mounted items do, and recycled shells hold no
rendered rows.
The merge-conflict action buttons ("Accept current change", "Accept
incoming change", "Accept both") move into `DEFAULT_TRANSLATIONS` and
are read through `i18n.t()` at render time.
Add an Internationalization page: configuring `i18n.set()` once at boot on server and client, switching languages at runtime from JSON files, the supported ICU message subset with plural categories, the full key table with English defaults, and the server-rendering rules. Register the section with the llms.txt generator so the docs build includes it. Remove the `labels` option from the React and Vanilla shared-options examples, since that option no longer exists.
The search panel's placeholders, match status, option toggles, and buttons were hard-coded English, so a translated app still showed an English find-and-replace bar. They now come from `DEFAULT_TRANSLATIONS` through `i18n.t()`, read when the panel is built, which happens on each open. The match count becomes a plural template, so a single match reads "1 result" instead of "1 results". The docs key table lists the new keys.
d2b705f to
acbc108
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Alright, so looking at this holistically, i think the better architecture is to have a proper i18n singleton class instance that can handle all strings across the entire package so it doesn't pollute options or require a dev to continuously set these labels on new instances. Also I made it so the strings follow the ICU MessageFormat, which enables languages to be SSR to Client Component compatible. |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acbc108448
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
CI ran `UnresolvedFile.sequentialResolve.test.ts` before `i18n.test.ts` in one process. The first mounts an `UnresolvedFile` and never cleans it up, so it stays subscribed to the i18n store, and the later `i18n.set()` re-rendered it into a torn-down DOM. Three virtualized hydration tests left rendered instances behind the same way. Each now calls `cleanUp()` in its `finally`. The search e2e test expected "1 results"; the panel now says "1 result".
CI ran test files in an order where a `VirtualizedFileDiff` left mounted by `virtualizedEditorViewport.test.ts` was still subscribed to the i18n store when a later file called `i18n.set()`. The re-render threw into a DOM that no longer existed and failed every translation test. Bun lists files in filesystem order, which is alphabetical on macOS and arbitrary on Linux, so the order never occurred locally. Patching each leaking test is not reliable, so the DOM harness now drops every subscriber and restores the English defaults on install and on cleanup, the same way it already clears the render queue. The fake DOM harness in `hydration.test.ts` does the same. `i18n.clearSubscribers` is marked `@internal` for that purpose. The leaking test also cleans up its instance.
* [diffs] Add a labels option for localizing diff text
* feat(diffs): add an i18n store for user-visible diff text
Apps that translate their UI cannot change the English text the diff
renders, such as "12 unmodified lines" or "Expand all". This adds a
package-level `i18n` singleton the app configures once at boot, on the
server and the client, instead of passing text through component
options.
Translations are plain ICU MessageFormat strings, so one JSON config
serves both sides of the server/client boundary. The formatter supports
only what the strings need: `{name}` arguments and one plural block per
string with the CLDR categories, selected through `Intl.PluralRules`
for the configured locale. No dependencies are added.
`DEFAULT_TRANSLATIONS` defines the keys and the English templates;
`DiffsTranslations` is derived from it. `i18n.set()` replaces every
translation and the locale, falls back to English for anything left
out, validates and compiles before changing state, and notifies
subscribers only on a real change. Nothing reads the store yet; the
renderer and component subscriptions follow.
* refactor(diffs): read diff text from the i18n store
Hunk separators and the no-newline marker now take their text from the
`i18n` singleton. The `labels` diff option, its `DiffLabels` type, the
`DEFAULT_DIFF_LABELS` defaults, the `resolveDiffLabels` helper, and the
hand-rolled English plural rule are removed; nothing is passed through
component options any more.
`createSeparator` and `createNoNewlineElement` call `i18n.t()`
themselves, so their signatures return to what they were before the
option existed. With the default English translations the rendered
output is unchanged.
* fix(i18n): add strings for UnresolvedFile
* feat(diffs): re-render mounted diffs when translations change
Switch languages with `i18n.set()` while a diff is on screen and its
hunk separators, no-newline marker, and merge-conflict buttons now
update in place, like a theme change does. Before, new translations
only showed up on the next render for an unrelated reason.
`FileDiff` subscribes to the i18n store where it subscribes to theme
changes, unsubscribes in `cleanUp`, and handles the change with a
plain `rerender()`: separators and injected rows are rebuilt from the
cached highlight on every forced render, so no cache is cleared.
`VirtualizedFileDiff` and `UnresolvedFile` inherit it. `CodeView` does
not subscribe; its mounted items do, and recycled shells hold no
rendered rows.
The merge-conflict action buttons ("Accept current change", "Accept
incoming change", "Accept both") move into `DEFAULT_TRANSLATIONS` and
are read through `i18n.t()` at render time.
* docs(diffs): document the i18n store
Add an Internationalization page: configuring `i18n.set()` once at boot
on server and client, switching languages at runtime from JSON files,
the supported ICU message subset with plural categories, the full key
table with English defaults, and the server-rendering rules. Register
the section with the llms.txt generator so the docs build includes it.
Remove the `labels` option from the React and Vanilla shared-options
examples, since that option no longer exists.
* feat(diffs): read editor search panel text from the i18n store
The search panel's placeholders, match status, option toggles, and
buttons were hard-coded English, so a translated app still showed an
English find-and-replace bar. They now come from `DEFAULT_TRANSLATIONS`
through `i18n.t()`, read when the panel is built, which happens on each
open.
The match count becomes a plural template, so a single match reads
"1 result" instead of "1 results". The docs key table lists the new
keys.
* test(diffs): clean up mounted instances and expect the singular count
CI ran `UnresolvedFile.sequentialResolve.test.ts` before `i18n.test.ts`
in one process. The first mounts an `UnresolvedFile` and never cleans
it up, so it stays subscribed to the i18n store, and the later
`i18n.set()` re-rendered it into a torn-down DOM. Three virtualized
hydration tests left rendered instances behind the same way. Each now
calls `cleanUp()` in its `finally`.
The search e2e test expected "1 results"; the panel now says
"1 result".
* test(diffs): drop i18n subscribers when a test DOM is torn down
CI ran test files in an order where a `VirtualizedFileDiff` left mounted
by `virtualizedEditorViewport.test.ts` was still subscribed to the i18n
store when a later file called `i18n.set()`. The re-render threw into a
DOM that no longer existed and failed every translation test. Bun lists
files in filesystem order, which is alphabetical on macOS and arbitrary
on Linux, so the order never occurred locally.
Patching each leaking test is not reliable, so the DOM harness now
drops every subscriber and restores the English defaults on install and
on cleanup, the same way it already clears the render queue. The fake
DOM harness in `hydration.test.ts` does the same. `i18n.clearSubscribers`
is marked `@internal` for that purpose. The leaking test also cleans up
its instance.
---------
Co-authored-by: Amadeus Demarzi <[email protected]>
* [diffs] Add a labels option for localizing diff text
* feat(diffs): add an i18n store for user-visible diff text
Apps that translate their UI cannot change the English text the diff
renders, such as "12 unmodified lines" or "Expand all". This adds a
package-level `i18n` singleton the app configures once at boot, on the
server and the client, instead of passing text through component
options.
Translations are plain ICU MessageFormat strings, so one JSON config
serves both sides of the server/client boundary. The formatter supports
only what the strings need: `{name}` arguments and one plural block per
string with the CLDR categories, selected through `Intl.PluralRules`
for the configured locale. No dependencies are added.
`DEFAULT_TRANSLATIONS` defines the keys and the English templates;
`DiffsTranslations` is derived from it. `i18n.set()` replaces every
translation and the locale, falls back to English for anything left
out, validates and compiles before changing state, and notifies
subscribers only on a real change. Nothing reads the store yet; the
renderer and component subscriptions follow.
* refactor(diffs): read diff text from the i18n store
Hunk separators and the no-newline marker now take their text from the
`i18n` singleton. The `labels` diff option, its `DiffLabels` type, the
`DEFAULT_DIFF_LABELS` defaults, the `resolveDiffLabels` helper, and the
hand-rolled English plural rule are removed; nothing is passed through
component options any more.
`createSeparator` and `createNoNewlineElement` call `i18n.t()`
themselves, so their signatures return to what they were before the
option existed. With the default English translations the rendered
output is unchanged.
* fix(i18n): add strings for UnresolvedFile
* feat(diffs): re-render mounted diffs when translations change
Switch languages with `i18n.set()` while a diff is on screen and its
hunk separators, no-newline marker, and merge-conflict buttons now
update in place, like a theme change does. Before, new translations
only showed up on the next render for an unrelated reason.
`FileDiff` subscribes to the i18n store where it subscribes to theme
changes, unsubscribes in `cleanUp`, and handles the change with a
plain `rerender()`: separators and injected rows are rebuilt from the
cached highlight on every forced render, so no cache is cleared.
`VirtualizedFileDiff` and `UnresolvedFile` inherit it. `CodeView` does
not subscribe; its mounted items do, and recycled shells hold no
rendered rows.
The merge-conflict action buttons ("Accept current change", "Accept
incoming change", "Accept both") move into `DEFAULT_TRANSLATIONS` and
are read through `i18n.t()` at render time.
* docs(diffs): document the i18n store
Add an Internationalization page: configuring `i18n.set()` once at boot
on server and client, switching languages at runtime from JSON files,
the supported ICU message subset with plural categories, the full key
table with English defaults, and the server-rendering rules. Register
the section with the llms.txt generator so the docs build includes it.
Remove the `labels` option from the React and Vanilla shared-options
examples, since that option no longer exists.
* feat(diffs): read editor search panel text from the i18n store
The search panel's placeholders, match status, option toggles, and
buttons were hard-coded English, so a translated app still showed an
English find-and-replace bar. They now come from `DEFAULT_TRANSLATIONS`
through `i18n.t()`, read when the panel is built, which happens on each
open.
The match count becomes a plural template, so a single match reads
"1 result" instead of "1 results". The docs key table lists the new
keys.
* test(diffs): clean up mounted instances and expect the singular count
CI ran `UnresolvedFile.sequentialResolve.test.ts` before `i18n.test.ts`
in one process. The first mounts an `UnresolvedFile` and never cleans
it up, so it stays subscribed to the i18n store, and the later
`i18n.set()` re-rendered it into a torn-down DOM. Three virtualized
hydration tests left rendered instances behind the same way. Each now
calls `cleanUp()` in its `finally`.
The search e2e test expected "1 results"; the panel now says
"1 result".
* test(diffs): drop i18n subscribers when a test DOM is torn down
CI ran test files in an order where a `VirtualizedFileDiff` left mounted
by `virtualizedEditorViewport.test.ts` was still subscribed to the i18n
store when a later file called `i18n.set()`. The re-render threw into a
DOM that no longer existed and failed every translation test. Bun lists
files in filesystem order, which is alphabetical on macOS and arbitrary
on Linux, so the order never occurred locally.
Patching each leaking test is not reliable, so the DOM harness now
drops every subscriber and restores the English defaults on install and
on cleanup, the same way it already clears the render queue. The fake
DOM harness in `hydration.test.ts` does the same. `i18n.clearSubscribers`
is marked `@internal` for that purpose. The leaking test also cleans up
its instance.
---------
Co-authored-by: Amadeus Demarzi <[email protected]>
* [diffs] Add a labels option for localizing diff text
* feat(diffs): add an i18n store for user-visible diff text
Apps that translate their UI cannot change the English text the diff
renders, such as "12 unmodified lines" or "Expand all". This adds a
package-level `i18n` singleton the app configures once at boot, on the
server and the client, instead of passing text through component
options.
Translations are plain ICU MessageFormat strings, so one JSON config
serves both sides of the server/client boundary. The formatter supports
only what the strings need: `{name}` arguments and one plural block per
string with the CLDR categories, selected through `Intl.PluralRules`
for the configured locale. No dependencies are added.
`DEFAULT_TRANSLATIONS` defines the keys and the English templates;
`DiffsTranslations` is derived from it. `i18n.set()` replaces every
translation and the locale, falls back to English for anything left
out, validates and compiles before changing state, and notifies
subscribers only on a real change. Nothing reads the store yet; the
renderer and component subscriptions follow.
* refactor(diffs): read diff text from the i18n store
Hunk separators and the no-newline marker now take their text from the
`i18n` singleton. The `labels` diff option, its `DiffLabels` type, the
`DEFAULT_DIFF_LABELS` defaults, the `resolveDiffLabels` helper, and the
hand-rolled English plural rule are removed; nothing is passed through
component options any more.
`createSeparator` and `createNoNewlineElement` call `i18n.t()`
themselves, so their signatures return to what they were before the
option existed. With the default English translations the rendered
output is unchanged.
* fix(i18n): add strings for UnresolvedFile
* feat(diffs): re-render mounted diffs when translations change
Switch languages with `i18n.set()` while a diff is on screen and its
hunk separators, no-newline marker, and merge-conflict buttons now
update in place, like a theme change does. Before, new translations
only showed up on the next render for an unrelated reason.
`FileDiff` subscribes to the i18n store where it subscribes to theme
changes, unsubscribes in `cleanUp`, and handles the change with a
plain `rerender()`: separators and injected rows are rebuilt from the
cached highlight on every forced render, so no cache is cleared.
`VirtualizedFileDiff` and `UnresolvedFile` inherit it. `CodeView` does
not subscribe; its mounted items do, and recycled shells hold no
rendered rows.
The merge-conflict action buttons ("Accept current change", "Accept
incoming change", "Accept both") move into `DEFAULT_TRANSLATIONS` and
are read through `i18n.t()` at render time.
* docs(diffs): document the i18n store
Add an Internationalization page: configuring `i18n.set()` once at boot
on server and client, switching languages at runtime from JSON files,
the supported ICU message subset with plural categories, the full key
table with English defaults, and the server-rendering rules. Register
the section with the llms.txt generator so the docs build includes it.
Remove the `labels` option from the React and Vanilla shared-options
examples, since that option no longer exists.
* feat(diffs): read editor search panel text from the i18n store
The search panel's placeholders, match status, option toggles, and
buttons were hard-coded English, so a translated app still showed an
English find-and-replace bar. They now come from `DEFAULT_TRANSLATIONS`
through `i18n.t()`, read when the panel is built, which happens on each
open.
The match count becomes a plural template, so a single match reads
"1 result" instead of "1 results". The docs key table lists the new
keys.
* test(diffs): clean up mounted instances and expect the singular count
CI ran `UnresolvedFile.sequentialResolve.test.ts` before `i18n.test.ts`
in one process. The first mounts an `UnresolvedFile` and never cleans
it up, so it stays subscribed to the i18n store, and the later
`i18n.set()` re-rendered it into a torn-down DOM. Three virtualized
hydration tests left rendered instances behind the same way. Each now
calls `cleanUp()` in its `finally`.
The search e2e test expected "1 results"; the panel now says
"1 result".
* test(diffs): drop i18n subscribers when a test DOM is torn down
CI ran test files in an order where a `VirtualizedFileDiff` left mounted
by `virtualizedEditorViewport.test.ts` was still subscribed to the i18n
store when a later file called `i18n.set()`. The re-render threw into a
DOM that no longer existed and failed every translation test. Bun lists
files in filesystem order, which is alphabetical on macOS and arbitrary
on Linux, so the order never occurred locally.
Patching each leaking test is not reliable, so the DOM harness now
drops every subscriber and restores the English defaults on install and
on cleanup, the same way it already clears the render queue. The fake
DOM harness in `hydration.test.ts` does the same. `i18n.clearSubscribers`
is marked `@internal` for that purpose. The leaking test also cleans up
its instance.
---------
Co-authored-by: Amadeus Demarzi <[email protected]>
* [diffs] Add a labels option for localizing diff text
* feat(diffs): add an i18n store for user-visible diff text
Apps that translate their UI cannot change the English text the diff
renders, such as "12 unmodified lines" or "Expand all". This adds a
package-level `i18n` singleton the app configures once at boot, on the
server and the client, instead of passing text through component
options.
Translations are plain ICU MessageFormat strings, so one JSON config
serves both sides of the server/client boundary. The formatter supports
only what the strings need: `{name}` arguments and one plural block per
string with the CLDR categories, selected through `Intl.PluralRules`
for the configured locale. No dependencies are added.
`DEFAULT_TRANSLATIONS` defines the keys and the English templates;
`DiffsTranslations` is derived from it. `i18n.set()` replaces every
translation and the locale, falls back to English for anything left
out, validates and compiles before changing state, and notifies
subscribers only on a real change. Nothing reads the store yet; the
renderer and component subscriptions follow.
* refactor(diffs): read diff text from the i18n store
Hunk separators and the no-newline marker now take their text from the
`i18n` singleton. The `labels` diff option, its `DiffLabels` type, the
`DEFAULT_DIFF_LABELS` defaults, the `resolveDiffLabels` helper, and the
hand-rolled English plural rule are removed; nothing is passed through
component options any more.
`createSeparator` and `createNoNewlineElement` call `i18n.t()`
themselves, so their signatures return to what they were before the
option existed. With the default English translations the rendered
output is unchanged.
* fix(i18n): add strings for UnresolvedFile
* feat(diffs): re-render mounted diffs when translations change
Switch languages with `i18n.set()` while a diff is on screen and its
hunk separators, no-newline marker, and merge-conflict buttons now
update in place, like a theme change does. Before, new translations
only showed up on the next render for an unrelated reason.
`FileDiff` subscribes to the i18n store where it subscribes to theme
changes, unsubscribes in `cleanUp`, and handles the change with a
plain `rerender()`: separators and injected rows are rebuilt from the
cached highlight on every forced render, so no cache is cleared.
`VirtualizedFileDiff` and `UnresolvedFile` inherit it. `CodeView` does
not subscribe; its mounted items do, and recycled shells hold no
rendered rows.
The merge-conflict action buttons ("Accept current change", "Accept
incoming change", "Accept both") move into `DEFAULT_TRANSLATIONS` and
are read through `i18n.t()` at render time.
* docs(diffs): document the i18n store
Add an Internationalization page: configuring `i18n.set()` once at boot
on server and client, switching languages at runtime from JSON files,
the supported ICU message subset with plural categories, the full key
table with English defaults, and the server-rendering rules. Register
the section with the llms.txt generator so the docs build includes it.
Remove the `labels` option from the React and Vanilla shared-options
examples, since that option no longer exists.
* feat(diffs): read editor search panel text from the i18n store
The search panel's placeholders, match status, option toggles, and
buttons were hard-coded English, so a translated app still showed an
English find-and-replace bar. They now come from `DEFAULT_TRANSLATIONS`
through `i18n.t()`, read when the panel is built, which happens on each
open.
The match count becomes a plural template, so a single match reads
"1 result" instead of "1 results". The docs key table lists the new
keys.
* test(diffs): clean up mounted instances and expect the singular count
CI ran `UnresolvedFile.sequentialResolve.test.ts` before `i18n.test.ts`
in one process. The first mounts an `UnresolvedFile` and never cleans
it up, so it stays subscribed to the i18n store, and the later
`i18n.set()` re-rendered it into a torn-down DOM. Three virtualized
hydration tests left rendered instances behind the same way. Each now
calls `cleanUp()` in its `finally`.
The search e2e test expected "1 results"; the panel now says
"1 result".
* test(diffs): drop i18n subscribers when a test DOM is torn down
CI ran test files in an order where a `VirtualizedFileDiff` left mounted
by `virtualizedEditorViewport.test.ts` was still subscribed to the i18n
store when a later file called `i18n.set()`. The re-render threw into a
DOM that no longer existed and failed every translation test. Bun lists
files in filesystem order, which is alphabetical on macOS and arbitrary
on Linux, so the order never occurred locally.
Patching each leaking test is not reliable, so the DOM harness now
drops every subscriber and restores the English defaults on install and
on cleanup, the same way it already clears the render queue. The fake
DOM harness in `hydration.test.ts` does the same. `i18n.clearSubscribers`
is marked `@internal` for that purpose. The leaking test also cleans up
its instance.
---------
Co-authored-by: Amadeus Demarzi <[email protected]>
Description
Adds a
labelsoption to diff options (andCodeView) for the user-visible text the diff renders:DEFAULT_DIFF_LABELSexport, so existing output is unchanged. An explicitundefinedalso falls back.unmodifiedLinestakes the count so callers can apply their own plural rules. The English default keeps the existingIntl.PluralRules('en-US')logic.getOptionsWithDefaults()and carried on the render context tocreateSeparatorandcreateNoNewlineElement.labelsis added togetDiffHunksRendererOptionsandCODE_VIEW_DIFF_OPTION_KEYSso it reaches the renderer fromFileDiffand fromCodeViewitems. SSR picks it up through the existing options spread.areOptionsEqualalready compareslabelsby reference, likehunkSeparators. A newlabelsobject therefore re-renders, and the docs note that callers should keep it stable.Motivation & Context
These strings are hard-coded in English inside the shadow root, so apps that localize their UI cannot translate them. In Gogs we currently walk every shadow root with a
MutationObserverand rewrite the text after each render, which shows English until the observer runs and breaks whenever the source strings change.A companion PR added the same option to
@pierre/trees(#1272, merged).Type of changes
first discussed with the dev team and they should be aware that this PR is
being opened
You must have first discussed with the dev team and they should be aware
that this PR is being opened
Checklist
contributing guidelines
moon run root:lint)moon run root:format)moonx diffs:test)The "Build, test, lint" CI job passes, including the four new tests in
DiffHunksRender.test.ts.How was AI used in generating this PR
Drafted with Claude Code (Claude Opus 5.5), including the code, tests, docs, and this description.
Related issues
None filed. Companion PR for
@pierre/trees: #1272.