Skip to content

Attach images to a task, staged under .loopboard/cache/ - #52

Open
ArgonQQ wants to merge 5 commits into
mainfrom
task/t-att1
Open

Attach images to a task, staged under .loopboard/cache/#52
ArgonQQ wants to merge 5 commits into
mainfrom
task/t-att1

Conversation

@ArgonQQ

@ArgonQQ ArgonQQ commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

  • New Attach affordance on every editable-phase card: drag-drop onto the card, paste an image from the clipboard, or a file-picker icon-button — all three input gestures per the groomed decision.
  • Store.stageAttachment(taskId, filename, bytes, maxBytes?) (src/store.ts) validates an image-extension allowlist and a configurable size cap, sanitizes the filename, dedupes collisions, writes bytes under .loopboard/cache/<id>/, and appends a plain [name](.loopboard/cache/<id>/name) markdown link to the task's ## Description — no task-file grammar change, so the parser/writer fixpoint suites are untouched.
  • Cleanup: clearAttachments(taskId) deletes that task's cache dir, wired into acceptToDone (the decided single cleanup trigger) and deleteTask (opportunistic).
  • src/controller.ts: pickAttachment opens a host-side showOpenDialog (no bytes cross the webview boundary); attach decodes a base64 payload from drag-drop/paste (the only path for webview-originated bytes). openLink now also opens a .loopboard/-relative attachment link via vscode.open, alongside the existing http/https openExternal path.
  • media/board.js: extended the description markdown-link renderer to treat a .loopboard/cache/ relative path as clickable (previously http/https only), so the appended link actually renders.
  • New setting loopBoard.maxAttachmentSizeMB (default 10, min 1) makes the size cap configurable, added mid-review per request.
  • readme.md: documented cache/<id>/ in the storage layout and that staged attachments are ephemeral/gitignored, cleaned up on acceptance.
  • Update: Draft cards (created via the New Story composer's "Save draft") now also get the attach affordance — fixes reported feedback that no attach buttons appeared in the New Story area. A saved draft already carries a real id (assigned on serialize), so the same file-picker/drag-drop/paste wiring used on regular cards is now also wired on renderDraft.

Implements t-att1.

Test plan

  • make check (build + 102 unit tests + package) green
  • Manual F5 verification (VERIFICATION.md): attach an image via each of the three gestures on both a regular card and a Draft card, confirm the description link renders and opens the file, confirm the cache dir is removed on acceptance to DONE, and confirm loopBoard.maxAttachmentSizeMB actually caps upload size

Note

One acceptance-criterion detail — "verified by a unit test on the store cleanup path" — is not met literally: store.ts is a VSCode-touching module with no unit-test coverage anywhere in this codebase (per CLAUDE.md, manual F5 verification only). Adding vscode-mocking test infra for just this path would be new test architecture, not a surgical change, so clearAttachments is verified manually like the rest of store.ts. Flagging for reviewer visibility rather than silently deviating.

…che/

Drag-drop, clipboard paste, and a file-picker icon on every editable-phase card all stage
an image under .loopboard/cache/<id>/ via Store.stageAttachment (images only, configurable
size cap via loopBoard.maxAttachmentSizeMB), then append a plain markdown link to the
task's Description — no task-file grammar change. Extended the description-link renderer
to treat a .loopboard/cache/ relative path as clickable, and openLink to open it via
vscode.open. Staged files are ephemeral (.loopboard/ is gitignored) and are cleaned up
when the task is accepted to DONE.md (also opportunistically on task deletion).
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

📦 Build succeeded — installable .vsix for task/t-att1 (commit d83b693):

loopboard-todo-att1.vsix

Download from the run's Artifacts, unzip, then install: code --install-extension loopboard-todo-att1.vsix (or VS Code → Extensions → ⋯ → Install from VSIX…).

Attach (file-picker + drag-drop + paste) was only wired on renderCard,
so a draft created via the New Story composer had no way to attach an
image until it was groomed into a full story. Wire the same affordance
onto renderDraft cards, keyed on the id the draft already carries.
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

📦 Build succeeded — installable .vsix for task/t-att1 (commit 742b1f7):

loopboard-todo-att1.vsix

Download from the run's Artifacts, unzip, then install: code --install-extension loopboard-todo-att1.vsix (or VS Code → Extensions → ⋯ → Install from VSIX…).

…s too

Removes the file-picker attach button per user feedback ("I can not attach
images to new stories" / no visible buttons wanted). Drag-drop and paste now
work on the New Story composer (auto-saves the draft first, since there's no
task id yet), and on an open Description or answer field specifically (the
link folds into that field's own value and saves through the normal
field-patch path instead of always landing in Description).
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

📦 Build succeeded — installable .vsix for task/t-att1 (commit 0c79da5):

loopboard-todo-att1.vsix

Download from the run's Artifacts, unzip, then install: code --install-extension loopboard-todo-att1.vsix (or VS Code → Extensions → ⋯ → Install from VSIX…).

Pasting right after clicking "New Story" landed on whatever was
previously focused (or nothing), so the composer's paste listener
never saw the event. Focus the textarea on open, same pattern as the
search-box focus-restore.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

📦 Build succeeded — installable .vsix for task/t-att1 (commit 925025b):

loopboard-todo-att1.vsix

Download from the run's Artifacts, unzip, then install: code --install-extension loopboard-todo-att1.vsix (or VS Code → Extensions → ⋯ → Install from VSIX…).

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📦 Build succeeded — installable .vsix for task/t-att1 (commit 5b494a3):

loopboard-todo-att1.vsix

Download from the run's Artifacts, unzip, then install: code --install-extension loopboard-todo-att1.vsix (or VS Code → Extensions → ⋯ → Install from VSIX…).

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