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-lillard jr-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 owner August 26, 2026 14:23
Copilot AI balanced review requested due to automatic review settings August 26, 2026 14:23

Copilot AI 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
File Description
.surface Records new commands and flags.
README.md Documents HTML input and draft exports.
skills/hey/SKILL.md Updates bundled agent guidance.
tests/smoke/draft_lifecycle_test.go Smoke-tests draft HTML and export.
internal/output/writer.go Updates HTML format documentation.
internal/cmd/topic.go Updates HTML-fragment commentary.
internal/cmd/thread_reply_test.go Tests reply HTML-file input.
internal/cmd/root.go Enables HTML output for draft show.
internal/cmd/reply.go Adds reply HTML-file input.
internal/cmd/message_html_file.go Implements validated HTML-file reading.
internal/cmd/message_html_file_test.go Tests validation and exclusivity.
internal/cmd/journal.go Uses shared HTML-fragment writer.
internal/cmd/html.go Adds shared fragment writer.
internal/cmd/html_test.go Tests fragment output.
internal/cmd/forward.go Adds forward HTML-file input.
internal/cmd/forward_test.go Tests forward file input.
internal/cmd/drafts.go Registers draft export.
internal/cmd/draft.go Adds HTML output, metadata, and file editing.
internal/cmd/draft_test.go Tests new draft behavior.
internal/cmd/draft_export.go Implements staged draft bundles.
internal/cmd/draft_export_test.go Tests export integrity and replacement.
internal/cmd/draft_export_commit_windows.go Adds Windows no-replace publishing.
internal/cmd/draft_export_commit_other.go Adds fallback publishing.
internal/cmd/draft_export_commit_linux.go Adds Linux no-replace publishing.
internal/cmd/draft_export_commit_darwin.go Adds macOS no-replace publishing.
internal/cmd/contacts_show.go Uses shared fragment output.
internal/cmd/contact_note_show.go Uses shared fragment output.
internal/cmd/compose.go Adds compose HTML-file input.
internal/cmd/compose_test.go Tests compose file input.
internal/cmd/bulk_reply.go Adds bulk-reply HTML-file input.
internal/cmd/bulk_reply_test.go Tests bulk-reply file input.
internal/cmd/attachments_test.go Tests 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 thread internal/cmd/draft.go Outdated
Comment thread internal/cmd/draft_export.go Outdated
Comment thread internal/cmd/draft_export.go Outdated
Comment thread internal/cmd/draft_export.go Outdated
@github-actions github-actions Bot added the deps label Aug 26, 2026
Sign up for free to 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