Skip to content

feat(tui): attach local images to notes - #113

Merged
backnotprop merged 1 commit into
mainfrom
feat/image-attachments
Oct 27, 2026
Merged

backnotprop merged 1 commit into
mainfrom
feat/image-attachments

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Rebuilds the image-attachment half of #73 (by @MaterAnime, credited as co-author) on current main. The multi-reply half of #73 already shipped, so it is not included.

What it does

  • I (attach-image) opens a one-line path prompt for the selected note in the notes rail, or the selected block's note in the document. Typed, pasted (bracketed paste) and dropped paths work: quotes, ~, file://, shell-escaped spaces, and paths relative to the document's folder. Missing files and non-image extensions (png, jpg, jpeg, gif, webp, bmp, svg) are refused in the status line with the prompt left open; a path already on the note is ignored.

  • D (remove-image) removes the last image added. Both keys are rebindable under [keys], unused elsewhere in the default keymap, and shown in the footer hints from the keymap.

  • Paths are stored under the annotation's plannotator_tui.images, omitted when empty, so older records load unchanged and Workspaces' attachments (https URLs only) is untouched.

  • Adding or removing an image makes a sent note pending again.

  • Feedback and --export list each image under its note:

    ## Annotation 1 (line 3)
    Comment on: "Ship the login page."
    > check spacing
    Image: /Users/me/shots/screen shot.png
    
  • The rail bubble title shows · 1 image / · N images; the feedback archive's counts.images is filled.

  • Images stay local references: nothing is copied or uploaded.

Decision 16 in docs/decisions.md records the storage and output choices; README key tables are updated.

Tests: schema round trip and old-record compatibility, export line format, path parsing (quotes, relative, file://, escaped spaces, missing, wrong extension, directories), and an app flow test (attach from document and rail, duplicate, send, archive count, reopen, remove). cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, and cargo test --workspace --all-targets pass locally; also smoke-tested in tmux.

Refs #73

@backnotprop
backnotprop force-pushed the feat/image-attachments branch 2 times, most recently from a0fd115 to 0ced7f5 Compare October 27, 2026 18:39
`I` (attach-image) opens a one-line path prompt for the selected note, or
the selected block's note in the document. It accepts typed, pasted and
dropped paths: quotes, `~`, `file://`, shell-escaped spaces, and paths
relative to the document's folder. Missing files and non-image extensions
are refused with the reason; a path already on the note is ignored.
`D` (remove-image) drops the last image. Both are rebindable.

Paths are stored under the annotation's `plannotator_tui.images`, omitted
when empty, so older records load unchanged. Adding or removing an image
makes a sent note pending again. Feedback and `--export` list each image
as `Image: <absolute path>` under its note, the rail marks notes with
images, and the feedback archive counts them. Files are referenced, never
copied or uploaded.

Rebuilt from #73.

Co-authored-by: MaterAnime <272887717+MaterAnime@users.noreply.github.com>
@backnotprop
backnotprop force-pushed the feat/image-attachments branch from 0ced7f5 to 662b2d9 Compare October 27, 2026 18:46
@backnotprop
backnotprop added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit cd29786 Oct 27, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/image-attachments branch October 27, 2026 18:54
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