Repository navigation
refactor(cleanup): reduce defensive duplication and dead code - #167
Merged
Merged
Conversation
- remove unused active-document cache, IPC commands, components, and utility - unify frontend file-error reporting and share the export flow - share open/save response building and simplify workspace search - drop redundant environment/fs existence guards and silent fallbacks - fix duplicate Ctrl+Shift+X binding, stale version fallback, and small UI guards Closes #162 Closes #163 Closes #164 Closes #165 Closes #166
Local integrity tests require a save with no competing request to begin before the key event returns. TabBar also has a regression test for two rapid double-clicks creating one tab.
This was referenced Nov 6, 2026
Closed
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.
📝 Description
Full-codebase review for over-defensive and duplicated logic.
This PR removes dead code and duplicated state, consolidates the two frontend error channels, shares Rust document response building, simplifies workspace search, and drops guards for states that cannot occur in the Tauri/SPA + jsdom test environment. It also fixes the duplicate Ctrl+Shift+X binding and stale hard-coded version fallbacks.
Net: 49 files changed, roughly 590 lines removed.
Changes
AppState.active_document/get_active_document,greet,highlight_code,MobileHeader,TitleBar,singleFlight, plugin runtime leftovers, unused props and imports.alert+ banner double reporting inFileTree.open_fileandsave_fileshare one response builder; workspace search canonicalizes only symlinks and checks its bounds once per entry; redundant.exists()calls removed.typeof window/localStorage/document/navigatorchecks that always hold here; keptmatchMediaandvisualViewportcapability checks because jsdom/webviews can lack them.package.json+getVersion();.mdxfiles are recognized in the file tree; Save As queues behind an in-flight save; the watcher is not started twice; small MarkdownView / SearchModal / FindReplace defenses removed.🎯 Type of Change
🧪 Testing Performed
cargo test --manifest-path src-tauri/Cargo.tomlpassedpnpm tsc --noEmitpassedpnpm buildpassed📸 Screenshots / Demos (if applicable)
N/A — no visual changes.
🔗 Related Issues
Closes #162
Closes #163
Closes #164
Closes #165
Closes #166