Skip to content

Fix terminal resizing crash in TUI app#584

Merged
chernistry merged 1 commit into
mainfrom
bernstein/task-6e9a847923c6
Apr 8, 2026
Merged

Fix terminal resizing crash in TUI app#584
chernistry merged 1 commit into
mainfrom
bernstein/task-6e9a847923c6

Conversation

@chernistry

Copy link
Copy Markdown
Collaborator

Fix terminal resizing crash in TUI app

Fix terminal resizing crash in TUI app

Description

Rapidly resizing the terminal while the TUI is running can cause layout calculation errors and crashes in Textual. Add a resize debounce handler that delays layout recalculation until resizing settles (200ms debounce) and catches layout errors gracefully.

Role: frontend
Model: sonnet
Tests: All 17 tests pass (previously 11 passed + 6 skipped). Now let me run lint:


Generated by Bernstein — task 6e9a847923c6

…sts (TUI-002)

- Add RESIZE_DEBOUNCE_S (200ms), _resize_timer, on_resize, _apply_resize to tui/app.py BernsteinApp matching dashboard.py pattern
- Remove @pytest.mark.skip from TestResizeDebounce — all 6 tests now pass
- TUI-002 viewport clipping already implemented in dashboard.py; all 11 viewport tests pass

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

AI Review (Gemini)

Gemini review could not be generated (HTTP 503).

@github-actions github-actions Bot added the size/s label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

AI Review (GitHub Models)

Summary

The pull request addresses a critical issue that causes the TUI (Text User Interface) application to crash during terminal resizing events. By implementing proper error handling and state management during these events, the change enhances the robustness and user experience of the application.

Risk Assessment

Medium: While the fix is aimed at preventing crashes, any changes around terminal interactions can introduce new UI behavior issues. There's a potential for regression if other parts of the application rely on the previous handling of resize events.

Actionable Recommendations

  • Thorough Testing: Ensure comprehensive tests are added that simulate various terminal resizing scenarios.
  • Code Review: Have another maintainer double-check the error handling logic to ensure all edge cases are addressed.
  • Documentation: Update the relevant sections of the documentation to reflect any changes in TUI behavior due to the fix.
  • User Feedback: After merging, gather user feedback to monitor for any unexpected changes in usability.
  • Versioning

@kilo-code-bot

kilo-code-bot Bot commented Apr 8, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src/bernstein/tui/app.py - Added resize debounce mechanism with proper error handling
  • tests/unit/test_tui_resize.py - Removed skip markers and added comprehensive tests for debounce functionality

Reviewed by grok-code-fast-1 · 166,143 tokens

@sonarqubecloud

sonarqubecloud Bot commented Apr 8, 2026

Copy link
Copy Markdown

@chernistry chernistry deleted the bernstein/task-6e9a847923c6 branch April 8, 2026 09:49
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

CI Summary

Check Result
Repo hygiene ✅ success
Lint ✅ success
Type check ✅ success
Tests ✅ success
Spelling ✅ success
Dead code ✅ success
Workflow lint ✅ success
Dist size ✅ success
SonarCloud ✅ success

Coverage and detailed reports are available via Codecov and the Checks tab.

chernistry added a commit that referenced this pull request Apr 30, 2026
…sts (TUI-002) (#584)

- Add RESIZE_DEBOUNCE_S (200ms), _resize_timer, on_resize, _apply_resize to tui/app.py BernsteinApp matching dashboard.py pattern
- Remove @pytest.mark.skip from TestResizeDebounce — all 6 tests now pass
- TUI-002 viewport clipping already implemented in dashboard.py; all 11 viewport tests pass

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant