-
Notifications
You must be signed in to change notification settings - Fork 47
In Agent mode: Auto scroll to prompts like 'Continue'. #26
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,8 @@ public class ChatContentViewer extends ScrolledComposite { | |
| // Auto-scroll state management | ||
| private boolean autoScrollEnabled; | ||
|
|
||
| private boolean scrolledToWidget; | ||
|
|
||
| /** | ||
| * Create the composite. | ||
| * | ||
|
|
@@ -419,9 +421,21 @@ public BaseTurnWidget getTurnWidget(String turnId) { | |
| } | ||
|
|
||
| private void renderWarnMessageWithUpgradePlanButton(String errorMessage, int code, String modelProviderName) { | ||
| latestTurnWidget.createWarnDialog(errorMessage, code, modelProviderName); | ||
| Composite warnWidget = latestTurnWidget.createWarnDialog(errorMessage, code, modelProviderName); | ||
| // Ensure the chat content viewer scrolls to show the newly created warning banner. Walk up the composite hierarchy | ||
| // to find a ChatContentViewer and request scrolling. Use async exec because layout needs to complete first. | ||
| scrolledToWidget = false; | ||
| SwtUtils.invokeOnDisplayThreadAsync(() -> { | ||
| if (warnWidget != null && !warnWidget.isDisposed()) { | ||
| showControl(warnWidget); | ||
| scrolledToWidget = true; | ||
| } | ||
|
|
||
| }, this.getParent()); | ||
| refreshScrollerLayout(); | ||
| scrollToLatestUserTurn(); | ||
| if (!scrolledToWidget) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A little bit confused here.
What will happen if we always scroll to warn/error widget after it is created and not call
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jdneo Please confirm this behavior change looks ok ? From my POV it is good to implement my proposal i don't see any benefits of old behavior.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @raghucssit Sorry for the late response. I was working on sth else recently. Will check this ASAP.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have the same feeling as yours. Since |
||
| scrollToLatestUserTurn(); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -433,7 +447,18 @@ public void renderErrorMessage(String errorMessage) { | |
| } | ||
| this.errorWidget = new ErrorWidget(cmpContent, SWT.BOTTOM, errorMessage); | ||
| refreshScrollerLayout(); | ||
| scrollToLatestUserTurn(); | ||
| // Ensure the chat content viewer scrolls to show the newly created error banner. | ||
| scrolledToWidget = false; | ||
| SwtUtils.invokeOnDisplayThreadAsync(() -> { | ||
| if (this.errorWidget != null && !this.errorWidget.isDisposed()) { | ||
| this.showControl(this.errorWidget); | ||
| scrolledToWidget = true; | ||
| } | ||
| }, this.getParent()); | ||
|
|
||
| if (!scrolledToWidget) { | ||
| scrollToLatestUserTurn(); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
||
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.
What will happen if we not call
viewer.refreshScrollerLayout();here?