subconscious: use ScrollPane for history pane

Replace bare history_scroll: u16 with ScrollPaneState. The history
pane now uses ScrollPane for rendering, getting proper height caching
and scrollbar for free.

Also relax ScrollItem lifetime bounds from 'static to 'a so
non-static Lines (built on the fly during render) can be used.

Co-Authored-By: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
ProofOfConcept 2026-04-11 01:34:39 -04:00 committed by Kent Overstreet
parent 2230fdf3c1
commit d18bf6243a
2 changed files with 14 additions and 12 deletions

View file

@ -22,19 +22,19 @@ pub trait ScrollItem {
// Blanket impls for common types
impl ScrollItem for Line<'static> {
impl<'a> ScrollItem for Line<'a> {
fn content(&self) -> Text<'_> {
Text::from(self.clone())
}
}
impl ScrollItem for Vec<Line<'static>> {
impl<'a> ScrollItem for Vec<Line<'a>> {
fn content(&self) -> Text<'_> {
Text::from(self.clone())
}
}
impl ScrollItem for Text<'static> {
impl<'a> ScrollItem for Text<'a> {
fn content(&self) -> Text<'_> {
self.clone()
}