Skip to content

Anchor zone to bottom from startup#156

Merged
shellicar merged 2 commits intomainfrom
feature/153-zone-anchor-bottom
Mar 29, 2026
Merged

Anchor zone to bottom from startup#156
shellicar merged 2 commits intomainfrom
feature/153-zone-anchor-bottom

Conversation

@shellicar
Copy link
Copy Markdown
Owner

Summary

  • Zone anchored to bottom of screen on launch, not the top
  • Startup messages visible in history region before first query

Related Issues

Closes #153

Two fixes so the zone renders at the bottom of the screen on launch:

1. Remove empty-displayBuffer short-circuit in renderZone(): always resolve
   through HistoryViewport so padding rows fill the history region even when
   displayBuffer is empty. The viewport already returns Array(rows).fill('')
   for an empty buffer, so trailing-trim never removes padding (zone content
   is always at the bottom).

2. Always push to displayBuffer in writeHistory() regardless of inAltBuffer.
   Startup messages (version, session info) are written before enterAltBuffer()
   and previously bypassed displayBuffer entirely. With this fix the first
   renderZone() call after entering alt buffer sees the startup messages in
   displayBuffer and the history viewport displays them above the zone.

Closes #153
@shellicar shellicar added this to the 1.0 milestone Mar 29, 2026
@shellicar shellicar added the bug Something isn't working label Mar 29, 2026
@shellicar shellicar self-assigned this Mar 29, 2026
@shellicar shellicar enabled auto-merge (squash) March 29, 2026 18:17
Copy link
Copy Markdown
Collaborator

@bananabot9000 bananabot9000 left a comment

Choose a reason for hiding this comment

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

Two surgical changes, both correct:

  1. Short-circuit removal in renderZone() -- empty displayBuffer resolves through HistoryViewport like everything else. Padding rows push zone to bottom. 5 lines to 2.

  2. displayBuffer always populated in writeHistory() -- one line moved above if (inAltBuffer). Startup messages visible in history region on first render. Correctly avoids historyBuffer (already in main buffer via screen.write()).

Design artifacts in session log cover all edge cases: trailing-trim safety (padding at top, zone at bottom), pause buffer interaction, zone-fills-screen guard. Tests updated and new startup message test added. 219 passing.

LGTM.

Co-reviewed-by: BananaBot9000

@shellicar shellicar merged commit 9d1f590 into main Mar 29, 2026
4 checks passed
@shellicar shellicar deleted the feature/153-zone-anchor-bottom branch March 29, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zone should anchor to bottom of screen from startup

2 participants