Change:
Testing I think that growing quick chat when you scroll is an interesting idea, but I would reset the size back to how it was when you reopen quick chat because its harder to manage the size to make it small again. You cannot just scroll to get back where you were.
Ahhh I struggle with this one because it might be that you wanna: scroll back to a former question switch to your editor switch back to that former question which you get with the current behavior. You can get back to the original size if you double click the sash... but that's maybe not obvious.
cc would love your thoughts.
Actually had forgotten that a double click on the sash quickly restores the size, so maybe its not as bad...
I think we'd want some other way to reset as double clicking the sash isn't widely known. Do we reset the height when the question session times out? If so I think it's fine as is.
We no longer do the session time out thing (aka Spotlight inspired timeout). Though, maybe I could introduce a timeout that will, after a few minutes, revert to the dynamic grow behavior?
I guess something like 30 seconds before revert would work alright, either that or some button shows up which lets the user go back to auto.
What are some verification steps for this issue? Here's what I see so far: If I ask a question, it starts from the top and starts growing downwards again If I close the chat and then reopen it a minute later, the answer is still there, and the chat is still expanded. If I ask another question, it starts from the top again, but that's true even if I don't wait 30 seconds If I manually move the sash, it seems like it's just stuck at that size
Verification steps: Ask a question like Get a long answer: ! scroll down to make it bigger ! hide it and show it again quickly. It should still look like screenshot 2 where you see everything hide it and wait 1min and show it again. It should look like screenshot 1 where you only see the last q&a

Discussion:
import * as dom from 'vs/base/browser/dom'; import { Orientation, Sash } from 'vs/base/browser/ui/sash/sash'; <ins> import { disposableTimeout } from 'vs/base/common/async'; </ins> import { CancellationToken } from 'vs/base/common/cancellation'; import { Emitter } from 'vs/base/common/event'; <del> import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; </del> <ins> import { Disposable, DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; </ins> import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';

private sash!: Sash; private model: ChatModel | undefined; private _currentQuery: string | undefined; <ins> private maintainScrollTimer: MutableDisposable<IDisposable> = this._register(new MutableDisposable<IDisposable>()); </ins> constructor( private readonly _options: IChatViewOptions,

hide(): void { this.widget.setVisible(false); <ins> // Maintain scroll position for a short time so that if the user re-shows the chat // the same scroll position will be used. this.maintainScrollTimer.value = disposableTimeout(() => { // At this point, clear this mutable disposable which will be our signal that // the timer has expired and we should stop maintaining scroll position this.maintainScrollTimer.clear(); }, 30 * 1000); // 30 seconds </ins> } show(): void { this.widget.setVisible(true); <ins> // If the mutable disposable is set, then we are keeping the existing scroll position // so we should not update the layout. if (!this.maintainScrollTimer.value) { this.widget.layoutDynamicChatTreeItemMode(); } </ins> } render(parent: HTMLElement): void {