fix(chat): clear open flag when closing panel#31
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the copilot-chat-panel-open localStorage flag wasn't being cleared when closing the chat panel via the close button in the panel header. The fix centralizes the cleanup logic to ensure the flag is properly removed regardless of how the panel is closed.
Changes:
- Moved
localStorage.removeItem("copilot-chat-panel-open")from the footer icon click handler to thedetachfunction inattachChatPanel - This ensures the flag is cleared whether the panel is closed via the footer icon or the close button in the panel header
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/footer.tsx | Removed localStorage cleanup from footer icon click handler |
| src/components/ChatPanel.tsx | Added localStorage cleanup to the centralized detach function that handles all panel close operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
噗嗤,我是先修了这个 PR 才看到那条 issue,直接把你说的下版本工作做了 😂 |
Owner
哈哈。感谢修复。 我很久以前就计划写个contribution guide,但是近一年都忙着写论文😂估计过年那段时间能空下来好好完善一下项目,写一下文档,也修复一些积压了好几月的问题。其实我还计划拿Effect-ts或什么东西重写下核心逻辑来着,目前项目一些部分耦合度太高了。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix #28
在关闭 chatPanel 的时候原有逻辑是在点击 footer-copilot 图标才会清理 copilot-chat-panel-open 的标记,以达到下次启动的时候能够记住是否打开的状态。
但是这样在通过右上角的关闭 btn 关闭的时候就忘了清理了。
本 PR 将清理逻辑集中到 detachChatPanel
感谢您的项目,在过去一段时间给了我很多帮助,另:如果能放一段开发/调试的文档会不会比较好?这样也方便大家进行参与