feat(sessions): past submissions list + start-new-session with 10-session retention

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.
This commit is contained in:
Claude Fable 5
2026-10-11 13:35:38 +04:00
parent eb1af5bf18
commit 6ab398c3f2
8 changed files with 790 additions and 18 deletions
+20
View File
@@ -119,6 +119,26 @@ struct MenuBarView: View {
}
.disabled(!model.canRevealLastPDF)
Button {
Task { await model.startNewSession() }
} label: {
actionLabel("Start new session")
}
.disabled(!model.canStartNewSession)
Button {
if let presenter = model as? SubmissionsWindowPresenting {
presenter.presentSubmissionsWindow()
} else {
model.setStatus("Past submissions are not available in this build.")
}
} label: {
actionLabel(
"Past submissions…",
trailing: model.pastSessions.isEmpty ? nil : "\(model.pastSessions.count)"
)
}
Button {
Task { await model.captureNow() }
} label: {