Skip to content

Render todos as markdown task lists#178

Merged
jeremy merged 4 commits intomainfrom
todos-md
Mar 3, 2026
Merged

Render todos as markdown task lists#178
jeremy merged 4 commits intomainfrom
todos-md

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Mar 3, 2026

Summary

  • Adds a task list markdown renderer (- [ ] / - [x]) for todo entities, replacing GFM pipe tables
  • Groups items by project (bucket.name) with headings suppressed for single groups
  • Introduces DisplayData on the response envelope to separate display data from JSON serialization — wrapper structs are preserved for --json while styled/markdown output gets the unwrapped slice
  • Wires up reports assigned to use the new presenter path with WithEntity("todo") + WithDisplayData
  • --group-by date dynamically overrides grouping to due_on via WithGroupBy
  • Empty results render *No results* consistently across both tasklist and table markdown paths

Fixes #176

Test plan

  • make check passes (lint, vet, unit tests, 257 e2e tests, naming, CLI surface, SDK provenance)
  • Output-layer tests verify JSON uses Data while markdown/styled use DisplayData
  • Presenter tests cover: task list rendering, grouped output, group-by override, "Other" heading for missing groups, empty states for both tasklist and table paths
  • Manual: basecamp reports assigned -m shows task lists grouped by project
  • Manual: basecamp reports assigned -j JSON shape unchanged (wrapper with person, grouped_by, todos)
  • Manual: basecamp reports assigned --group-by date -m groups by due date (todos without due_on land under "Other")
  • Manual: basecamp todos list -m --in <project> task list format, no group heading

jeremy added 3 commits March 2, 2026 23:54
Introduce MarkdownListView schema type with style and group_by fields.
When a schema declares style: tasklist, RenderListMarkdown renders
- [ ] / - [x] checkbox items instead of GFM pipe tables. Items are
grouped by a dot-path field (e.g. bucket.name) with headings suppressed
for single groups and "Other" for items missing the group field.

Adds PresentOption/WithGroupBy for dynamic group-by override, and
removes empty-slice bail in both presentStyled and presentMarkdown
so empty results are handled consistently by the renderers (both
paths now emit *No results* for empty data).
DisplayData (json:"-") provides alternate data for styled/markdown
rendering while keeping Data untouched for JSON serialization. This
lets commands preserve wrapper structs for machine output while
presenting unwrapped slices through the schema-aware presenter.

WithGroupBy threads a presenter option through the envelope to
override the schema's default group_by field at render time.
Wire up reports assigned to use WithEntity("todo") + WithDisplayData
for schema-aware rendering. JSON output preserves the full wrapper
struct; styled/markdown output presents the unwrapped todos through
the task list renderer. --group-by date maps to due_on grouping.

Adds output-layer tests for DisplayData contract (JSON uses Data,
markdown/styled use DisplayData) and presenter tests for task list
rendering, grouping, override, empty states, and Other heading.
Copilot AI review requested due to automatic review settings March 3, 2026 07:55
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) output Output formatting and presentation enhancement New feature or request labels Mar 3, 2026
Copy link

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 updates the presenter/output pipeline to render todo list results as Markdown task lists (with optional grouping) instead of GFM pipe tables, while preserving existing --json response shapes via a DisplayData mechanism.

Changes:

  • Adds schema support for markdown list overrides (style: tasklist, group_by) and implements task-list Markdown rendering with grouping and empty-state handling.
  • Introduces DisplayData and presenter options passthrough on the output response envelope so styled/markdown rendering can use an alternate shape without changing JSON serialization.
  • Wires reports assigned to render todos via the presenter (WithEntity("todo") + WithDisplayData) and overrides grouping to due_on when --group-by date is used.

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
internal/presenter/schemas/todo.yaml Declares markdown tasklist rendering and default grouping by bucket.name for todo list view.
internal/presenter/schema.go Extends list view schema to optionally include markdown rendering configuration.
internal/presenter/render.go Implements tasklist markdown rendering, dot-path grouping, and consistent *No results* handling for markdown lists.
internal/presenter/present.go Adds presenter options (e.g., group-by override) and ensures empty slices are still “handled” by the presenter.
internal/presenter/presenter_test.go Updates/extends presenter tests for tasklist output, grouping behavior, overrides, and empty states.
internal/output/envelope.go Adds DisplayData and presenter option passthrough so styled/markdown can render unwrapped data while JSON stays unchanged.
internal/output/output_test.go Adds contract tests validating JSON uses Data while markdown/styled use DisplayData, plus group-by override coverage.
internal/commands/reports.go Updates reports assigned to use the new presenter path and apply grouping override for --group-by date.

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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 663de703ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Only use "due:" prefix for `due_on` fields; other date columns use their
field label. Extract people names directly from the raw array value
instead of splitting the formatted comma-joined string, which broke names
containing commas (e.g. "Park, Joon-seo").
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 3, 2026
@jeremy jeremy merged commit c516df5 into main Mar 3, 2026
22 checks passed
@jeremy jeremy deleted the todos-md branch March 3, 2026 08:15
@jeremy jeremy mentioned this pull request Mar 3, 2026
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 tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Todos output to markdown

2 participants