After this change we will be able to publish Cody Web package from main again.
This PR fixes UI-flash problems when we switch chats or set the initial chat transcript.
Previously, the CodyWebChat component didn't wait for any restoring event and render
all available transcripts right away, this caused problems when you opened the chat and
could see how we render empty chat only then render actual transcript UI.
This PR makes CodyWebChat wait for the actual current chat restoration and fixes the problem
with flashing.
Tech note: I'm not happy with the current approach with refs and panel and chat ids states but for now it seems as a reasonable fix. Later I will refactor the provider state in a way that cody web chat component wouldn't subscribe in vscode API
Test plan
CI is green
Check that when you open the cody web demo (cd ./web and pnpm dev) you should see
no flashes while we set the initial chat (the last visited chat)
Based on https://github.com/sourcegraph/cody/pull/4756 Closes SRCH-632
After this change we will be able to publish Cody Web package from main again.
This PR fixes UI-flash problems when we switch chats or set the initial chat transcript. Previously, the CodyWebChat component didn't wait for any restoring event and render all available transcripts right away, this caused problems when you opened the chat and could see how we render empty chat only then render actual transcript UI.
This PR makes CodyWebChat wait for the actual current chat restoration and fixes the problem with flashing.
Tech note: I'm not happy with the current approach with refs and panel and chat ids states but for now it seems as a reasonable fix. Later I will refactor the provider state in a way that cody web chat component wouldn't subscribe in vscode API
Test plan
cd ./web
andpnpm dev
) you should see no flashes while we set the initial chat (the last visited chat)