Skip to content

resizable viewport #1732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 31, 2025
Merged

resizable viewport #1732

merged 11 commits into from
Jul 31, 2025

Conversation

nornagon-openai
Copy link
Collaborator

@nornagon-openai nornagon-openai commented Jul 29, 2025

Proof of concept for a resizable viewport.

The general approach here is to duplicate the Terminal struct from ratatui, but with our own logic. This is a "light fork" in that we are still using all the base ratatui functions (Buffer, Widget and so on), but we're doing our own bookkeeping at the top level to determine where to draw everything.

This approach could use improvement—e.g, when the window is resized to a smaller size, if the UI wraps, we don't correctly clear out the artifacts from wrapping. This is possible with a little work (i.e. tracking what parts of our UI would have been wrapped), but this behavior is at least at par with the existing behavior.

Screen.Recording.2025-07-29.at.4.03.50.PM.mov

cc @joshka who might have Thoughts™

@nornagon-openai nornagon-openai mentioned this pull request Jul 30, 2025
Base automatically changed from nornagon/remove-conversation-history to main July 30, 2025 17:05
@nornagon-openai nornagon-openai marked this pull request as ready for review July 30, 2025 19:45
@nornagon-openai nornagon-openai changed the title wip resizable viewport resizable viewport Jul 30, 2025
Copy link

Choose a reason for hiding this comment

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

Just a quick reminder. Please follow the MIT license conditions. The easiest way is to copy the license into your NOTICES file. I encourage liberal copying and modification of source code like this, with appropriate attribution being the only real requirement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pulled it into this file directly, i'm not sure exactly how our distribution works and what notices are shipped with the binaries but would be happy to include this notice there too.

Copy link

Choose a reason for hiding this comment

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

This sounds ok to me. I don't recall exactly whether any runtime license notice requirement is required. When I last researched this I was unable to find any definitive guidance on what the right approach is. I suspect every company at some point has this come up and lawyers work out an interpretation that works for them™ ;)

I've been meaning to sometime broach with the rest of the team making Ratatui dual licensed as Apache 2, and doing the right thing to include the standard license headers like this in each file, which would make it a bit easier to do things like this.

Copy link
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

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

Very small questions, but please address the points raised by @joshka before submitting!

@nornagon-openai nornagon-openai enabled auto-merge (squash) July 31, 2025 00:01
@nornagon-openai nornagon-openai disabled auto-merge July 31, 2025 00:01
@nornagon-openai nornagon-openai enabled auto-merge (squash) July 31, 2025 00:02
@nornagon-openai nornagon-openai disabled auto-merge July 31, 2025 00:03
@nornagon-openai nornagon-openai enabled auto-merge (squash) July 31, 2025 00:03
@nornagon-openai nornagon-openai merged commit f2134f6 into main Jul 31, 2025
11 checks passed
@nornagon-openai nornagon-openai deleted the nornagon/resizable-viewport branch July 31, 2025 00:06
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants