Repository navigation
feat(header): say Reconnecting… and then Connected in the header's title area - #2606
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Track scoped connection changes src/lib/headerConnection.ts, src/lib/useConnectionChip.ts, src/lib/headerConnection.test.ts |
Connection tracking records qualifying loss and same-scope recovery. Tests cover first connections, output stalls, scope mismatches, and split-pane reports. |
Render status in the pane header src/App.tsx, src/styles.css, DESIGN.md, changelog.d/reconnect-header.md |
App derives status for the active pane and displays it in place of the breadcrumb. Styles control the responsive layout and quiet connection chip. Design notes and the changelog describe the behavior and draft handling. |
Exercise reconnect behavior in the demo site/demo/transport.ts, scripts/reconnect-header-demo-regression.ts, scripts/ci-browser.sh |
Demo transport controls simulate connection loss and restoration. Browser regression checks cover two mobile widths and one desktop width, including status placement and draft retention. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Suggested reviewers: haeminway1
Merge Risk: 
Low · previous review 49ab7
-
The header can briefly show the breadcrumb during recovery, and the new browser test can fail despite a successful reconnection. Both are bounded issues worth fixing, but neither indicates a broad production failure.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description is complete and on-topic. It explains the behavior, scope, layout, draft handling, screenshots, validation results, skipped checks, and known test limitations. It does not include a direct issue link for the stated maintainer approval, but the required Change and Validation sections are present and detailed.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 7 files. (3 skipped: 3 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- 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.
…tle area A dropped connection was only a small dot in the header and a grey word in the composer. The title area now says Reconnecting… in the crumb's place (under the title on a phone), then Connected for two seconds once the connection is back, then the crumb again, as WhatsApp and Telegram do. Per PC and per split half; a stalled output, which retries nothing, is left to the chip. Drafts are never sent by the return.
49ab7ae to
576527a
Compare
|
Mobile UX review item 3, on the owner's OK. Merge-pass review: client-only. When the selected PC's connection drops after this page had it, the header's title area says Reconnecting… in place of the crumb (and Connected for a moment when it comes back), in the same box so nothing moves; the chip keeps only its dot meanwhile. The line is scoped to the active split half and PC (reportedBy), a pane's first connection is not called a reconnect, and a stalled output stays the chip's Disconnected. Unit tests for the line's states and a demo regression (reconnect-header-demo-regression.ts, added to ci-browser.sh) cover it. CodeRabbit's two Minors were fixed in 576527a: Connected is said in the render the connection lands, so the crumb never flashes between Reconnecting… and Connected (a unit case fails on the old rule), and the demo regression watches for Connected with a MutationObserver armed before the connection is restored. CodeRabbit's check shows skipping on this head; the merge pass reviewed it. |
Why
The owner approved this from the mobile UX review (item 3). When the connection dropped, Ovis showed only a small pulsing dot in the header and a grey "Reconnecting…" in the composer, which is easy to miss on a phone. This PR says it plainly in the header's title area, the way WhatsApp and Telegram say "Connecting…" under a chat's name.
Change
src/lib/headerConnection.ts)..conn-quiet); the chip's word is still there for screen readers and in its tooltip.<slot>:<machineId>). A recovery on one PC or half is never announced on another, and a pane's first connection is not a reconnect. Relay and direct connections share the socket state, so both get the line.output_stalled) shows no line, becausews.tsretries nothing after a stall. The chip still says Disconnected.?demo_connection=switchaddsherdrDemoLoseConnection()andherdrDemoRestoreConnection()for the regression and the screenshots.Screenshots (demo build, Codex dark)
The full set is on the
qa-evidence/reconnect-headerbranch: live, reconnecting and connected at 390, 412 and 1280.Validation
src/lib/headerConnection.test.tsfailed before the module existed. It now passes 10/10 and covers the state → header text mapping and sequences over time through a pure step function: a stalled output, a PC switch, and the other split half on the same PC (a mutation check removing the reporting-half guard fails that case with a false Connected).scripts/reconnect-header-demo-regression.ts(added toci-browser.sh) passes at 390, 412 and 1280 (reduced motion off, so any animation fails it). It checks that no line shows on load or after a pane switch on a connected PC. While reconnecting it checks that the word is whole and inside the title area, the title is not cut down to make room for it, the word and title are drawn inside the header's fixed height, the line is not animated and the draft is kept; after the return it checks for Connected, then the crumb, with nothing sent. A mutation check (the phone stacking rule removed) fails it at 390: "the pane title keeps its room".bun run check fast: passed (typecheck, build, unit tests 10612 pass, 0 fail).reportedBy). Its minor notes are fixed too: sequence tests, the header-box assertion, the false-line checks, a shrinkable word, and the DESIGN reason. Declined: merging the duplicated visually-hidden CSS, because the second copy sits inside a media query.check full(CI runs them). No real phone. The exact two-second duration is not tested with a controlled clock.The owner approved this (mobile UX review, item 3). Once it is green, please merge so he can check it on main.