Skip to content

fix: add scrollable wrapper to device views#586

Open
debarkak wants to merge 2 commits into
kavishdevar:linux/rustfrom
debarkak:linux/rust
Open

fix: add scrollable wrapper to device views#586
debarkak wants to merge 2 commits into
kavishdevar:linux/rustfrom
debarkak:linux/rust

Conversation

@debarkak
Copy link
Copy Markdown

@debarkak debarkak commented May 7, 2026

what was the issue

so when you resize the window to be smaller, the content in the device view just gets clipped and theres no way to scroll to see the rest. this is because the outer container in airpods_view and nothing_view had .height(Length::Fill) which tells iced to just stretch the container to fill whatever space is available and clip anything that doesnt fit, instead of actually scrolling.

update/information

as @kavishdevar wrote a review:

It certainly works, but I don't think creating a container here just for scroll is ideal, at least not in window. The scroll should be a part of airpods/nothing_view and these fill the vertical space available.

as for this review i have made these changes:

  • wrapped the content column in scrollable() inside airpods_view and nothing_view so the scroll is part of the view itself
  • the views still fill the available space with .height(Length::Fill)
  • reverted window.rs to call airpods_view/nothing_view directly without any scrollable or container wrapping
  • added scrollable import to airpods.rs and nothing.rs

and my reply:

yeah good point, moved the scrollable into airpods_view and nothing_view directly so window.rs just calls them without any wrapping. they still fill the available space with height(Length::Fill)

testing (new)

compiled and tested on fedora linux 44 on kde plasma 6.6.4 with airpods 4 anc

Screencast_20260512_134043.webm

what i changed (old)

  • changed .height(Length::Fill) to .height(Length::Shrink) in airpods.rs (line 523) and nothing.rs (line 178) so the content sizes to its natural height instead of forcing itself to fill the pane
  • wrapped both airpods_view and nothing_view calls in window.rs with container(scrollable(view).height(Length::Fill)) so the views actually scroll when the window is too small to fit everything

the scrollable widget was already imported in window.rs so no new imports needed

testing (old)

compiled and tested on fedora linux 43 on gnome with airpods 4 anc, resizing the window small now scrolls properly instead of clipping

the issue was mentioned by kavish on discord, i didn't even notice it until he mentioned it lol

screencast (testing)

Screencast.From.2026-05-07.13-46-56.mp4

@debarkak
Copy link
Copy Markdown
Author

debarkak commented May 7, 2026

this PR is related to #241

Comment thread linux-rust/src/ui/window.rs
Addresses maintainer feedback from PR kavishdevar#586 review:
- Move scrollable() into airpods_view() and nothing_view() so each
  view owns its own scroll behavior
- Revert window.rs to call views directly without external wrapping
- Fix indentation in the Nothing branch of window.rs
- Views now fill available space with height(Length::Fill) and scroll
  internally when content exceeds viewport
@debarkak debarkak requested a review from kavishdevar May 13, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants