Fix Export HTML; implement ⌘F find and ⌘P print#2
Merged
Conversation
Export Standalone HTML (⌘E) failed with "JavaScript execution returned a result of an unsupported type". exportStandalone() in app.js is async, so it returns a Promise — evaluateJavaScript can't await one and hands the Promise object straight back, which WKWebView can't bridge. Switch to callAsyncJavaScript, which resolves the Promise before bridging. ⌘F and ⌘P were claimed in the README but never wired up: - ⌘P — new Print menu command running WKWebView.printOperation(with:). The print panel's "Save as PDF" covers print-to-PDF for free. - ⌘F — macOS WKWebView has no built-in find bar, so add an in-app one: a FindBar overlay (modeled on the existing ErrorBanner) driving WKWebView.find(_:configuration:). Find-as-you-type, Enter / chevrons for next-prev, Esc or close button dismisses, "Not found" indicator, wrap-around enabled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
markee | aeb4b2c | Commit Preview URL Branch Preview URL |
May 15 2026, 10:09 AM |
This was referenced May 19, 2026
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
Three app-code fixes, all surfaced by manual testing this session. Independent of PR #1 (site/responsive work) — touches only
Sources/Markee/.Export Standalone HTML (⌘E) — bug fix
exportStandalone()inapp.jsisasync(itfetches and inlines images as data URIs), so it returns a Promise. The old code usedevaluateJavaScript, which can't await a Promise — it handed the Promise object back, and WKWebView can't bridge that to Swift → "JavaScript execution returned a result of an unsupported type." Switched tocallAsyncJavaScript, which resolves the Promise first.⌘P Print — new
Claimed in the README, never wired. New Print menu command running
WKWebView.printOperation(with:). The system print panel's PDF ▸ Save as PDF covers print-to-PDF.⌘F Find — new
Also claimed, never wired. macOS
WKWebViewhas no built-in find bar (the first attempt usingperformTextFinderAction:crashed —unrecognized selector). Added a real in-appFindBaroverlay — modeled on the existingErrorBanner— drivingWKWebView.find(_:configuration:):Test plan
make test— 24 Swift + 24 JS tests pass🤖 Generated with Claude Code