Merged
Conversation
Both chrome-ext and electron had identical copies of content.css (2684 lines, ~70KB). Consolidate into packages/core/styles/ as the single source of truth. Both packages now import via the @mdview/core/styles/content.css export.
…iew/core Both chrome-ext and electron defined nearly identical default state objects. Consolidate into packages/core/src/default-state.ts as the single source of truth, including tocStyle: 'floating' for both platforms. Adds 5 tests verifying structure and defaults.
Chrome adapter classes (StorageAdapter, MessagingAdapter, FileAdapter, IdentityAdapter) were duplicated across 5 files. Extract into dedicated adapter modules under src/adapters/ with a barrel export, mirroring electron's adapter structure. All consumers now import from the centralized location.
…Engine The Chrome shim's applyTheme() used only standard DOM APIs and core imports — nothing Chrome-specific. Move these methods into the core ThemeEngine so both chrome-ext and electron share the same DOM theme application logic. The Chrome shim is now a thin subclass that only injects ChromeStorageAdapter.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
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.
Summary
content.css(~70KB) to@mdview/core/styles/— eliminates duplication across chrome-ext and electronDEFAULT_STATEandDEFAULT_PREFERENCESto@mdview/core— single source of truth for both platformssrc/adapters/barrelapplyTheme()andwatchSystemTheme()from Chrome shim to coreThemeEngine— Chrome shim reduced from 187 to 20 linesTest plan
npm run test:ci)npm -w @mdview/chrome-ext run buildsucceedsnpm -w @mdview/electron run buildsucceedscontent.cssexists only inpackages/core/styles/DEFAULT_STATEdefined only inpackages/core/src/default-state.tsChromeStorageAdapter,ChromeMessagingAdaptereach in one file only)