fix: share-residence import preview polish (closes #7) #9
Reference in New Issue
Block a user
Delete Branch "fix/7-share-residence-import-polish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #7.
Four polish fixes to the iOS QuickLook preview recipients see when they open a
.honeydueresidence invite (AirDrop / Save to Files / Share Extension).1. Filename: keep spaces and apostrophes
HoneyDueShareCodec.safeShareFileNamewas replacing every space with an underscore, so the system title bar renderedThe_Tartt'sinstead ofThe Tartt's(gitea#7 screenshot). Now we strip only the characters that are actually unsafe on iOS / Android filesystems (/,\,:,*,?,",<,>,|, non-whitespace control codepoints) and collapse internal whitespace to single spaces.Locked in by
HoneyDueShareCodecTest(commonTest, 6 cases): keep spaces / strip unsafe chars / collapse whitespace / 50-char cap / blank-input fallback / drop control chars.2. Icon: brand logo instead of
house.fillPreviewViewController.updateUIForResidencepreviously usedUIImage(systemName: "house.fill")— visually generic, didn't say "HoneyDue" at a glance. NewHoneyDueQLPreview/Assets.xcassets/AppLogo.imageset/holds the app logo @2x; the controller renders it withwithRenderingMode(.alwaysOriginal)so its real colors come through. SF Symbol fallback is retained for any asset-load failure.3. Expires-at: human-readable phrase
Was:
Expires: 2026-05-12T17:11:02.067272789Z. Now:Expires in 23 hours/Expires on May 12, 2026 at 5:11 PM(depending on how close the lapse is), andExpires expired 2 hours agofor already-stale links. Implementation usesISO8601DateFormatter(with + without fractional-seconds) for parsing andRelativeDateTimeFormatter/DateFormatterfor output. Falls back to the raw string on parse failure so nothing ever goes blank.4. Instructions: numbered, explicit, action-clear
Was:
(Pointed at the wrong location — the share button is at the top of the QuickLook chrome, not below — and assumed the recipient already recognises the share affordance.)
Now:
Verification
xcodebuild build -scheme HoneyDueQLPreview→ BUILD SUCCEEDEDxcodebuild build -scheme HoneyDue(includes Kotlin framework) → BUILD SUCCEEDED./gradlew :composeApp:testDebugUnitTest --tests HoneyDueShareCodecTest→ all 6 cases greenAdds a one-shot SnapshotTesting case that renders the new `PreviewViewController.updateUIForResidence` layout on the iPhone-13 simulator with deterministic data ("The Tartt's", expiry exactly 23h in the future). The PNG it writes is what gets attached to issue #7 so reviewers can see the post-fix look without AirDropping a `.honeydue` file to a device. `MockPreviewViewController` mirrors the production UIKit layout 1:1 — same colors, fonts, constraints, image asset. (The QL extension target itself can't be `@testable import`ed from HoneyDueTests without project-file surgery; the mirror is a pragmatic faithful copy so we get a real on-simulator render via SnapshotTesting.) The included PNG is the recorded golden. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>When the share link's expiry is in the past, the preview now swaps the "How to join" steps for a dead-end message ("This invite has expired. Ask <sender> to send a new link.") and re-words the clock row to "Expired 1 hour ago" so users don't see share-sheet directions for a link the server will reject. Also adds an expired-state snapshot test alongside the existing active-state one. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>