Repository navigation
refactor: remove dead code and consolidate duplicated helpers - #129
Merged
Merged
Conversation
- Delete unused files, exports and the codemirror meta package - Share markdown formatting and snapshot saving between the editor and command menu - Move cross-tab storage, getByDate and the active-document lookup into shared helpers - Deduplicate task-line parsing, heading detection and font cycling - Load history data synchronously
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.
Behavior-preserving cleanup: remove dead code found by knip, and merge logic that was copy-pasted between the editor, the command menu and the storage modules.
use-cursor-position.ts,use-toc.ts,table-of-contents.tsx,error-boundary.tsx,loading.tsxcodemirrorpackage (keep@babel/core, pinned in fix: restore react compiler and stop history modal render loop #128)useHistoryDatabut never rendereduseMarkdownFormatterandformatEditorView(format, restore cursor and scroll) between the editor and the command menusaveSnapshotWithToastbetween ⌘⇧S and the command menucross-tab-storage.ts; use it for botheditorContentAtomanddocumentsAtomgetByDateintocreateStorage; drop task-storage pass-through methods and unused default providersactiveContentAtomfor the char and word countstask-close.ts(parseTaskInfo), the heading check (isHeadingLine), font cycling (nextFontFamily), the history-tab openers and the command menu's close keysformatDateKeyfor "Closed today"; only listen for outside clicks while the System menu is openValidation:
tsc --noEmit,pnpm lint,vitest run src(157 passed),vite build.playwright testpasses 7; the same 3 fail onmain(Picture-in-Picture close on leaving, and the two link-styling tests). In the dev server, in both single and multi mode: counts, ⌘S / ⌘⇧S, every command menu action, System menu font cycling, counts and outside click, closing a task by checkbox, history list/restore/delete/delete all, and cross-tab sync.Found but not fixed here (reproduced on
main): restoring a snapshot writes the raw string toephe:editor-contentinstead of JSON, so the restored content is gone after a reload.