Skip to content

Wire up markdown-to-HTML conversion for cards, schedule, and sweep#302

Merged
jeremy merged 4 commits intomainfrom
bc-9675502596
Mar 16, 2026
Merged

Wire up markdown-to-HTML conversion for cards, schedule, and sweep#302
jeremy merged 4 commits intomainfrom
bc-9675502596

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 15, 2026

Summary

  • Cards (create, update, card shortcut): Content field now runs through the full rich text pipeline before sending to the API. Previously markdown syntax appeared literally in Basecamp.
  • Schedule entries (create, update): Description field ("event details in HTML") now converts markdown to HTML with image and mention support.
  • Sweep (--comment): Comment content now matches comment create by running the full pipeline.
  • Messages update and comment update: Added resolveLocalImages — both paths already ran MarkdownToHTML but skipped image resolution, which meant ![alt](./file.png) produced broken <img src="./file.png"> tags in the request body.

All write paths now run the full pipeline: MarkdownToHTMLresolveLocalImagesresolveMentions.

Test plan

  • TestCardsCreateContentIsHTMLcards create sends <strong> not **
  • TestCardsUpdateContentIsHTMLcards update --body converts markdown
  • TestCardShortcutContentIsHTMLcard shortcut converts markdown
  • TestCardsCreateLocalImageErrors — local image path errors instead of serializing broken <img>
  • TestCardsUpdateLocalImageErrors — same for update path
  • TestCardsCreateRemoteImagePassesThrough — remote URLs preserved as <img>
  • TestScheduleCreateDescriptionIsHTMLschedule create --description converts
  • TestScheduleUpdateDescriptionIsHTMLschedule update --description converts
  • TestScheduleCreateLocalImageErrors — local image errors on create
  • TestScheduleUpdateLocalImageErrors — local image errors on update
  • TestSweepCommentContentIsHTMLsweep --comment converts markdown
  • TestSweepCommentLocalImageErrors — local image errors in sweep comment
  • bin/ci passes (lint, vet, unit tests, e2e, surface snapshot, skill drift)

@jeremy jeremy requested a review from a team as a code owner March 15, 2026 21:19
Copilot AI review requested due to automatic review settings March 15, 2026 21:19
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) labels Mar 15, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR wires Basecamp CLI rich-text handling into additional commands so Markdown input is converted to Basecamp-ready HTML before sending requests, aligning behavior across cards, schedule entries, and todo sweep comments.

Changes:

  • Convert card body/content Markdown to HTML on cards create, cards update --body, and the card shortcut (including mention resolution; create/shortcut also resolve local images).
  • Convert schedule entry --description Markdown to HTML on schedule create (full pipeline) and schedule update (mentions-only).
  • Convert todos sweep --comment Markdown to HTML (matching comment create pipeline) and add unit tests for each path.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/commands/cards.go Runs card content through Markdown→HTML and mention/image resolution before API requests (update matches existing “mentions-only on update” behavior).
internal/commands/cards_test.go Adds request-capture tests asserting card content is sent as HTML.
internal/commands/schedule.go Adds Markdown→HTML conversion (and mention/local-image resolution where applicable) for schedule descriptions.
internal/commands/schedule_test.go Adds request-capture tests asserting schedule descriptions are sent as HTML.
internal/commands/todos.go Converts sweep --comment content through the rich-text pipeline before creating comments.
internal/commands/todos_test.go Adds request-capture test asserting sweep comment content is sent as HTML.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added the bug Something isn't working label Mar 15, 2026
Copilot AI review requested due to automatic review settings March 15, 2026 21:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes rich-text handling across multiple write paths so user-provided Markdown is converted into Basecamp-compatible HTML, including local image upload/embedding and @mention resolution, before requests are sent to the API.

Changes:

  • Run the full rich-text pipeline (Markdown → local image resolution → mention resolution) for Cards content, Schedule description, and Todos sweep comments.
  • Add local image resolution to existing Markdown-to-HTML update flows for Messages and Comments.
  • Add/extend unit tests to assert HTML conversion and local-image error behavior for Cards, Schedule, and Sweep.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/commands/todos.go Converts todos sweep --comment through the rich-text pipeline before creating comments.
internal/commands/todos_test.go Adds sweep tests asserting HTML conversion and missing-local-image errors.
internal/commands/schedule.go Converts schedule entry --description (create/update) through the rich-text pipeline.
internal/commands/schedule_test.go Adds tests asserting schedule description HTML conversion and local-image error behavior.
internal/commands/cards.go Converts card body/content (create/update + card shortcut) through the rich-text pipeline.
internal/commands/cards_test.go Adds tests asserting card content HTML conversion and local-image/remote-image behavior.
internal/commands/messages.go Adds local image resolution to message update’s existing Markdown/mention pipeline.
internal/commands/comment.go Adds local image resolution to comment update’s existing Markdown/mention pipeline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jeremy added 4 commits March 15, 2026 18:13
cards create, cards update, and the card shortcut were sending raw
text for the Content field, which the SDK documents as rich text.
Markdown syntax appeared literally in Basecamp.

All paths now run MarkdownToHTML + resolveLocalImages + resolveMentions.
schedule create and schedule update were sending raw text for the
Description field, which the API documents as "event details in HTML".

Both paths now run MarkdownToHTML + resolveLocalImages + resolveMentions.
The sweep command was sending raw text for comment content, which the
API documents as "comment text in HTML". Now runs the full pipeline
(MarkdownToHTML + resolveLocalImages + resolveMentions), matching
the comment create command.
Both update paths ran MarkdownToHTML but skipped resolveLocalImages,
which meant ![alt](./file.png) produced broken <img src="./file.png">
in the request body. Now both paths run the full pipeline, matching
their respective create commands.
@github-actions github-actions bot added enhancement New feature or request and removed bug Something isn't working labels Mar 16, 2026
@jeremy jeremy merged commit 04e6b5b into main Mar 16, 2026
25 checks passed
@jeremy jeremy deleted the bc-9675502596 branch March 16, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations enhancement New feature or request tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants