mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[PR #813] fix(core): update hitGrid dimensions on all resizes, not just growth #1582
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1582
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/813
Author: @sbbae0318
Created: 3/14/2026
Status: 🔄 Open
Base:
main← Head:fix/hitgrid-resize-dimensions📝 Commits (2)
f9a851cfix(core): update hitGrid dimensions on all resizes, not just growthffe0492test(core): add regression tests for hitGrid resize dimension tracking📊 Changes
2 files changed (+143 additions, -2 deletions)
View changed files
➕
packages/core/src/tests/scrollbox-hitgrid-resize.test.ts(+136 -0)📝
packages/core/src/zig/renderer.zig(+7 -2)📄 Description
Fixes #812
Summary
hitGridWidth/hitGridHeightwere only updated inside theif (newHitGridSize > currentHitGridSize)block, so shrinking the terminal (e.g. making it narrower but taller) left stale dimensions in place.checkHitthen returned 0 for any coordinate past the old bounds, breaking mouse event dispatch for the bottom portion of the screen.Changes
packages/core/src/zig/renderer.zig: MovehitGridWidth/hitGridHeightassignment out of the reallocation guard so they track the actual terminal size on every resize.packages/core/src/tests/scrollbox-hitgrid-resize.test.ts: Add regression tests covering hit grid behavior after terminal shrink and multi-cycle resizes.The backing buffer was allocated for the larger dimensions, so using a smaller width*height against it is safe -- every index
y * hitGridWidth + xstays within the allocated capacity.Testing
Three regression tests added:
All 3926 existing tests continue to pass.
Reproduction
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.