Capture is now a decision, not a hidden setting. The popover shows a four-way scope control with the target named under it (800 x 600 on Display 1, the frontmost window, the front browser window, the whole display), and the window header carries the same choice beside the verbs. Picking Window or Browser hides Redline, dims the screen, names the app under the pointer and highlights its window; a click captures exactly that window, Escape cancels, and the desktop highlights the whole screen. New Session is one click: the current captures stay in their own folder, a fresh session opens, and the area picker comes straight up with the saved area pre-selected — Return keeps it, a drag replaces it. Settings is consolidated into one door (the popover gear, plus Cmd-,): what to capture, saved area, shortcut, ask-on-new-session, sending, session age limit, and a new Updates group with automatic install (on by default; installs only when nothing is unsent). The footer filler and the extra-actions menu are gone.
--window opens the Redline window at launch, so a script or a demo lands on the new UI instead of an idle menu-bar icon. Clicking the running app in Finder, or open -a Redline, now shows the window instead of doing nothing. scripts/install-local.sh installs the locally built app into /Applications, keeps the previous copy at .build/Redline-<version>.app for rollback, and launches it with the window open.
The menu-bar popover was being used as a session manager: status, five text fields,
thumbnails, three buttons, a history list and eight more flat rows in 320 pt. The
redesign splits the product by job, from a UX pass whose mockups are kept under
design/ux-rework/.
- Popover: only the current session. Review details as one line plus a pencil that
opens the window with the Lane field focused, at most three thumbnails, a Capture
and a Send row, a New Session and Open Redline row, one status line when something
happened, and a footer with the send channel, the retention policy and a ... menu
for Settings / updates / quit.
- Window: sidebar of sessions grouped Today / Yesterday / This week / by month with
a Current tag and each session's state, the selected session's pages as cards
(select, Delete or Remove Page, sent sessions read-only), and an inspector with
editable review details, the PDF facts (file name, pages, channel, status) and the
session facts (started, id, files). Past sessions show their details read-only.
- Settings: three labelled groups (Capture, Sending, Sessions) replacing the
headings-plus-grid layout.
- Sessions list/search/grouping/state live on the model, so the window and the popover
read the same truth (came-back-marked state comes from the return ledger).
- Verification: 159 tests, the headless panel self-test, and an end-to-end run against
the active app (scripts/run-e2e-ui.sh) which opens the real window, types into the
Lane field with key events and clicks New Session, reporting what the launch mode
could and could not deliver.
Sessions are now the unit of the product instead of an implicit capture run.
- Nothing is deleted by default: the fixed 10-session cap is gone. An age limit
(Never / 7 / 14 / 30 / 90 / 180 / 365 days) is chosen in Settings > Sessions and
applied on launch, after archiving, and by "Clean up now". Sent PDFs are never
touched.
- Each session carries review details: lane, deployed version, commit, reviewer
(pre-filled with the Mac user) and a free note. They persist in session.json and
are inherited by the next session, so a review run is typed once.
- PDF file names are Redline-<yyyyMMdd-HHmm>-<LANE>-<SHORTID>.pdf, and every page
carries a two-line reference footer (tool, build time, session / lane, deployed
build, commit, reviewer, note). The PDF document info carries the same values in
Author and Keywords.
- Verification: 159 tests, a headless panel self-test, and a LaunchServices-driven
end-to-end run that types and clicks the real panel.
Round 2 of adversarial review confirmed defects 2,3,4,5,7 fixed and
raised three new ones; all three are fixed here, plus the guard-message
nit.
NEW-1 (the FAIL driver): the OneDrive send path overwrote the truthful
status from handleDidShareItems with its own success text, silently
dropping an archive failure and any state-refresh problem. The seam now
takes the caller's success summary and composes ONE truthful message:
summary (the share itself did complete) + archive error if any + refresh
problems if any. Both callers (AirDrop delegate, OneDrive) pass their
summary; the OneDrive text is never clobbered.
NEW-2: if the replacement open session could not be created after the
archive rename (disk full), the store kept reporting the already-archived
session as the open one. SpoolStore now has a truth guard
(ensureOpenSession): the open session is verified to really exist on disk
and be in state .open before any read/mutate; a stale one is replaced by
a genuinely fresh session, or the call fails loudly. Never a lie.
NEW-3: archivedSessions() read the folder tie-break dates AFTER
reconciliation, so a healed same-second session could bump its own
modification date and outrank a genuinely newer peer. The dates are now
read BEFORE reconciling.
Nit: the startNewSession guard now reports "A new session is already
being started." when the refusal is about a concurrent session start,
not a send.
Also added REDLINE_SELFTEST_PHASE=sendtruth (mirroring the existing
=onedrive escape hatch) so the SEND-TRUTH selftest can run without the
picker chain's display-dependent REGION-PERSIST phase.
Evidence: 136 swift tests pass (2 new: OneDrive summary survives
archiving; stale open session never returned as current).
REDLINE_SELFTEST_PHASE=sendtruth -> SEND-TRUTH PASS.
REDLINE_SELFTEST_PHASE=onedrive -> ONEDRIVE-SELFTEST PASS against the
real OneDrive sync root.
Review verdict FAIL raised 7 defects; this addresses 1-5 and 7. 6 is
accepted as-is (see below).
1. Retention failure after a COMPLETED archive no longer throws: a failed
prune is logged loudly with the exact path and otherwise ignored, so a
successful send can never be reported as "The screenshot could not be
saved". The visible symptom of a failed prune is simply more than 10
sessions listed.
2. handleDidShareItems now refreshes the current session AND the
past-submissions list from the store on both the success and the
failure path (previously the menu count and any open window went stale
after every send). Any refresh problem is appended to the status line.
3. "Start new session" and send() now guard against each other
synchronously before their first await (isStartingNewSession flag on
both sides), instead of relying on the SwiftUI .disabled state alone —
a queued Task could otherwise rename the session directory out from
under an in-flight PDF compose.
4. Contract decision, documented in code: session retention prunes the
whole session folder INCLUDING removed/ parked captures. That is the
requested retention policy ("retain the past 10 sessions"), and the
D-11 never-delete note on remove() now says so explicitly.
5. Session ordering tie-break chain extended: manifest createdAt, then the
folder creation date, then the folder content-modification date, then
the id — so retention stays on real creation order even on a volume
that reports no creation date.
7. The PDF button's help text now distinguishes never-sent from
sent-but-no-longer-on-disk (the button was already disabled in both).
6 (empty close leaves the old empty spool/ folder behind) is left exactly
as the pinned SpoolStoreTests contract has it (startNewSession test 16
asserts the folder remains); it is pre-existing behavior, harmless (the
store reconciles and picks the newest candidate), and out of scope here.
Tests: 2 new app-target regression tests (send refreshes past
submissions; start/send refuse to overlap) — 134 tests pass.
MMDB-2925. Two new menu functions in the Redline app:
- "Start new session" keeps the current screenshots as a past session
(moved into the single archive/ folder — never deleted on close) and
opens a fresh empty session. Sessions closed without ever sending keep
pdfFileName nil and show as "Not sent" in the list.
- "Past submissions…" opens a window listing every retained session
(timestamp, page count, what was sent) with actions to reveal the sent
PDF and the session's screenshot folder.
Retention (Ben's rule 2026-10-11: "retain the past 10 sessions"): both
archive paths (send and close) keep the newest 10 archived session
folders in archive/ and remove the rest. Any PDF a pruned session
produced is untouched — it lives in the outbox/OneDrive folder.
archivedSessions() ordering now tie-breaks same-second sessions by the
session folder's creation date, so listing and pruning are deterministic
(manifest timestamps are whole-second ISO8601 — format pinned in
AtomicFileTests).
Tests: 6 core tests in SessionRetentionTests (close/keep/reconcile,
sent-vs-unsent, retention of 10, explicit prune, send-path retention) and
3 app-target tests in SessionWorkflowTests driving the real AppModel menu
actions through AppDelegate.makeLaunchModel(). PanelSnapshot renders the
new window as panel-06b-past-submissions.png.
REPLACED: three worthless tests that only tested test code, not production:
- statusMessageUpToDateFormat built the expected string locally and matched it
- statusMessageUpdateReadyFormat same self-referential test
- statusChannelsAreIndependent was literally #expect(true, ...)
ADDED: four real tests that drive production code:
- dubaiTimeCheckTimeFormat: assert DubaiTime.checkTime() formats as HH:MM Dubai
- manualCheckUpToDateIncludesTimestamp: inject stub appcast via testAppcastJSON seam,
drive UpdateChecker.checkNow(manual: true), verify statusMessage matches exact format
- automaticCheckUpToDateLeavesMessageNil: verify automatic check (manual: false) leaves
statusMessage nil when up-to-date
- statusChannelsAreIndependent: construct real AppModel via AppDelegate.makeLaunchModel(),
assert setStatus() does NOT affect updateStatusMessage, setUpdateStatus() does NOT
affect statusLine, and vice versa. PROVES the defect is caught: test fails with 3 issues
if updateStatusMessage is reverted to an alias of statusLine.
ADDED: testAppcastJSON seam to UpdateChecker for test injection of appcast data.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZiTXPbPCSjzPVsfoweAbp
Root cause: updateStatusMessage was an alias to statusLine, so update feedback appeared
both in the header (where capture summary belongs) and footer (intended). Both MenuBarView
header and footer rendered the same value, creating duplication and information loss.
Fix: introduce updateStatus property separate from statusLine. Route UpdateChecker.statusMessage
into setUpdateStatus(), not setStatus(). Header now shows capture summary uninterrupted;
footer-only shows update feedback. Both channels now independent.
- Add public updateStatus property to AppModel
- Add setUpdateStatus() mutator
- Change updateStatusMessage property to return updateStatus instead of statusLine
- Route onChecked callback to setUpdateStatus, not setStatus
- Update PanelSnapshot helper to use setUpdateStatus
- Add test asserting channel independence
Panel-12 and panel-13 now render correctly: capture summary in header, update status only
in footer; no duplication or information loss.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZiTXPbPCSjzPVsfoweAbp
Render panels 10-14 showing the update check states:
- panel-10-update-idle: menu with 3 captures, no update available
- panel-11-update-checking: same as 10, but row reads "Checking..."
- panel-12-update-uptodate: footer status shows "Redline X.Y.Z is up to date, checked 10:42 Dubai"
- panel-13-update-staged: row "Update to 9.9.9" present, footer status "Update to 9.9.9 is ready"
- panel-14-update-revert: row "Revert to 0.2.0" present
All five panels driven by model state only; never touch real appcast or UserDefaults.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZiTXPbPCSjzPVsfoweAbp
- Manual check finds no newer version: status message becomes "Redline X.Y.Z is up to date, checked HH:MM Dubai"
- Manual check stages a newer version: status message becomes "Update to X.Y.Z is ready"
- Automatic (scheduled) checks keep original silent behaviour when up to date
- Add snapshot-only seams for testing: snapshotPreviousVersionOverride and snapshotUsesPreviousVersionOverride
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZiTXPbPCSjzPVsfoweAbp
The reviewer patched main.swift back to FolderSettings.resolvedAppSupportPaths()
(the AirDrop-only resolver) and `swift test --filter LaunchWiringTests` STILL
PASSED, because the only thing the test asserted — model.watchFolderURL — is
computed independently by AppModel.init() via TransportSettings.effectiveFolders(),
not from the `paths` makeLaunchModel() built. bootstrap()'s own unconditional
updateWatchFolder reconcile then papered over the reverted resolver, so the
test only ever proved the bootstrap reconcile, never the launch resolver
itself. The "verified this catches the blocker" claim in the previous
commit was empirically false.
Fix: added ReturnWatcher.currentWatchFolder (public var, actor-isolated —
the folder a watcher is CURRENTLY seeded to scan, readable without calling
scanNow()/updateWatchFolder first). The test now asserts, BEFORE
bootstrap() runs: model.paths.watchFolder/outbox (already internal-visible
via @testable import, no production API change needed there) equal the
OneDrive folder, AND the watcher's currentWatchFolder equals it too — both
of which genuinely depend on what makeLaunchModel() built.
Verified properly this time (both outputs below are verbatim from
`swift test --filter LaunchWiringTests`, main.swift's makeLaunchModel()
temporarily reverted to FolderSettings.resolvedAppSupportPaths() then
restored — the revert itself is not part of this commit):
FAILURE (reverted resolver):
Expectation failed: (model.paths.watchFolder.path -> "/Users/benjaminhippler/Downloads")
== (oneDriveFolder.path -> ".../shotdeck-real-wiring-onedrive-<uuid>")
Expectation failed: (model.paths.outbox.path -> "/Users/benjaminhippler/Desktop")
== (oneDriveFolder.path -> ".../shotdeck-real-wiring-onedrive-<uuid>")
Expectation failed: (seededWatchFolder.path -> "/Users/benjaminhippler/Downloads")
== (oneDriveFolder.path -> ".../shotdeck-real-wiring-onedrive-<uuid>")
Test ... failed after 0.324 seconds with 3 issues.
PASS (resolver restored):
Test "Real wiring: AppDelegate.makeLaunchModel() + AppModel.bootstrap()
detect a marked OneDrive return" passed after 0.295 seconds.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZiTXPbPCSjzPVsfoweAbp
Two leak paths: (a) AtomicFile.write renames the temp file onto the probe
path and THEN fsyncs the containing directory — if that last fsync throws,
the probe file already exists on disk but the old code returned false
without ever attempting removal; (b) if the explicit removeItem call itself
threw, there was no retry, so a transient File Provider removal failure left
the file behind permanently.
Fix: an unconditional `defer` now checks fileExists and retries removeItem
regardless of which branch returned early. The function only reports true
when the explicit write, fsync (inside AtomicFile.write), AND removal all
succeeded AND the file is confirmed gone afterward.
New test: a FileManager subclass whose removeItem(at:) throws on its first
call (AtomicFile.write itself never touches this injected FileManager — it
uses raw Darwin/POSIX calls, not FileManager, so this only intercepts the
explicit removal + the defer's retry) asserts the function returns false AND
no probe file remains — verified this actually needs the defer by
temporarily removing it and confirming the same test then fails with a
leftover ".redline-probe-<uuid>" file (see this branch's history for the
discarded revert). The directory-fsync failure path has no injectable seam
(raw fsync(2) on an already-open fd, not parameterized by any FileManager or
other substitutable dependency, and not reproducible via chmod or other
standard test techniques) — documented in the test rather than simulated.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZiTXPbPCSjzPVsfoweAbp
Un-notarized fallback builds (Apple Development identity) are rejected by
spctl by design; the script must still publish them with a warning, otherwise
the fallback path can never release.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>