Skip to content

fix(#1294): keep tab content paired with its file snapshot - #1312

Merged
codexu merged 1 commit into
codexu:devfrom
jinchuntan:fix/editor-tab-snapshot-1294
Oct 25, 2026
Merged

codexu merged 1 commit into
codexu:devfrom
jinchuntan:fix/editor-tab-snapshot-1294

Conversation

@jinchuntan

Copy link
Copy Markdown
Contributor

Fixes #1294.

The editor wrapper paired content captured during render with a fresh activeFilePath read inside its effects. If the active file changed between those steps, it could cache the previous note under the new path. Empty notes then kept showing that previous content.

Use the path, content and loading flag from the same store snapshot. Apply completed empty-file updates too, and remove the separate event-based ownership flag.

Reproduced the failure before the fix and checked 8 React/Zustand scenarios covering empty and nonempty notes, cached tabs, delayed loading, clearing content, inactive editors and sync updates. All 5 existing Node tests and lint pass. The production build passes with #1303 applied temporarily. I have not run the native Windows app.

Assisted by Codex.

@codexu
codexu merged commit 5ab02dd into codexu:dev Oct 25, 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.

[bug] 编辑器文本显示问题

2 participants