Skip to content

fix: warn before closing when any tab is unsaved#206

Merged
LarryZhu-dev merged 1 commit intoAuto-Plugin:mainfrom
imwyvern:clawoss/fix/200-unsaved-md-close-warning
May 3, 2026
Merged

fix: warn before closing when any tab is unsaved#206
LarryZhu-dev merged 1 commit intoAuto-Plugin:mainfrom
imwyvern:clawoss/fix/200-unsaved-md-close-warning

Conversation

@imwyvern
Copy link
Copy Markdown
Contributor

The window close guard was using the active tab's modified state as the saved/unsaved signal for the whole BrowserWindow. Switching from an edited markdown tab to a saved tab could mark the window as saved, so closing skipped the existing save confirmation flow.

The save-state watcher now reports whether any tab in the window is modified, keeping the main-process window state dirty until all tabs are saved or discarded.

Verification:

  • pnpm run build
  • pnpm exec oxlint src/renderer/hooks/useContent.ts && pnpm exec oxfmt --check src/renderer/hooks/useContent.ts

Fixes #200

@LarryZhu-dev
Copy link
Copy Markdown
Contributor

Hi,感谢你的贡献,我正在休假,可能会在稍晚查看此请求。

@LarryZhu-dev LarryZhu-dev merged commit 80937b9 into Auto-Plugin:main May 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

🎉 Thank you for your contribution! If you have not yet joined our community group, please feel free to join us (when joining, please provide the link to this PR).

🎉 感谢您的贡献!如果您对此项目非常感兴趣,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。

maqibg pushed a commit to maqibg/milkup that referenced this pull request May 4, 2026
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.

编辑一份md文档未保存,在新页签打开一份md文档,关闭milkup窗口,未保存的md文档没有任何提示?

2 participants