Files in this chat — persistent per-chat artifact registry
Summary
A persistent "Files in this chat" surface inside the chat view that lists every artifact the agent has generated in the current thread, with per-row Download / Reveal-in-folder / Delete affordances. Survives app restarts (for files created in-session) so the user can return to a chat and still grab a deck they made earlier.
Problem
The inline ArtifactCard shipped in #2779 (PR #3017) sits above the composer as a single ephemeral card per artifact:
- Scrolling, sending the next turn, or restarting the app loses the card.
- The
artifactsByThreadRedux slice is in-memory only (app/src/store/index.ts:158registerschatRuntimeReducerdirectly, nopersistReducer), so files vanish across app restarts even though the underlying payload is still on disk under<workspace>/artifacts/<uuid>/. - There is no place to enlist all files involved in a chat.
User feedback (live dev:app test, 2026-05-30): "there should be a place to enlist all the files involved in a chat" — flagged after a generated climate-change-an-overview.pptx was visible once, then the user couldn't find it again after a new turn was sent.
Solution
Frontend-only addition layered on top of the artifact pipeline already shipped in #2779:
ChatFilesChip(new component) — header chip with paperclip icon + count badge. Hidden when artifact count = 0. Owns popover open/close + click-outside + Esc.ChatFilesPanel(new component) — popover panel listing per-thread artifacts (title + kind icon + size + Download + Reveal + Delete with confirm modal). UsesuseT()+ Tailwind + inline SVGs (mirrorsArtifactCard.tsxstyle — no new icon dep).- Persistence — wrap
chatRuntimeReducerwithpersistReducer+ acreateTransformthat keeps onlystatus === 'ready'entries on storage write (in_progress/failedstay session-scoped — should not survive a restart). - Delete flow — frontend
deleteArtifact()service +removeArtifactForThreadreducer; optimistic FE removal with rollback on RPC error. RPCopenhuman.ai_delete_artifactalready exists. - Above-composer card on
ready— filterstatus === 'ready'OUT of the existing above-composer block (delegated to the panel).in_progress/failedkeep showing there for live feedback.
Known backend gap (deferred to a follow-up)
ArtifactMeta (src/openhuman/artifacts/types.rs:80-102) has no thread_id field, and openhuman.ai_list_artifacts is workspace-scoped (only offset / limit). So a true cold-load-from-RPC for a single thread is not possible today. This issue ships persisted-slice + RPC fetch for the artifacts the slice knows about; a follow-up should persist thread_id into ArtifactMeta + add a thread_id filter param on ai_list_artifacts for full cold-load support.
Files (estimated)
| File | New/Modified | Est. LOC |
|---|---|---|
app/src/components/chat/ChatFilesPanel.tsx |
NEW | 200 |
app/src/components/chat/ChatFilesChip.tsx |
NEW | 90 |
app/src/components/chat/__tests__/ChatFilesPanel.test.tsx |
NEW | 220 |
app/src/components/chat/__tests__/ChatFilesChip.test.tsx |
NEW | 90 |
app/src/store/__tests__/chatRuntimeSlice.test.ts |
MODIFIED | +80 |
app/src/services/__tests__/artifactDownloadService.test.ts |
NEW | 120 |
app/src/pages/Conversations.tsx |
MODIFIED | +30 / -20 |
app/src/store/chatRuntimeSlice.ts |
MODIFIED | +35 |
app/src/store/index.ts |
MODIFIED | +40 |
app/src/services/artifactDownloadService.ts |
MODIFIED | +35 |
app/src/lib/i18n/en.ts |
MODIFIED | +12 |
app/src/lib/i18n/{ar,bn,de,es,fr,hi,id,it,ko,pl,pt,ru,zh-CN}.ts × 13 |
MODIFIED | +156 |
Total estimated: 1100–1700 LOC (FE-only; 0 Rust, 0 Tauri).
Acceptance criteria
- [ ] ChatFilesChip in header — paperclip + count badge appears in the chat header when at least one artifact exists for the active thread; hidden when count = 0; aria-label
chat.files.chip.aria("{count} files in this chat"). - [ ] ChatFilesPanel popover — opens on chip click; closes on Esc + click-outside; each row shows kind icon + title + human-readable size; Download / Reveal / Delete buttons per row.
- [ ] Delete with confirm — Delete row → confirm modal → optimistic remove from slice + RPC
openhuman.ai_delete_artifact→ on RPC error, re-insert + show toastchat.files.delete.failed. - [ ] Cross-restart persistence — generated
.pptxsurvives app quit + relaunch; onlystatus === 'ready'entries are persisted (in_progress / failed are session-only viacreateTransformoutbound filter). - [ ] Above-composer card delegates
readyto panel — the existingArtifactCardrender block keeps in_progress / failed cards visible there but hidesreadycards (they live in the panel only). No double-rendering. - [ ] Empty state — panel shows
chat.files.panel.empty("No files yet. Ask the agent to generate one.") when count = 0 (chip is hidden, so this is only seen if the panel is open while the last artifact is deleted). - [ ] i18n parity — 12 new keys × 14 locales;
pnpm i18n:check(parity) andpnpm i18n:english:check(no English leaks) both green for the new keys. - [ ] Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate per
.github/workflows/pr-ci.yml. New Vitest suites cover: panel populated render, optimistic delete + RPC rollback, download/reveal delegation, confirm-modal cancel path, chip hidden-when-zero, chip count badge, slice persist-transform filter.
Related
- Parent epic: #1535 "Add multimodal support for files and PPT generation"
- Sub-tasks of #1535:
- #2776 ✅ merged (artifact storage /
artifactsdomain) - #2777 (multimodal file attachments) — PR #2954 open
- #2778 (presentation tool backed by python-pptx) — PR #3016 open
- #2779 (inline ArtifactCard + Tauri download) — PR #3017 open ← this issue extends that work
- #2780 (orchestrator wiring) — pending
- #2776 ✅ merged (artifact storage /
- Backend follow-up (separate, not part of this issue): persist
thread_idintoArtifactMeta+ addthread_idfilter param onopenhuman.ai_list_artifactsso artifacts from old sessions (pre-persistence) become listable.
Interested in picking this up. Holding off on opening a PR until #3017 merges — the substrate this layers on (the ArtifactCard, the artifactsByThread slice, artifactDownloadService, and the openhuman.ai_delete_artifact RPC) all live in that PR's branch rather than main today, so any work here would be unmergeable until then. Will start once #3017 lands. If anyone else wants to grab this in the meantime, no objection.
@hemanth1999k thanks for flagging — this is already in flight as #3026, stacked on #3017 for exactly the reasons you called out (artifactsByThread slice, ArtifactCard, artifactDownloadService, openhuman.ai_delete_artifact RPC all live in #3017's branch, not on main). Your dependency analysis matches mine; PR will rebase onto main once #3017 lands.
If you're looking for adjacent #1535 work, a few unclaimed follow-ups surfaced during implementation:
ArtifactMeta.thread_idfield +ai_list_artifactsthread filter param — flagged in #3026's PR body. Today the persisted Redux slice covers per-thread cold-load on app restart; this would close the gap for true cold-load-from-RPC (e.g. iOS client, cross-device sync).- Image embedding in slides via
ppt-rs::add_image— pairs a Composio file fetch / artifact marker with a slide image placeholder. Useful for 'deck with chart screenshots' requests. - Per-slide source attribution (
SlideSpec.sources: Vec<String>rendered as a 'Sources:' footer in speaker notes) — pairs with the grounding rule in #2780 / #3029.
Happy to open any of those as separate issues if you want to pick one up. Closing #3024 in favor of #3026.
Thanks @oxoxDev — appreciate the unblock + the clean writeup on #3026.
I'd like to pick up #1 (ArtifactMeta.thread_id field + ai_list_artifacts thread filter param). The scope is well-bounded — types.rs field add, store.rs plumbing through the write path, ops.rs filter param, and a JSON-RPC E2E case — and it closes the cold-load-from-RPC gap your slice persistence intentionally left open, which is the part that becomes relevant for the iOS client transport (LanHttpTransport / TunnelTransport).
Couple of pre-flight questions before I file an issue + branch:
- Migration story for existing rows. Existing
ArtifactMetarecords on disk won't havethread_id. Plan wasOption<String>on the type + a defaultNonefrom any old row;ai_list_artifacts's newthread_idfilter would simply not match them. Acceptable, or do you want a one-shot backfill? - Scope of writer-side capture. Today the only place a
thread_idis set on the spawning side is theAPPROVAL_CHAT_CONTEXTtask-local that #3017 uses for artifact events. I was going to read the same task-local insidecreate_artifactso CLI / cron / sub-agent callers leavethread_id = Nonefor free. Match #3017's contract or do you want it explicit-arg? - Filing. Happy to either file it myself as a fresh issue (
feat(artifacts): persist thread_id on ArtifactMeta + add thread_id filter to ai_list_artifacts) referencing #3026's body, or open the PR directly withcloses #3026 (follow-up)if you'd rather skip the issue. Whichever fits your workflow.
Will hold off on writing code until you confirm. (No rush — #3017 + #3026 going in first makes sense.)