Skip to content
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

feat(terminal)!: add inline viewport #114

Merged
merged 9 commits into from
Apr 17, 2023
Merged

Conversation

conradludgate
Copy link
Contributor

@conradludgate conradludgate commented Mar 23, 2023

originally taken from fdehau/tui-rs#552.

Updates Viewport type, making it an enum with Fullscreen, Inline and Fixed views.
Inline(_) includes the height of the inline screen.

Adds an insert_before method that can write permanent lines above the inline tui. Intended usecase is like yarn install, where there would be multiple updating elements at the bottom of the screen, and then 'xxx installed' would be permanent logs above the updating elements.

I've tried to minimise the breaking changes from the original PR, but there's still a breaking change in the Backend trait. In theory I can add some default methods to make it not a breaking change

(CC @pdecat, atuinsh/atuin#648)

@mindoodoo
Copy link
Member

I just checked out the example, seems either bugged / unfinished or I'm just not understanding what @fdehau was trying to do. On my machine the example either wrote on top of itself on my occasions, or failed to "coexist" with previous outputs in my terminal. I'll try and take a look at this PR when I have the time, but I'll be pretty busy these upcoming days.

@conradludgate
Copy link
Contributor Author

seems either bugged / unfinished

my fault, push incoming

@mindoodoo
Copy link
Member

Looks awesome now 😄

src/backend/mod.rs Outdated Show resolved Hide resolved
@conradludgate conradludgate marked this pull request as ready for review March 23, 2023 12:22
@conradludgate conradludgate changed the title feat!(terminal): inline viewport feat(terminal): inline viewport Mar 28, 2023
@ellie
Copy link

ellie commented Mar 29, 2023

Hey! I don't want to pressure or anything, but the next Atuin release is blocked on this one getting in. Is there anything I can do to help?

Also - so good to see TUI getting maintained again, nice work! 🙏

ellie added a commit to atuinsh/atuin that referenced this pull request Mar 31, 2023
Once ratatui/ratatui#114 has been merged,
we can undo this! But otherwise we can't publish to crates.io with a git
dependency.
ellie added a commit to atuinsh/atuin that referenced this pull request Mar 31, 2023
Once ratatui/ratatui#114 has been merged,
we can undo this! But otherwise we can't publish to crates.io with a git
dependency.
ellie added a commit to atuinsh/atuin that referenced this pull request Mar 31, 2023
* Vendor ratatui temporarily

Once ratatui/ratatui#114 has been merged,
we can undo this! But otherwise we can't publish to crates.io with a git
dependency.

* make tests pass

* Shush.

* these literally just fail in nix, nowhere else

idk how to work with nix properly, and they're also not our tests
Copy link
Member

@sayanarijit sayanarijit left a comment

Choose a reason for hiding this comment

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

LGTM. But this looks like a breaking change.

src/terminal.rs Outdated Show resolved Hide resolved
src/backend/mod.rs Outdated Show resolved Hide resolved
@orhun orhun changed the title feat(terminal): inline viewport feat(terminal)!: add inline viewport Apr 17, 2023
@orhun orhun merged commit 6af75d6 into ratatui:main Apr 17, 2023
@hermannm
Copy link

I was struggling with inline rendering, and had almost given up when I found this! Great work!

Does anyone know when this might be included in a release? Pointing the dependency to this commit works locally, but I'd love to use this in a crates.io package as well.

@orhun
Copy link
Member

orhun commented Apr 20, 2023

Thanks @hermannm! I'm currently having a chat with the other maintainers about the next possible release. We certainly don't want to keep people waiting 🐻

@kdheepak kdheepak added the Type: Breaking Change This change will cause application code to break and must be noted in the breaking changes docs etc. label Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Breaking Change This change will cause application code to break and must be noted in the breaking changes docs etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants