Skip to content

Prevent sticky zone from overflowing terminal viewport#145

Merged
shellicar merged 3 commits intomainfrom
fix/sticky-zone-viewport-overflow
Mar 28, 2026
Merged

Prevent sticky zone from overflowing terminal viewport#145
shellicar merged 3 commits intomainfrom
fix/sticky-zone-viewport-overflow

Conversation

@shellicar
Copy link
Copy Markdown
Owner

Summary

  • Track scroll offset to keep editor within available terminal rows
  • Snap scroll offset to logical line boundaries to avoid mid-wrap rendering
  • Cap scroll so content never goes past the end of editor content

Related Issues

Closes #134

Co-Authored-By: Claude noreply@anthropic.com

@shellicar shellicar added this to the 1.0 milestone Mar 28, 2026
@shellicar shellicar added the bug Something isn't working label Mar 28, 2026
@shellicar shellicar self-assigned this Mar 28, 2026
@shellicar shellicar enabled auto-merge (squash) March 28, 2026 14:32
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.

The updated version addresses the height budget concern from my earlier review. The implementation is clean and well-structured:

What I like:

  • Components pre-built into typed parts before budget allocation — clean separation of "what exists" from "what fits"
  • Priority-based drop order (preview → attachments → questions → status) matches user expectations
  • minEditorRows = 1 guarantee prevents the editor from disappearing entirely
  • lineStartRow[] map for O(1) viewport slicing instead of re-scanning
  • Cursor chasing with scrollOffset max cap and line boundary snapping
  • visibleCursorRow = cursorRow - scrollOffset — simple and correct

Minor observations (non-blocking):

  • The scroll offset logic is straightforward — it's literally a number that goes up and down, capped at bounds. No complexity concerns.
  • Terminal disappearing (VS Code drag-to-hide) bottoms at rows=2 per testing, so the minEditorRows=1 guard covers this naturally.

Solid implementation. 👍

@shellicar shellicar merged commit 81a1e5a into main Mar 28, 2026
4 checks passed
@shellicar shellicar deleted the fix/sticky-zone-viewport-overflow branch March 28, 2026 15:27
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.

Sticky zone overflow when taller than terminal viewport

2 participants