Skip to content

fix(native-chat): show the message rail from the first user message - #25707

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/fix-structured-chat-message
Oct 6, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/fix-structured-chat-message

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4

ELI5

Short native chats hid the thin message bar on the right until you had sent three messages. The bar now appears from your first message, giving you the existing prompt previews and navigation in short conversations.

What Changed

  • The existing visibility hook now requires at least one user message instead of three. Its unused minimum-count constant is removed, and its test covers one-message visibility and an empty chat.
  • Empty chats still have no bar. The existing 512 px pane-width gate remains. Preview, selection, scrolling and history navigation use the existing implementation.
  • Current main is integrated. A supporting test-only correction removes a duplicate Codex handle-helper import inherited from main; journal assertions and product behavior are unchanged.

Why

The count restriction caused the missing control. Removing that policy at its existing owner makes short chats use the same navigation as longer chats, without adding state or another control. Empty and narrow panes keep their existing policy.

Linked Issue

N/A (maintainer request)

Visual Proof

Windows high-spec Electron, final head 64d217347e35, driven by OpenCode Muse Spark 1.3 Free. These are full hidden-renderer screenshots of a controlled one-message transcript in the real app. The before build temporarily restored the old three-message threshold; the after build restored the final source and rebuilt it. No desktop input or foregrounding was used.

Before: the one-message chat has no rail.

Windows before: one-message chat without the rail

After: the same transcript content has one rail tick.

Windows after: one-message chat with a rail tick

Hovering that tick opens the existing prompt preview.

Windows after: prompt preview

The coordinator inspected all three original PNGs and verified the uploaded bytes against their SHA-256 hashes.

Testing

  • Updated-head targeted Vitest run with --config config/vitest.config.ts: all 41 tests pass across the three rail test files and the journal fixture test.
  • Renderer typecheck passed through tc-gate on the earlier integration; the rail patch is byte-identical on the updated head. Scoped Node typecheck also passed on the final head through tc-gate.
  • All four changed files pass lint and formatting. Changed-code quality passes with zero new findings.
  • CI static analysis/typecheck and relay integration pass. The old/new compatibility job is red because three released-code suites cannot load missing @streamparser/json; no compatibility assertions run in those suites. Separate harness fix deferred. Latest CI is terminal red with the same two failures plus aggregate verification. Four test shards and both packaging jobs (including Windows) pass; shard 1 also fails the Windows multiline startup-prompt expectation at startup-line-prompt-carry.test.ts:198. Related source/test files match main; separate investigation deferred. Aggregate verification is red.
  • I manually tested these changes locally (Windows checks used automated hidden Electron, not desktop interaction)
  • Windows Electron: seeded transcript with no user messages hides the rail; one message shows one tick and a hover preview, Enter focuses its picker, Escape closes it, and selecting the prompt closes the panel. Two/three-message tick and preview counts, light/dark capture and shrink/regrow also passed. The final whole suite passed five tests, then the resize case passed after replacing a fixed delay with polling; six scenarios passed across runs, not a final 6/6 suite. A separate measured-width run observed 512 px shown and 511 px hidden. Windows unit tests passed 80/80. The coordinator recovered and read the original command outputs and temporary test code. Tab, precise final scroll position, a fully empty loaded-chat flow, a live provider conversation and native window focus were not exercised.
  • Automated tests added/updated, or explained why not below

Review

Fresh adversarial and issue-first architecture reviews found no proven rail defect. Fresh narrow reviews checked the supporting fixture repair and final main integration. The final diff preserves the original rail patch and all journal assertions. The readiness checklist was applied without counsel as requested. Windows background Electron rendering and the one-message preview/focus/selection flow were exercised with controlled transcripts; before/after proof is attached.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No production host-execution, mobile-facing contract, persistence, or wire change. No runtime performance benchmark or rendered mobile, WSL, Linux, macOS, or live SSH check was performed. The hook's existing state derivation and bounded sampling are unchanged.

Author: @BrennanKB5

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)

brennanb2025 and others added 4 commits October 5, 2026 15:56
The rail on the right of native chat stayed hidden until a conversation had
three user messages, so short chats had no rail at all. Show it whenever there
is at least one user message (still hidden in panes too narrow for it).

Co-Authored-By: Claude <[email protected]>
@brennanb2025

brennanb2025 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Short native chats hid the message bar on the right until you had sent three messages. The bar now appears from your first message. Empty chats still have no bar, and the existing 512 px minimum pane width remains; previews and navigation use the existing control.

Fresh adversarial and issue-first architecture reviews found no proven rail regression or reason to expand the design. Current main is integrated and the original rail patch is unchanged. The supporting test-only import duplication (P2) is fixed in 64d217347e35, with all journal assertions preserved; fresh narrow review verified the final diff.

Verified locally: all 41 targeted rail/journal tests, scoped Node typecheck, renderer typecheck on the unchanged rail patch, and changed-file lint, formatting and code-quality checks. Latest CI has settled red with the same two failures plus aggregate verification. Typechecking, four test shards, relay integration and both packaging jobs—including Windows—pass.

Two separate P2 check failures remain deferred:

  • The old/new compatibility job cannot load three release v1.4.221 suites because @streamparser/json is missing. Those suites reach no compatibility assertions.
  • Node test shard 1 fails src/shared/startup-line-prompt-carry.test.ts:198: the Windows multiline-prompt test expects promptCarried to be false and receives true.

The affected harness, dependency and startup-policy files match main. I read the actual failure logs and source; I did not independently reproduce main CI or locally reproduce these separate failures. The aggregate verification job is red because these two checks failed. No rail defects are deferred.

Windows high-spec Electron QA now ran on the final head, driven by OpenCode Muse Spark 1.3 Free. The real hidden app rendered controlled transcripts; the coordinator directly checked the one-message rail, hover preview, Enter-to-focus/Escape-to-close and click selection evidence. The attached before/after images show the same transcript content without the rail under the old threshold, then with one tick under the restored final source. The coordinator inspected the original PNGs and verified GitHub serves matching bytes.

Before:

Windows before: one-message chat without the rail

After:

Windows after: one-message chat with the rail

Hover preview:

Windows after: prompt preview

Limits: transcripts were seeded; a live provider conversation, native window focus, mobile, WSL, Linux/macOS rendering, live SSH and a runtime performance benchmark were not exercised. The coordinator recovered and read the actual test history and temporary test code. Six scenarios passed across the final five-test pass and the corrected resize rerun: zero user messages (assistant-only transcript), one/two/three messages, shrink/regrow, and theme capture. A separate measured-width run observed 512 px shown and 511 px hidden. Windows unit tests passed 80/80. This was not one final 6/6 suite run. Tab, exact post-selection scroll position and the fully empty-file loader were not verified as successful flows.

The PR is open and ready for review, with the two CI failures above explicitly deferred. It is unmerged and auto-merge is disabled.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 6, 2026 00:27
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 63e4bc1e-d879-4cab-b7b3-3a6e6d7241ed
📥 Commits

Reviewing files that changed from the base of the PR and between e43a9f7 and 64d2173.

📒 Files selected for processing (4)
  • src/main/native-chat/agent-session-journal/journal-submission-positions.test.ts
  • src/renderer/src/components/native-chat/native-chat-message-rail-items.ts
  • src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-message-rail.ts
💤 Files with no reviewable changes (2)
  • src/main/native-chat/agent-session-journal/journal-submission-positions.test.ts
  • src/renderer/src/components/native-chat/native-chat-message-rail-items.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The message rail no longer uses a minimum item count of three. When the rail is wide enough, it is visible with one or more items and hidden when empty. Tests now cover these cases and expect ticks for all three user messages. An earlier duplicate import was also removed from a separate test file.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 64d21

No actionable risk introduced by this change is evident. The reported CI failures are described as unrelated to the rail changes.

Architecture Summary

Architecture risk: 🔵 Low · up to 64d21

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (ui) was modified; 4 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in src/main/native-chat/agent-session-journal/journal-submission-positions.test.ts: Removed an earlier codexProviderHandle import; a later import of the same symbol remains.
  • observed — Modified behavior in src/renderer/src/components/native-chat/native-chat-message-rail-items.ts: Removed the exported NATIVE_CHAT_RAIL_MIN_ITEMS constant, previously set to 3.
  • observed — Modified behavior in src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts: Renames the test to expect ticks for every user message and visibility starting with the first one, replacing the prior expectation that short histories hide the rail.
  • observed — Modified behavior in src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts: Replaces the assertion that a one-user-message rail is hidden with an expectation that it is visible, and adds a check that an empty rail is hidden.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: showing the native-chat message rail from the first user message.
Description check ✅ Passed The description covers the required template sections with a clear rationale, change summary, linked-issue explanation, visual proof, testing details, and checklist. Its claims of Windows Electron QA …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • Message rail now shows from the first user message — useNativeChatMessageRail returns visible: wideEnough && items.length > 0, so a chat with a single user message shows the rail. Empty chats and panes narrower than 512px still hide it; previews, selection, scrolling and history navigation are unchanged.
  • Unused minimum constant removed — NATIVE_CHAT_RAIL_MIN_ITEMS (3) is deleted from native-chat-message-rail-items.ts, with no remaining references repo-wide.
  • Visibility test updated — the hook test now asserts one-message visibility (exact toBe(true)) and an empty-chat case (toBe(false)) in place of the old "hides below the minimum" expectation. The single-message assertion fails against the old >= 3 gate, so it is real coverage, not theatre.
  • Duplicate test import removed — journal-submission-positions.test.ts carried two identical codexProviderHandle imports on the base; one is dropped. Test-only, no product behavior change.

I ran the four rail-related renderer specs (39 tests) against the head: all pass. The static analysis and typecheck CI job passes; the two red checks (cross-version wire compatibility and the verify aggregator) cover suites this diff does not touch.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 merged commit 08a970a into main Oct 6, 2026
54 of 60 checks passed
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.

1 participant