Skip to content

Add HTML file input and complete draft exports - #340

Open
jr-lillard wants to merge 5 commits into
basecamp:mainfrom
jr-lillard:build/hey-draft-features-v1.2.1
Open

Add HTML file input and complete draft exports#340
jr-lillard wants to merge 5 commits into
basecamp:mainfrom
jr-lillard:build/hey-draft-features-v1.2.1

Conversation

@jr-lillard

@jr-lillardjr-lillard commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add --message-html-file to compose, reply, forward, bulk reply, and draft editing with regular-file and UTF-8 validation
  • add byte-exact draft show --html output and safe ordered attachment metadata
  • add all-or-nothing draft export bundles containing exact HTML, safe JSON, and verified attachment downloads, with narrowly guarded same-draft --force replacement
  • document the new surfaces in command help, README, and the bundled HEY skill

This branch builds independently against the released HEY SDK v0.27.0 and does not add a module replacement.

Testing

  • TMPDIR=/tmp GOWORK=off make release-check
  • gitleaks v8.21.2
  • coverage floor check: 83.115% (17,081 / 20,551 statements; required 70.8%)
  • Linux amd64 and Windows amd64 cross-builds
  • ARM64 smoke-test compilation

Summary by cubic

Adds --message-html-file to compose, reply, forward, bulk reply, and draft edit so raw HTML messages can be read from a local file instead of passed inline, with regular-file and UTF-8 validation. Adds byte-exact draft show --html output with safe attachment metadata, plus a new draft export command that writes an all-or-nothing bundle containing the exact HTML, a JSON manifest, and SHA-256-verified attachment downloads.

New Features

  • draft export writes a hey-draft-export/v1 bundle into a new directory and commits it atomically on macOS and Linux, refusing to overwrite an existing one; --force swaps the new bundle in atomically where the OS supports it.
  • draft show --json now includes attachment filename, content type, and byte size, without internal locators.
  • Documented the new surfaces in command help, README, and the bundled HEY skill.

Written for commit 510126f. Summary will update on new commits.

Review in cubic

@jr-lillard
jr-lillard requested a review from a team as a code ownerAugust 26, 2026 14:23
CopilotAI balanced review requested due to automatic review settings August 26, 2026 14:23

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds raw HTML file input across email commands and comprehensive local draft export support.

Changes:

  • Adds --message-html-file to five email workflows.
  • Adds draft HTML output, attachment metadata, and staged export bundles.
  • Updates tests, documentation, help, and command-surface snapshots.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
.surfaceRecords new commands and flags.
README.mdDocuments HTML input and draft exports.
skills/hey/SKILL.mdUpdates bundled agent guidance.
tests/smoke/draft_lifecycle_test.goSmoke-tests draft HTML and export.
internal/output/writer.goUpdates HTML format documentation.
internal/cmd/topic.goUpdates HTML-fragment commentary.
internal/cmd/thread_reply_test.goTests reply HTML-file input.
internal/cmd/root.goEnables HTML output for draft show.
internal/cmd/reply.goAdds reply HTML-file input.
internal/cmd/message_html_file.goImplements validated HTML-file reading.
internal/cmd/message_html_file_test.goTests validation and exclusivity.
internal/cmd/journal.goUses shared HTML-fragment writer.
internal/cmd/html.goAdds shared fragment writer.
internal/cmd/html_test.goTests fragment output.
internal/cmd/forward.goAdds forward HTML-file input.
internal/cmd/forward_test.goTests forward file input.
internal/cmd/drafts.goRegisters draft export.
internal/cmd/draft.goAdds HTML output, metadata, and file editing.
internal/cmd/draft_test.goTests new draft behavior.
internal/cmd/draft_export.goImplements staged draft bundles.
internal/cmd/draft_export_test.goTests export integrity and replacement.
internal/cmd/draft_export_commit_windows.goAdds Windows no-replace publishing.
internal/cmd/draft_export_commit_other.goAdds fallback publishing.
internal/cmd/draft_export_commit_linux.goAdds Linux no-replace publishing.
internal/cmd/draft_export_commit_darwin.goAdds macOS no-replace publishing.
internal/cmd/contacts_show.goUses shared fragment output.
internal/cmd/contact_note_show.goUses shared fragment output.
internal/cmd/compose.goAdds compose HTML-file input.
internal/cmd/compose_test.goTests compose file input.
internal/cmd/bulk_reply.goAdds bulk-reply HTML-file input.
internal/cmd/bulk_reply_test.goTests bulk-reply file input.
internal/cmd/attachments_test.goTests HTML-file drafts with attachments.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadinternal/cmd/draft.go Outdated
Comment threadinternal/cmd/draft_export.go Outdated
Comment threadinternal/cmd/draft_export.go Outdated
Comment threadinternal/cmd/draft_export.go Outdated
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jr-lillard