Skip to content

fix(chat): clear open flag when closing panel#31

Merged
Snowflyt merged 1 commit into
Snowflyt:mainfrom
Seeridia:fix/chat-panel-close-state
Jan 14, 2026
Merged

fix(chat): clear open flag when closing panel#31
Snowflyt merged 1 commit into
Snowflyt:mainfrom
Seeridia:fix/chat-panel-close-state

Conversation

@Seeridia
Copy link
Copy Markdown
Contributor

@Seeridia Seeridia commented Jan 14, 2026

fix #28

在关闭 chatPanel 的时候原有逻辑是在点击 footer-copilot 图标才会清理 copilot-chat-panel-open 的标记,以达到下次启动的时候能够记住是否打开的状态。

但是这样在通过右上角的关闭 btn 关闭的时候就忘了清理了。

本 PR 将清理逻辑集中到 detachChatPanel


感谢您的项目,在过去一段时间给了我很多帮助,另:如果能放一段开发/调试的文档会不会比较好?这样也方便大家进行参与

Copilot AI review requested due to automatic review settings January 14, 2026 01:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the detach function in attachChatPanel
  • 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.

@Seeridia
Copy link
Copy Markdown
Contributor Author

噗嗤,我是先修了这个 PR 才看到那条 issue,直接把你说的下版本工作做了 😂

@Snowflyt
Copy link
Copy Markdown
Owner

噗嗤,我是先修了这个 PR 才看到那条 issue,直接把你说的下版本工作做了 😂

哈哈。感谢修复。

我很久以前就计划写个contribution guide,但是近一年都忙着写论文😂估计过年那段时间能空下来好好完善一下项目,写一下文档,也修复一些积压了好几月的问题。其实我还计划拿Effect-ts或什么东西重写下核心逻辑来着,目前项目一些部分耦合度太高了。

@Snowflyt Snowflyt merged commit 52dc5d7 into Snowflyt:main Jan 14, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

希望插件窗口能够记住上次的状态

3 participants