feat: switch TUI from full-screen to inline viewport#8
Merged
Conversation
Use ratatui::init_with_options with Viewport::Inline(24) so the UI renders below the invoked command rather than taking over the full screen. Scrollback and prior terminal output remain visible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ratatui::init()(alternate-screen full-screen mode) withratatui::init_with_options(TerminalOptions { viewport: Viewport::Inline(24) })insrc/main.rsChanges
src/main.rs— one-line swap of the terminal init call:ratatui::init()→ratatui::init_with_options(ratatui::TerminalOptions { viewport: ratatui::Viewport::Inline(24) })ratatui::restore()is unchanged and leaves the terminal cleanThe inline height of 24 rows accommodates the most demanding screen (
RenameForm, which has 13 fixed-height rows + aFill(1)list), leaving 11 rows for the author list. All other screens are less constrained.Verification
src/tui/render.rslayouts useConstraint::Fill(1)throughout, so they adapt to the inline area without any layout changestests/main_integration_test.rstest pre-TUI error paths (not-a-repo, not-a-TTY) and are unaffected by the viewport mode changeratatui::Viewport::Inlineandratatui::TerminalOptionsare stable public API since ratatui 0.25; confirmed available in the lockedratatui 0.30.0Fixes #7