(autoscroll): add new AutoScroll container widget#2807
Open
ArtemKhvorostianyi wants to merge 3 commits intomainfrom
Open
(autoscroll): add new AutoScroll container widget#2807ArtemKhvorostianyi wants to merge 3 commits intomainfrom
ArtemKhvorostianyi wants to merge 3 commits intomainfrom
Conversation
Collaborator
rorychatt
reviewed
Mar 26, 2026
| var autoscrollFollow = UseState(true); | ||
|
|
||
| var autoScrollPanel = new AutoScroll( | ||
| logLines.Value.Select(line => Text.Muted(line)).ToArray<object>()) |
Collaborator
There was a problem hiding this comment.
I don't like this Cast -> is this needed?
Why can we just directly pass the array?
rorychatt
reviewed
Mar 26, 2026
rorychatt
reviewed
Mar 26, 2026
|
|
||
| return Layout.Vertical() | ||
| | new AutoScroll( | ||
| lines.Value.Select(l => Text.Muted(l)).ToArray<object>()) |
Collaborator
There was a problem hiding this comment.
same comment here, why we have to ?
rorychatt
reviewed
Mar 26, 2026
|
|
||
| ## Enabled follow | ||
|
|
||
| When `Enabled` is `true` (default), new content scrolls the view to the bottom. When `false`, the user can scroll manually but the view does not jump when children update — useful when someone is reading older lines while new data arrives. |
Collaborator
There was a problem hiding this comment.
.Enabled() must be default and be true.
(also this is confusing with .Disabled() API ->
maybe we should just have a ScrollBehavior -> see what enums we already haver in the framework
rorychatt
requested changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a standalone AutoScroll widget: a height-constrained, scrollable region that keeps the view pinned to the bottom as children change, with an Enabled flag to turn off follow behavior so users can read earlier content without being pulled down.
Screen.Recording.2026-03-26.at.01.56.08.mov
Implementation
Ivy.AutoScroll (WidgetBase): arbitrary children; Enabled (default true); AutoScrollExtensions.Enabled(...) for fluent configuration; inherits usual Width / Height from WidgetBase.
Frontend (AutoScrollWidget.tsx): maps props to layout; uses useAutoScroll with content: children and enabled.
use-auto-scroll: adds optional enabled; when false, growth/resize no longer forces scroll; when enabled flips back to true, scrolls to bottom once. Existing ChatMessageList behavior unchanged (defaults to enabled).
Registration: "Ivy.AutoScroll" in widgetMap and primitives barrel export.