Skip to content

feat(header): say Reconnecting… and then Connected in the header's title area - #2606

Merged
devswha merged 1 commit into
mainfrom
feat/reconnect-header
Nov 2, 2026
Merged

devswha merged 1 commit into
mainfrom
feat/reconnect-header

Conversation

@devswha

@devswha devswha commented Nov 2, 2026

Copy link
Copy Markdown
Owner

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

  • Reconnecting… replaces the crumb (PC › workspace › folder) while a connection this page had is lost. Once the connection is back, the line says Connected for two seconds, then the crumb returns (src/lib/headerConnection.ts).
  • Layout: from 769px the line sits on the title's line. At ≤768px it goes under the title, and both lines fit inside the header's existing height, so the header does not grow and nothing below it moves. The line is swapped in place and never animated. While it shows, the chip keeps only its dot (.conn-quiet); the chip's word is still there for screen readers and in its tooltip.
  • Scope: the line follows the PC the header shows, separately for each split half (<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 stalls: a stall (output_stalled) shows no line, because ws.ts retries nothing after a stall. The chip still says Disconnected.
  • Drafts: nothing typed is sent when the connection returns. Drafts stay drafts, including text typed while reconnecting.
  • i18n: the keys "Reconnecting…" and "Connected" already exist in ko, ja and zh, so this PR adds no new strings.
  • Demo: ?demo_connection=switch adds herdrDemoLoseConnection() and herdrDemoRestoreConnection() for the regression and the screenshots.
  • Docs: a DESIGN.md entry under "Header context and connection" and a changelog fragment.

Screenshots (demo build, Codex dark)

Before (main) After
Reconnecting, 390
Reconnecting, 412
Back: Connected (2 s), 390
Back: Connected (2 s), 412
Desktop 1280, reconnecting
Desktop 1280, Connected

The full set is on the qa-evidence/reconnect-header branch: live, reconnecting and connected at 390, 412 and 1280.

Validation

  • Failing first: src/lib/headerConnection.test.ts failed 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).
  • Browser: scripts/reconnect-header-demo-regression.ts (added to ci-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).
  • Reviews:
    • Codex (gpt-6.1-terra, xhigh) found no blockers. Fixed from it: no "Reconnecting…" for a stalled output, scope per split half, the demo restore settling attempts left pending, and the regression typing during the outage. Declined: reserving two lines in the normal phone header, which would redesign the everyday header (the header height is asserted unchanged instead).
    • omo code review requested changes for one MAJOR, now fixed: activating the other split half on the same PC could flash a false Connected, because the previous half's facts lingered one render. The line now trusts only facts reported by the half it is about (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.
  • Not run: the full browser lane and 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.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5845016 and 49ab7ae.

Files selected for processing: 10
  • DESIGN.md
  • changelog.d/reconnect-header.md
  • scripts/ci-browser.sh
  • scripts/reconnect-header-demo-regression.ts
  • site/demo/transport.ts
  • src/App.tsx
  • src/lib/headerConnection.test.ts
  • src/lib/headerConnection.ts
  • src/lib/useConnectionChip.ts
  • src/styles.css

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

Summary

Summary by CodeRabbit

  • New Features
    • The pane header now shows “Reconnecting…” when the displayed connection is lost, and “Connected” briefly after it returns, before restoring the location breadcrumb.
    • The status applies to the currently displayed PC or split pane and appears without changing the header’s height or animating.
    • While reconnecting, the connection chip shows its dot without visible text. Drafts remain unsent when the connection returns, including text entered while offline.

The pane header now shows “Reconnecting…” during qualifying connection loss and “Connected” for two seconds after recovery. The status is scoped to the displayed pane. Demo controls and browser tests cover loss, restoration, draft retention, and responsive layout.

Changes: Pane header reconnect status

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: showing “Reconnecting…” and “Connected” in the header title area.
Description check Passed 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 di…
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.
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.

Share

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread src/lib/headerConnection.ts Resolved
…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.
@devswha
devswha force-pushed the feat/reconnect-header branch from 49ab7ae to 576527a Compare November 2, 2026 07:51
@devswha

devswha commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

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.

@devswha
devswha merged commit 7aecb24 into main Nov 2, 2026
13 checks passed
@devswha
devswha deleted the feat/reconnect-header branch November 2, 2026 08:31
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