Skip to content

feat(reply-drafts): Reply Drafts section for prepared replies#70

Open
yustme wants to merge 2 commits into
mainfrom
feat/reply-drafts
Open

feat(reply-drafts): Reply Drafts section for prepared replies#70
yustme wants to merge 2 commits into
mainfrom
feat/reply-drafts

Conversation

@yustme

@yustme yustme commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Adds a Reply Drafts sidebar section that surfaces the prepared replies Scout writes to drafts/<TAG>.md — one card per open loop where you owe someone an answer.

Each card shows the recipient, subject, channel + status chips, and the full drafted reply body (selectable). Actions: Copy (body to clipboard), Open thread (the original conversation), Mark sent, Dismiss, and Reopen for resolved drafts.

Hard constraint

The app never sends and never creates a native draft. The only side effect of Mark sent / Dismiss / Reopen is flipping the file’s status: field (draft → sent | dismissed) — sending stays the user’s action. Mirrors how the Proposals feature flips a status field.

Implementation

New module Scout/ReplyDrafts/, modelled on Scout/Proposals/:

  • Models ReplyDraft, DraftStatus (draft|sent|dismissed), DraftChannel (email|slack|linear|github|whatsapp).
  • ReplyDraftsParser (frontmatter + body), ReplyDraftsWriter (status rewrite via GuardedFileWrite + scoped git commit), ReplyDraftsDocumentService (FSEvents-backed, pending-count badge).
  • Views: RepliesView, ReplyDraftCardView, DraftStatusPill, ChannelBadge.
  • Wired into AppState (service + writer box, loaded at launch, badge reactivity), MainWindowView (SidebarItem.replyDrafts + detail route), SidebarView (badge row). New files land in the file-system-synchronized Scout / ScoutTests groups, so no project.pbxproj edits.

Contract

The drafts/<TAG>.md frontmatter (tag, channel, loop_type, to, thread_ref, subject, status, created, context_answer_ref) matches what scout-plugin writes. The app writes back only the canonical lowercase status: word so a re-read by Scout round-trips.

Tests

Swift Testing suites for status/channel parsing, draft parsing (incl. README-without-frontmatter skipped, chat channels omitting subject, promise-answered context ref), and the writer (pure status rewrite + end-to-end with git commit scoped to drafts/<tag>.md). Full build + xcodebuild test run on CI.

Companion

Paired with the scout-plugin PR (Raven-Scout/scout-plugin#175) that detects the loops and writes these draft files.

yustme added 2 commits June 29, 2026 23:40
Adds a Reply Drafts sidebar section that surfaces the prepared replies Scout
writes to drafts/<TAG>.md — one card per open loop where the user owes an
answer. Read the full drafted text, Copy it, Open the original thread, then
Mark sent / Dismiss. The app NEVER sends and never creates a native draft; it
only flips the file's status: field (draft -> sent | dismissed), mirroring the
Proposals feature.

New module Scout/ReplyDrafts/ (model, channel/status enums, parser, status
writer via GuardedFileWrite + git, FSEvents-backed document service, cards).
Wired into AppState + MainWindowView + SidebarView. Swift Testing coverage for
status/channel parsing, draft parsing, and the status-rewrite writer (pure +
end-to-end with git). Contract matches scout-plugin drafts/<TAG>.md.
Adds an 'app' job that produces an unsigned Release Scout.app and uploads it as
the Scout-app artifact, so the build (with reply-drafts changes) can be
downloaded and run without a local Xcode. Mirrors the step on feat/knowledge-base.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant