1.3.4: share view layer between mrkd and QL, add test suite#16
Merged
Conversation
…uite (1.3.4) Refactor — pure consolidation, ~210 lines deleted: - ThemeManager preference reads now route through CFPreferencesCopyAppValue with the main app's bundle ID rather than UserDefaults.standard. The QL extension's sandbox has its own UserDefaults domain (empty for these keys) but reads the same on-disk plist via CFPreferences as the main app. Setters keep the UserDefaults + persistPref pair so the main app's in-process cache stays warm. - project.yml's QLPlugin target now compiles Sources/UI/MarkdownViewController and its dependencies (TOCFloatingView, OpenWithButton, ReloadBannerView, TextInteractionHandler, FragmentLinkHandler, FontSizeManager) plus Sources/Platform/FileWatcher. Same source files, two targets. - PreviewViewController slimmed from 263 → 53 lines. It hosts a MarkdownViewController as a child VC; everything else (theme resolution, scroll view, render, themed Open button) comes from the shared MVC. - AppDelegate's first-render hook decoupled from MarkdownViewController via NotificationCenter so MVC compiles into both targets. - QL preview now inherits: TOC sidebar, article-width cap, themed Open button with hover, fragment link resolution, scroll-position sync, smart typography, code-block fixes — without per-target drift. Tests added — Sources/Tests/, 47 cases passing: - BlockSplitter: fence-aware splitting, blank-line handling. - SmartTypography: quotes / em-dash / en-dash / ellipsis curling, skip rules for code spans / fenced blocks / link URLs / GFM tables. - FragmentLinkHandler: GitHub-style slug, idempotence, lookup. - TOCBuilder: heading extraction order and trimming. - MarkdownRenderer: heading-level attributes, smart-typo opt-out, leading-newline strip in code blocks. - ThemeManager: CFPreferences fallback + actual read of user-set preferences (validates the migration above). - MarkdownViewController: init from URL + loadView smoke tests. - PreviewHostingContract: end-to-end render → TOCBuilder pipeline matches between main app and QL preview. CI: - release.yml now runs `swift test` before xcodebuild Release. Failing tests block the release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What
MarkdownViewControllerbetween the mrkd app and QL extension. QL preview now has TOC sidebar, article-width cap, themed Open button hover, fragment links, scroll-position sync — all from the same view layer the main app uses.Sources/Tests/— 47 cases covering all the shared engine functions and view-layer integration points.release.ymlnow runsswift testbefore the Release build so failing tests block the release.Test plan
swift testreports 47 / 0 / 0.04s.xcodebuild -scheme mrkd build.🤖 Generated with Claude Code