Skip to content

feat: make any of a ticket's images its cover - #6

Draft
bchbib wants to merge 2 commits into
eigenpair:mainfrom
bchbib:feat/make-cover
Draft

bchbib wants to merge 2 commits into
eigenpair:mainfrom
bchbib:feat/make-cover

Conversation

@bchbib

@bchbib bchbib commented Dec 1, 2026

Copy link
Copy Markdown

Draft - the Rust part is not compiled. I wrote it without a Rust toolchain on my machine, so cargo build, fmt, clippy and the tests have not run. Please treat the Rust changes as a worked-out proposal that may need fixing; CI on this PR is their first build. The UI part is type-checked and I checked in the browser that the button appears and sends the request.

Stacked on #5 (the header gallery): until that is merged this PR shows its commit too. Only the second commit is new here.

Description

Problem. The cover - the image a ticket's card shows on the board - is always the first image attached. To show a different one you have to detach and re-attach files in the right order.

Change. Any of a ticket's images can be made the cover.

  • Board UI: in the ticket header gallery (feat(ui): image gallery in the ticket header, image count on the card #5), the image in view shows a Make cover button where the first image shows the Cover mark. Clicking it saves the choice; the image stays in view, now as number one, and the card on the board shows it. Hidden in read-only mode.
  • Core: ops::set_cover(store, ticket_id, path, actor, now). The cover stays what it is today - the first image among the attachments - so this moves the chosen attachment to the front of the list and keeps the others in order. No new field in the ticket file, older clients keep working, and the write goes through Store::save_ticket like every other. It logs a cover activity and is a no-op when the attachment is already first. One unit test.
  • Daemon: POST /api/tickets/{id}/attachments/cover with { "path": ... } (same body as detaching).
  • CLI: wipe media cover <ticket> <name>, so agents can do it too; added to the docs data.
  • The activity feed says "made <name> the cover".

Design question for you. I chose reordering over an explicit cover field because it needs no schema change. The cost: the attachment list's order changes, and a non-image attachment can be moved to the front through the CLI (harmless - the cover is still the first image). If you prefer a cover: Option<String> field on the ticket, I'll rework it.

How I tested

  • UI: svelte-check 0 errors, 0 warnings. In the browser against wipe serve 1.1.4: the button appears on images 2 and 3 only, and a click sends POST .../attachments/cover - which that daemon does not know yet, so nothing was saved.
  • Rust: not built, not tested (see the note at the top).

Checklist

  • I've described the change and the motivation above
  • Tests were added or updated to cover this change (or N/A, with reason) - one core test, set_cover_moves_an_attachment_to_the_front; not run
  • cargo fmt passes with no diff - not run
  • cargo clippy --workspace --all-targets -- -D warnings passes - not run
  • cargo test --workspace passes - not run
  • All .wipe writes still go through wipe-core's deterministic
    serializer (no ad-hoc JSON serialization added)
  • The PR title follows Conventional Commits
    (e.g. feat(cli): add wipe ticket archive command)

🤖 Generated with Claude Code

bchbib and others added 2 commits December 1, 2026 17:12
…t on the card

A ticket with several images showed only the first one: on its card and as
the header of the ticket view. The others sat in the attachment list at the
bottom of the ticket and were easy to miss; on the board nothing said they
were there.

- Card: when a ticket holds more than one image, its cover carries a small
  badge with the number of images.
- Ticket view: with more than one image the header is a small gallery.
  Previous / next buttons on the image, or the left and right arrow keys,
  step through the images and wrap around; a counter shows the position and
  the first image is marked "Cover" (the one the card shows).
- The arrow keys are left alone while typing in a field, while the
  full-screen preview is open and when a modifier is held.

Frontend only; tickets with one image or none look as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The cover - the image a ticket's card shows on the board - was always the
first image attached. To show another one you had to detach and re-attach
files in the right order.

The cover stays "the first image among the attachments", so choosing one
moves that attachment to the front of the list; the others keep their
order and the ticket file gets no new field.

- core: ops::set_cover (logs a `cover` activity; a no-op when the
  attachment is already first), with a test.
- daemon: POST /api/tickets/{id}/attachments/cover { path }.
- cli: wipe media cover <ticket> <name>.
- board UI: stepping to another image in the ticket header shows a
  "Make cover" button in place of the "Cover" mark; the activity feed
  says "made <name> the cover".

Builds on the header gallery (feat/ticket-image-gallery).

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>
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