You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(native-chat): move transcript row context into its own hook - #29809
The file that draws the chat transcript grew one line past the size limit, which fails the release check on main. This moves one self-contained piece of it into its own small file. Nothing the user sees changes.
After: the block that assembles the per-row context object (agent name, prompt ids, expand state, link and reveal callbacks) lives in a new hook, use-native-chat-transcript-row-context.ts, next to the list. The list calls the hook with the same values.
Mechanism: a pure move. The hook wraps the same useMemo with the same fields and the same dependency list (session.agent is passed in as agent, hostWork is passed whole so the memo still keys on its identity), so rows get a context that changes exactly when it did before.
Why
Raising or disabling max-lines is not allowed. The row context is the most self-contained part of the component: it only reads values the list already has and returns one object, so moving it carries no risk to ordering between hooks. The navigation state looked like a candidate too, but it feeds the transcript window before the rail exists, so splitting it would mean threading state across a hook boundary.
Linked Issue
N/A (fixes the main release-candidate static-analysis failure, no issue filed).
Visual Proof
N/A: pure code move, no rendering or interaction change.
Testing
Full static-analysis job steps from pr.yml run locally (lint, anti-slop, focused and type-aware code-quality, changed-code quality, React Doctor, max-lines/ts-nocheck/electron-import/focus-read/layout-writer ratchets, localization, generated catalogs, entitlements): all pass. The CI-only bun typecheck:ci wrapper does not run on this machine, so pnpm tc was used instead: passes.
pnpm test src/renderer/src/components/native-chat --maxWorkers=1: 375 files, 3964 tests pass.
macOS only; no platform-specific code touched.
I manually tested these changes locally
Automated tests added/updated, or explained why not below: no new tests, behaviour is unchanged and covered by the existing native-chat suite.
Review
Pure move; no Codex review run (optional for a pure move).
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
No security, cross-platform, SSH, mobile, compatibility, or performance impact: same memo, same inputs, same output.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
NativeChatMessageList now uses useNativeChatTranscriptRowContext to provide transcript row context. The hook derives the agent name and optional actionable prompt IDs, includes the supplied row values and callbacks, and memoizes the resulting context.
Priority: ⬇️ Low
Merge Risk:⚪ Minimal · up to 00b23
The transcript-row context extraction has no established behavior change or outstanding issue; it is ready to merge after normal checks.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Description check
The description covers the change, rationale, testing, visual proof, impact, and checklist. However, it does not provide the required linked issue and instead states N/A.
Add a valid issue reference under the Linked Issue section, or explain the approved maintainer exception if the author is a repository maintainer.
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: moving transcript row context assembly into a dedicated hook.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
ELI5
The file that draws the chat transcript grew one line past the size limit, which fails the release check on main. This moves one self-contained piece of it into its own small file. Nothing the user sees changes.
What Changed
NativeChatMessageList.tsxwas 401 lines against the 400-linemax-linesrule, so the static-analysis job on main (release-candidate check ci: full PR checks on main afea81ba789b — do not merge #29799) failed.use-native-chat-transcript-row-context.ts, next to the list. The list calls the hook with the same values.useMemowith the same fields and the same dependency list (session.agentis passed in asagent,hostWorkis passed whole so the memo still keys on its identity), so rows get a context that changes exactly when it did before.Why
Raising or disabling
max-linesis not allowed. The row context is the most self-contained part of the component: it only reads values the list already has and returns one object, so moving it carries no risk to ordering between hooks. The navigation state looked like a candidate too, but it feeds the transcript window before the rail exists, so splitting it would mean threading state across a hook boundary.Linked Issue
N/A (fixes the main release-candidate static-analysis failure, no issue filed).
Visual Proof
N/A: pure code move, no rendering or interaction change.
Testing
Full static-analysis job steps from
pr.ymlrun locally (lint, anti-slop, focused and type-aware code-quality, changed-code quality, React Doctor, max-lines/ts-nocheck/electron-import/focus-read/layout-writer ratchets, localization, generated catalogs, entitlements): all pass. The CI-only buntypecheck:ciwrapper does not run on this machine, sopnpm tcwas used instead: passes.pnpm test src/renderer/src/components/native-chat --maxWorkers=1: 375 files, 3964 tests pass.macOS only; no platform-specific code touched.
I manually tested these changes locally
Automated tests added/updated, or explained why not below: no new tests, behaviour is unchanged and covered by the existing native-chat suite.
Review
Pure move; no Codex review run (optional for a pure move).
Agent skill upstream boundary
Notes
No security, cross-platform, SSH, mobile, compatibility, or performance impact: same memo, same inputs, same output.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)