Skip to content

feat(cli, term): Show conversation attachments in jp conversation show#813

Merged
JeanMertz merged 3 commits into
mainfrom
jp-c-show-attachments
Jun 29, 2026
Merged

feat(cli, term): Show conversation attachments in jp conversation show#813
JeanMertz merged 3 commits into
mainfrom
jp-c-show-attachments

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

jp conversation show now lists the attachments associated with a conversation under an "Attachments" field. Each attachment renders as scheme (description): url when the URL carries a description query parameter, and as the bare URL otherwise. The JSON output serializes each attachment as an object with scheme, description, and url fields.

To support list-valued fields in the details view, jp_term::table gains three new types: DetailRow, DetailValue, and DetailItem. DetailRow replaces the raw comfy_table::Row type throughout print_details, details, details_markdown, and details_json. A DetailValue::List renders as a bulleted block in the pretty terminal view, expands to one row per item in the pipe-delimited markdown view, and becomes a JSON array in the JSON views. The DetailItem type lets the text and JSON representations differ so an attachment can read naturally in the terminal while still being structured in JSON.

DetailsFmt in jp_cli gains an attachments field and a with_attachments builder method, and the attachment_detail_item helper in jp_cli::format constructs the right DetailItem from any attachment URL.

`jp conversation show` now lists the attachments associated with a
conversation under an "Attachments" field. Each attachment renders as
`scheme (description): url` when the URL carries a `description` query
parameter, and as the bare URL otherwise. The JSON output serializes
each attachment as an object with `scheme`, `description`, and `url`
fields.

To support list-valued fields in the details view, `jp_term::table`
gains three new types: `DetailRow`, `DetailValue`, and `DetailItem`.
`DetailRow` replaces the raw `comfy_table::Row` type throughout
`print_details`, `details`, `details_markdown`, and `details_json`. A
`DetailValue::List` renders as a bulleted block in the pretty terminal
view, expands to one row per item in the pipe-delimited markdown view,
and becomes a JSON array in the JSON views. The `DetailItem` type lets
the text and JSON representations differ so an attachment can read
naturally in the terminal while still being structured in JSON.

`DetailsFmt` in `jp_cli` gains an `attachments` field and a
`with_attachments` builder method, and the `attachment_detail_item`
helper in `jp_cli::format` constructs the right `DetailItem` from any
attachment URL.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit addfa9a into main Jun 29, 2026
16 checks passed
@JeanMertz JeanMertz deleted the jp-c-show-attachments branch June 29, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant