Skip to content

Show comments by default in basecamp show#389

Merged
jeremy merged 11 commits intomainfrom
show-include-comments
Mar 27, 2026
Merged

Show comments by default in basecamp show#389
jeremy merged 11 commits intomainfrom
show-include-comments

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Mar 26, 2026

What

  • fetch comments by default in basecamp show when the recording exposes a comment count
  • cap the default embedded discussion at 100 comments and add --all-comments to opt into the full discussion
  • keep --no-comments as the opt-out path, and make --no-comments / --all-comments mutually exclusive
  • include comment counts in the summary and add breadcrumbs to basecamp comments list --all and, when truncated, basecamp show --all-comments
  • emit a truncation notice when more comments exist than were embedded by default
  • render fetched comments as a dedicated section in styled and markdown output instead of dumping the raw field
  • preserve attachment rendering improvements alongside the new comment output
  • improve mention-to-markdown rendering for figure-style mention attachments
  • handle both comments_count and comment_count so supported record types like columns also fetch comments correctly
  • update the Basecamp skill docs for the final default/opt-in behavior
  • tighten JSON-output tests to decode the envelope/data and assert structurally instead of relying on substring checks

Closes #385

Why

basecamp show already gives a good single-item view, but it still required a second command to see the discussion on that item. Making comments part of the default output turns show into a more complete detail view.

Capping the default embed at 100 comments keeps that default view practical for large threads, avoiding unexpectedly expensive multi-page fetches and huge output while still making the full discussion available via --all-comments. The truncation notice and follow-up breadcrumb make that behavior explicit.

The comment_count fallback fixes a gap discovered during review: some supported record types do not use comments_count, so without the fallback they would silently miss comment fetching.

Testing

  • bin/ci passes

Summary by cubic

Show comments by default in basecamp show, capped at 100, with clear notices, breadcrumbs, and clean Styled/Markdown rendering. JSON output embeds a top‑level comments array when fetched and preserves large ID precision.

  • New Features

    • Embed up to 100 comments by default when a count is present; --all-comments fetches all, --no-comments skips.
    • If truncated, show “Showing X of Y comments — use --all-comments…” and add a breadcrumb to basecamp show --all-comments <id>; summary shows “(n comments)” and adds a breadcrumb to basecamp comments list --all <id>.
    • Styled/Markdown render a “Comments” section and “Content Attachments” / “Description Attachments”; list cells prefer filenames/captions; fallback to comment_count covers more record types; improved figure-style @mention rendering; docs updated.
    • Extracted reusable helpers (addCommentFlags, fetchRecordingComments) to share comment embedding and flags across commands.
  • Bug Fixes

    • Preserve large ID precision when injecting comments into JSON by decoding with UseNumber.
    • On comment fetch failures, emit a diagnostic that preserves the attachment download notice and keeps the attachment breadcrumb.
    • Return a clear error if --no-comments and --all-comments are provided together.
    • Narrow the renderer’s filter to only hide synthetic content_attachments/description_attachments; native attachment fields like previewable_attachments now render correctly.

Written for commit 3dd08b8. Summary will update on new commits.

Copilot AI review requested due to automatic review settings March 26, 2026 15:45
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) skills Agent skills output Output formatting and presentation labels Mar 26, 2026
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 enhances basecamp show to include related comments by default (when the API exposes a comment count), improves how comments/attachments/mentions render in styled + markdown output, and documents the new CLI behavior.

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.

Changes:

  • Fetch and embed comments by default in basecamp show (with --no-comments to opt out), and surface comment counts + a breadcrumb to basecamp comments list.
  • Render comments and attachment metadata as dedicated sections in styled/markdown output (instead of dumping raw fields).
  • Improve richtext mention-to-markdown conversion for figure-style mention attachments, with new test coverage.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
skills/basecamp/SKILL.md Updates Basecamp skill docs to reflect default comment inclusion and the new opt-out flag.
internal/commands/show.go Implements comment fetching logic, summary/breadcrumb updates, and notice handling for failures.
internal/commands/show_test.go Adds comprehensive tests for comment fetching behavior, opt-out flag, and rendering expectations.
internal/output/render.go Adds structured rendering for top-level comments and attachment sections in styled/markdown output.
internal/output/output_test.go Adds tests verifying attachment sections render cleanly (no raw map dumps).
internal/richtext/richtext.go Improves mention rendering by extracting display names from figure-style mention attachments.
internal/richtext/richtext_test.go Adds regression test for figure mention rendering.
.surface Registers the basecamp show --no-comments flag for surfaced CLI metadata.

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

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.

1 issue found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/commands/show_test.go">

<violation number="1" location="internal/commands/show_test.go:440">
P3: JSON-output tests added here rely on substring checks of raw output; decode stdout and assert fields structurally to avoid brittle or false-positive assertions.

(Based on your team's feedback about using structured JSON assertions instead of substring checks.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions github-actions bot added the enhancement New feature or request label Mar 26, 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.

1 issue found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/commands/show_test.go">

<violation number="1" location="internal/commands/show_test.go:340">
P2: Parse/decode the JSON data into a map or struct and assert key presence and values via structured lookups rather than using string containment checks, which are brittle.

(Based on your team's feedback about validating JSON output via structured lookups.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@robzolkos
Copy link
Copy Markdown
Collaborator Author

Fixed — updated the JSON-output tests to decode the response envelope/data and assert title/comments structurally instead of relying on substring checks (issues identified by cubic).

Copilot AI review requested due to automatic review settings March 26, 2026 16:56
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


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

@robzolkos
Copy link
Copy Markdown
Collaborator Author

Fixed — capped {
"ok": false,
"error": "ID required",
"code": "usage"
} to 100 embedded comments by default, added for full discussions, and now surface a truncation notice when more comments are available.

@github-actions github-actions bot added the breaking Breaking change label Mar 26, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

⚠️ Potential breaking changes detected:

  • Change in behavior: the basecamp show command now fetches comments by default, which could impact scripts or integrations that parsed data or relied on the absence of comments.
  • Addition of mutually exclusive flags --no-comments and --all-comments, which need to be handled explicitly in scripts or integrations.
  • Output format change: the comments field is added to the JSON output when comments are fetched, potentially breaking parsing logic in existing scripts expecting a specific format without comments.

Review carefully before merging. Consider a major version bump.

@robzolkos
Copy link
Copy Markdown
Collaborator Author

Fixed — capped basecamp show to 100 embedded comments by default, added --all-comments for full discussions, and now surface a truncation notice when more comments are available.

Copilot AI review requested due to automatic review settings March 26, 2026 18:15
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

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


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

@github-actions github-actions bot removed the breaking Breaking change label Mar 26, 2026
@robzolkos robzolkos requested a review from jeremy March 26, 2026 18:57
Move comment-fetching logic from show.go into comments_embed.go so
todos, messages, cards, and files can reuse addCommentFlags /
fetchRecordingComments in follow-up PRs.

Narrow the renderer's _attachments suffix filter to exact matches on
content_attachments and description_attachments — the two synthetic
keys the CLI injects — so native API fields like
previewable_attachments are no longer silently dropped by
`basecamp api get` styled output.
Copilot AI review requested due to automatic review settings March 27, 2026 21:17
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


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

Match the withAttachmentMeta pattern: decode with UseNumber so IDs
above 2^53 survive the struct-to-map round-trip when future callers
pass typed structs.
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.

1 issue found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/commands/comments_embed.go">

<violation number="1" location="internal/commands/comments_embed.go:147">
P2: Preserve numeric ID precision here by decoding with UseNumber; json.Unmarshal converts numbers to float64, which can round large Basecamp IDs in JSON output.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown
Member

@jeremy jeremy left a comment

Choose a reason for hiding this comment

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

Extracted a comments embed. Will extend with --comments on other subcommands in follow-up PR.

Copilot AI review requested due to automatic review settings March 27, 2026 21:33
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

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


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

@jeremy jeremy merged commit c42190e into main Mar 27, 2026
30 checks passed
@jeremy jeremy deleted the show-include-comments branch March 27, 2026 21:46
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 output Output formatting and presentation skills Agent skills tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

show should include comments by default to match the web reading experience

3 participants