Explore a controller based chat session item API #286642
Draft
+78
−23
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.
For #276243
Explores moving the chat session item api to use a controller instead of a provider. This uses managed objects and is based on the
TestControllerwe already have finalizedMain flow :
Extensions call
createChatSessionItemController('my.sessionId')to create the controller. The controller is a managed object with adisposemethodVS Code then calls
refreshHandleron the controller to build up the initial listDuring refresh, the extension updates the
ChatSessionItemCollectionmanaged object. This object is basically just a managed array. This lets the editor see changes that are made to the session listA few other points:
Chat session items would now also be managed objects. Extensions could set properties to update them in the UI
If an extension needs to update the list of chat session items independently of VS Code — for example if a new session is created through GitHub.com — it would simply update the
ChatSessionItemCollectionWe would have event handlers for when the editor archives or disposes of a chat session item
Still some open questions but seems promising. Also although the general API shape looks pretty different , the logic shouldn't be that different for extensions