Skip to content

Scrolling component#170

Merged
ccbrown merged 2 commits intoccbrown:mainfrom
domenkozar:scrolling-component
Feb 27, 2026
Merged

Scrolling component#170
ccbrown merged 2 commits intoccbrown:mainfrom
domenkozar:scrolling-component

Conversation

@domenkozar
Copy link
Contributor

Fixes #71

Screenshot from 2026-02-26 15-13-28

Add enable_mouse_capture()/disable_mouse_capture() methods to Terminal
that work at runtime (toggling capture even when raw mode is already active).
Change the render loop to accept an optional mouse_capture setting that
defaults to enabled for fullscreen and disabled for inline, with an
enable_mouse_capture() builder method to opt in for inline mode.

Components can now dynamically toggle mouse capture at runtime by calling
SystemContext::set_mouse_capture(). The render loop checks this state after
each render pass and enables/disables mouse capture on the terminal accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 72.54902% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.00%. Comparing base (5a3d4c6) to head (238395a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/iocraft/src/components/scroll_view.rs 80.25% 73 Missing and 6 partials ⚠️
packages/iocraft/src/terminal.rs 0.00% 22 Missing and 1 partial ⚠️
packages/iocraft/src/element.rs 17.64% 13 Missing and 1 partial ⚠️
packages/iocraft/src/render.rs 22.22% 6 Missing and 1 partial ⚠️
packages/iocraft/src/context.rs 70.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
- Coverage   90.06%   89.00%   -1.06%     
==========================================
  Files          32       33       +1     
  Lines        5333     5785     +452     
  Branches     5333     5785     +452     
==========================================
+ Hits         4803     5149     +346     
- Misses        427      525      +98     
- Partials      103      111       +8     
Files with missing lines Coverage Δ
packages/iocraft/src/context.rs 86.20% <70.00%> (-2.26%) ⬇️
packages/iocraft/src/render.rs 94.93% <22.22%> (-1.41%) ⬇️
packages/iocraft/src/element.rs 72.88% <17.64%> (-3.70%) ⬇️
packages/iocraft/src/terminal.rs 73.59% <0.00%> (-3.37%) ⬇️
packages/iocraft/src/components/scroll_view.rs 80.25% <80.25%> (ø)

... and 2 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Owner

@ccbrown ccbrown left a comment

Choose a reason for hiding this comment

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

This is really well done! 💯

It works great and the API changes look good to me except one minor comment on the ScrollView props.

Otherwise I think this is good to merge.

Thank you!

Add a ScrollView component that provides scrollable content with keyboard
(arrows, PageUp/Down, Home/End) and mouse wheel support. Includes
auto_scroll mode that pins to bottom using FlexEnd layout, a
ScrollViewHandle for imperative control, configurable scroll step, and a
visual scrollbar (track + thumb) enabled by default. New scrollbar props:
scrollbar (Option<bool>) and scrollbar_color (Option<Color>). Scroll
offsets are clamped to valid range. Update the scrolling example to use
ScrollView with mouse capture toggle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ccbrown ccbrown merged commit 774bd2f into ccbrown:main Feb 27, 2026
5 checks passed
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.

Add first class scroll view support

2 participants