-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore: Make ratatui optional on tui-popups (Breaking / Help Wanted #52
base: main
Are you sure you want to change the base?
Conversation
Rely on ratatui-core types mainly except for the interaction with crossterm. This change is a bit breaking, as it requires the widget passed in to tui-popup to implement Clone. I can't find a clean way to replace this otherwise such that this call works: <https://github.com/joshka/tui-widgets/blob/83e45dbb31566ade6b323d05820c711561a1a46c/tui-popup/src/popup.rs#L147>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #52 +/- ##
==========================================
+ Coverage 73.34% 73.53% +0.18%
==========================================
Files 14 14
Lines 2465 2441 -24
==========================================
- Hits 1808 1795 -13
+ Misses 657 646 -11 ☔ View full report in Codecov by Sentry. |
self.body.render_ref(inner_area, buf); | ||
self.body.clone().render(inner_area, buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one line is the crux of this entire change. I can't get this to work with &Widget, the best I can do is Clone the inner body widget. I'm not sure if this would be better left using WidgetRef instead of requiring Clone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no suggestions.
Files not reviewed (1)
- Cargo.toml: Evaluated as low risk
Rely on ratatui-core types mainly except for the interaction with
crossterm.
The goal here was to remove the reliance on the unstable WidgetRef
and StatefulWidgetRef traits, which are in Ratatui, and replace it with
the stable Widget/StatefulWidget traits in Ratatui-core.
I haven't found a way (yet) to make this work for &W: Widget instead of
W: Widget + Clone. Leaving this open a bit for anyone that wants to
give feedback on the change / explore whether this is possible to fix.
This is the call that needs to work (render the body widget of the popup.
tui-widgets/tui-popup/src/popup.rs
Line 147 in 83e45db