Skip to content

feat(shell): paint a rule row under the fullscreen status line - #1250

Merged
Alan-TheGentleman merged 1 commit into
Gentleman-Programming:mainfrom
carolitascl:feat/header-rule-line
Sep 20, 2026
Merged

Alan-TheGentleman merged 1 commit into
Gentleman-Programming:mainfrom
carolitascl:feat/header-rule-line

Conversation

@carolitascl

@carolitascl carolitascl commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Closes #1249

PR Type

New feature (type:feature)

Summary

  • Paint a full-width rule directly under the fullscreen status bar in the editor frame's border role, so the status row and the prompt read as one panel.
  • Let the fullscreen layout measure the header leaf (basis: "auto") instead of pinning one row, so the extra line is not clipped.
  • Keep the usage click affordance bound to the status row; the rule row is decorative.
  • Responsive by construction: the rule renders only while the fullscreen sidebar is active and disappears with it below the sidebar breakpoint.

Changes

File Change
lib/shell-bar.ts Add renderShellHeaderRule(theme, width) — full-width border-role rule.
extensions/gentle-shell.ts Render the rule as the header rail's second line; gate the usage click to row 0.
lib/shell-sidebar-layout.ts Measure the header leaf (basis: 1"auto"); refresh stale comments.
tests/shell-bar.test.ts Unit tests for the rule (border role, full width, zero/negative clamps).
tests/shell-sidebar-layout.test.ts Measured-basis assertion, two-line header passthrough, below-breakpoint removal, header width minus the rail inset.

Test Plan

  • node --experimental-strip-types --test tests/shell-bar.test.ts tests/shell-sidebar-layout.test.ts tests/shell-sidebar.test.ts tests/gentle-shell.test.ts — 162 tests pass
  • pnpm run typecheck — exit 0
  • No shell scripts modified — shellcheck N/A
  • Visual check in a ≥140-column terminal (pi -e ./extensions/gentle-shell.ts): rule under the status bar, gone below the breakpoint

Contributor Checklist

  • Linked an issue (Closes #1249) — awaiting maintainer status:approved on the issue
  • Added exactly one type:* label — requires triage permission; please add type:feature
  • Conventional commit format (feat(shell): paint a rule row under the fullscreen status line)
  • No Co-Authored-By trailers

Summary by CodeRabbit

  • New Features

    • Added a full-width decorative divider beneath the shell status line when the fullscreen sidebar is active.
    • The divider adapts to the available width and displays correctly across one- and two-line header layouts.
  • Bug Fixes

    • Prevented the decorative divider from responding to mouse clicks.
    • Improved header sizing so both status and divider rows render without clipping or layout issues.
    • Ensured the divider remains hidden below the sidebar breakpoint.

Add renderShellHeaderRule — one full-width "─" line in the editor
frame's border role — and render it as the fullscreen header rail's
second line so the status bar and the prompt read as one panel. The
header vstack entry switches to basis "auto" so pi-tui measures the
leaf's rendered lines instead of pinning a single row, and the usage
click affordance stays bound to the status row only.

Responsive by construction: the rule renders only while the fullscreen
sidebar is active; below the sidebar breakpoint (or outside
fullscreen) the header rail never paints and the rule is removed with
it. The compact bottom bar is untouched.

Tests: renderShellHeaderRule unit cases (border role, full width,
clamps), two-line header passthrough at full terminal width, and
below-breakpoint removal of the rule row.
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 5b183f70-7757-4be0-ad74-c67ad08f7b59

📥 Commits

Reviewing files that changed from the base of the PR and between 5454832 and f39f304.

📒 Files selected for processing (5)
  • extensions/gentle-shell.ts
  • lib/shell-bar.ts
  • lib/shell-sidebar-layout.ts
  • tests/shell-bar.test.ts
  • tests/shell-sidebar-layout.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The fullscreen shell header now renders a border-colored horizontal rule beneath the status line. The layout measures the header content automatically, and clicks on the rule row are ignored. Below the sidebar breakpoint, the rule is not rendered.

Changes

Fullscreen header rule

Layer / File(s) Summary
Rule rendering
lib/shell-bar.ts, tests/shell-bar.test.ts
Adds renderShellHeaderRule, which paints a width-clamped rule with the border theme role. Tests cover themed, plain, zero-width, and negative-width output.
Header integration
extensions/gentle-shell.ts, lib/shell-sidebar-layout.ts
Adds the rule as a second fullscreen header row, ignores clicks outside the status row, and changes the header basis to "auto".
Responsive layout validation
tests/shell-sidebar-layout.test.ts
Updates layout types and expectations for automatic sizing. Tests cover two-line fullscreen rendering and no rule below the sidebar breakpoint.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant ShellHeader
  participant ShellRuleRenderer
  participant SidebarLayout
  ShellHeader->>ShellRuleRenderer: Render rule for theme and width
  ShellRuleRenderer-->>ShellHeader: Return border-colored rule row
  ShellHeader->>SidebarLayout: Provide status and rule rows
  SidebarLayout-->>ShellHeader: Measure header with auto basis
Loading

Suggested reviewers: alan-thegentleman

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding a decorative rule row beneath the fullscreen status line.
Linked Issues check ✅ Passed Issue #1249 has coding requirements, and the reviewed head meets them. renderShellHeaderRule returns a line with Math.floor(width) width, clamps negative widths to zero, and applies the `borde…
Out of Scope Changes check ✅ Passed The changes stay within Issue #1249. They add the rule renderer, integrate it into the fullscreen header rail, change header measurement to support the second line, preserve status-row click handling,…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@Alan-TheGentleman Alan-TheGentleman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. The change is well-contained and the hard parts are done right.

I verified the layout and mouse behavior against pi-tui 0.85.1:

  • basis: "auto" is the right fix: pi-tui measures the leaf by rendering it, so the two-line header sizes itself instead of being clipped by the old hard basis: 1.
  • The event.y !== 0 gate is correct: mouse events arrive box-relative, so row 0 keeps the usage affordance and the rule row is inert, exactly as intended.
  • Both header lines render at the same width (terminal width minus the header right inset), and the Math.max(0, Math.floor(width)) clamp covers the degenerate cases.

Spot checks on my side: 162 tests pass across the four touched suites, and pnpm run typecheck reports no regressions.

One non-blocking nit for context: headerActive now keys off any non-blank header line, and the rule is always non-blank, so the header stays active even if renderShellHeaderBar ever returned empty text. That only happens below the width where even the bare brand fits, which is unreachable at fullscreen widths, so no change needed. Just worth knowing the rule now keeps the header alive on its own.

Nice work, the tests cover exactly the behavior that could regress.

@Alan-TheGentleman Alan-TheGentleman added the type:feature New feature label Sep 20, 2026
@Alan-TheGentleman
Alan-TheGentleman merged commit 40e9135 into Gentleman-Programming:main Sep 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a responsive rule line under the fullscreen status bar

2 participants