Repository navigation
Conversation
An image pasted into a ticket's comment box was attached to the ticket,
not to the comment: after sending, the comment showed only its text and
the image was one more entry in the ticket's attachment list. A comment
like "it didn't work, see the image" lost what it pointed at.
Comments now carry attachments of their own, the way forum posts do.
- core: Comment.attachments (omitted from the ticket file when empty, so
existing tickets are unchanged) and ops::add_comment_with_attachments,
with a test. ops::add_comment keeps its signature.
- daemon: POST /api/tickets/{id}/comments accepts `attachments` (media
staged with POST /api/media, checked like a forum post's).
- board UI: media pasted into the comment box is staged, previewed under
the box as "Attached to this comment" (removable), and sent with the
comment; a comment shows its media as thumbnails under its text and a
click opens the full-screen preview. An image alone can be sent as a
comment. The ticket's own attachment list is no longer touched.
A local file path pasted into the comment box still attaches that file
to the ticket, as before.
NOT COMPILED: written without a Rust toolchain. The Rust part is
unbuilt and untested; the UI part is type-checked (svelte-check).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem. In a ticket's comment box I can paste an image, and it is previewed under the box. But it is attached to the ticket, not to the comment: after sending, the comment shows only its text, and the image is one more entry in the ticket's attachment list at the bottom. A comment like "it didn't work, see the image I attached" loses what it points at - and with several such comments nobody can tell which image belonged to which.
Change. A comment carries attachments of its own, the way a forum post already does.
Commentgetsattachments: Vec<Attachment>, serialized only when non-empty, so existing ticket files do not change and older tickets load as before. Newops::add_comment_with_attachments;ops::add_commentkeeps its signature (all its callers are untouched). One unit test.POST /api/tickets/{id}/commentsaccepts an optionalattachmentsarray - media staged withPOST /api/media, validated with the samechecked_mediaas forum posts.Not in this PR
wipe comment add --attach <file>would be the natural follow-up for agents), andwipe ticket showdoes not list a comment's media in its plain output; the JSON output carries them through serde..wipe/media/, like detaching does.How I tested
svelte-check0 errors, 0 warnings. In the browser (Vite dev UI againstwipe serve1.1.4, throwaway board, Windows 11, Chromium): pasting an image into the comment box stages it and shows it under the box, the ticket's attachment list and activity stay unchanged, and sending posts{ body, attachments: [...] }and clears the box.attachmentsfield, so I could not see a saved comment render its media. That path (Comment.attachmentsin the ticket JSON -> thumbnails) is untested.Checklist
a_comment_keeps_its_attachments; not runcargo fmtpasses with no diff - not runcargo clippy --workspace --all-targets -- -D warningspasses - not runcargo test --workspacepasses - not run.wipewrites still go throughwipe-core's deterministicserializer (no ad-hoc JSON serialization added)
(e.g.
feat(cli): add wipe ticket archive command)🤖 Generated with Claude Code