mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 11:01:54 +00:00
assistant2: Scroll to the bottom when you submit a new message (#22451)
Up until now, in the assistant 2, if you scrolled up either while a message was being generated or after it's been generated, then submitted a new message, you'd keep your scroll position. Now, with this PR, if your scroll position is somewhere else that's not the bottom, as you submit a new message, you'll be back at the bottom. https://github.com/user-attachments/assets/8b111c10-27ff-4d7b-9b10-4c31093c6457 Release Notes: - N/A Co-authored-by: Agus Zubiaga <hi@aguz.me>
This commit is contained in:
parent
56b425fced
commit
34f8bb246a
1 changed files with 6 additions and 2 deletions
|
@ -4,8 +4,8 @@ use assistant_tool::ToolWorkingSet;
|
|||
use collections::HashMap;
|
||||
use gpui::{
|
||||
list, AbsoluteLength, AnyElement, AppContext, DefiniteLength, EdgesRefinement, Empty, Length,
|
||||
ListAlignment, ListState, Model, StyleRefinement, Subscription, TextStyleRefinement, View,
|
||||
WeakView,
|
||||
ListAlignment, ListOffset, ListState, Model, StyleRefinement, Subscription,
|
||||
TextStyleRefinement, View, WeakView,
|
||||
};
|
||||
use language::LanguageRegistry;
|
||||
use language_model::Role;
|
||||
|
@ -153,6 +153,10 @@ impl ActiveThread {
|
|||
)
|
||||
});
|
||||
self.rendered_messages_by_id.insert(*id, markdown);
|
||||
self.list_state.scroll_to(ListOffset {
|
||||
item_ix: old_len,
|
||||
offset_in_item: Pixels(0.0),
|
||||
});
|
||||
}
|
||||
|
||||
fn handle_thread_event(
|
||||
|
|
Loading…
Reference in a new issue