feat(ui): add prompt attachment picker#417
Conversation
Add a visible paperclip action to the prompt so users can choose local files instead of relying only on paste or drag and drop. The picker reuses the existing attachment pipeline, including image and text previews, while reading browser-selected files as data URLs when no native file path is available. All user-visible labels are localized across the existing message catalogs. Validated with UI typecheck, UI build, and git diff whitespace checks.
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Gatekeeper review for latest PR state. Request understood: review this PR ruthlessly for regressions and implementation quality. Assumption: no code changes were requested, only a gatekeeper review. Findings:
Implementation notes:
Validation:
File size note:
Gatekeeper verdict: request changes before merge. The feature intent is good, but the picker should not ship until file selections reliably preserve real filesystem paths or have a bounded, explicit upload/data fallback. -- |
Reuse the existing desktop file path resolver so picker-selected files stay path-backed whenever the runtime exposes a native filesystem path. Only fall back to data URLs for bounded image and text previews, skip non-previewable files without a native path instead of reading arbitrary binaries into renderer memory, and keep path-backed attachments when preview reads fail. Also enforce the disabled composer state at the hidden file input and selection handler to prevent attachments being queued after the prompt becomes disabled. Validation: git diff --check; npm run typecheck --workspace @codenomad/ui; npm run build --workspace @codenomad/ui
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Updated gatekeeper review for latest PR state ( Request understood: re-run the ruthless PR gatekeeper review against the updated branch. Assumption: this is review-only; no code changes requested. Findings:
What improved since the previous review:
Validation:
File size note:
Gatekeeper verdict: request changes before merge. The update fixes the most dangerous memory/path issues, but the attach action still has an unacceptable silent-failure path for legitimate user-selected files and should use a cleaner native path resolution boundary. -- |
Route the prompt attachment button through the platform-native multi-file dialog when available so selected files are attached by filesystem path instead of relying on HTML File metadata that may omit paths or MIME types. Keep the HTML file input as a fallback for supported inline previews, surface a localized warning when fallback files cannot be attached, and keep disabled drag-over events from falling through to browser default file handling. Move file path resolution into a small native helper shared by prompt attachments and desktop folder drops, avoiding a dependency from the prompt composer to the folder-drop listener module. Validated with git diff --check, npm run typecheck --workspace @codenomad/ui, and npm run build --workspace @codenomad/ui.
|
@CodeNomadBot |
|
Updated gatekeeper review for latest PR state ( Request understood: run the same ruthless gatekeeper review again against the current branch. Assumption: review-only; no code changes requested. Findings:
What improved since the previous review:
Validation:
File size note:
Gatekeeper verdict: request changes before merge. The implementation is much closer, but Electron still does not implement the promised native multi-file selection, so the main feature is incomplete on one desktop runtime. -- |
Honor multi-file selection in Electron's native dialog bridge so the prompt attachment button behaves consistently with Tauri. Infer MIME types for path-based native attachments from common image and text extensions, preserving previews when file contents are not read in the renderer. Validated with UI and Electron typechecks plus the UI production build before committing.
|
Addressed in 49c6161. Electron now passes \multiSelections\ when the native prompt attachment picker requests multiple files, and path-based native attachments infer common image/text MIME types by extension so previews remain available without reading file contents in the renderer. |
|
@CodeNomadBot |
|
Updated gatekeeper review for latest PR state ( Request understood: run the same ruthless gatekeeper review again after the author noted fixes in Findings:
What improved since the previous review:
Validation:
File size note:
Gatekeeper verdict: no blocking findings in the latest state. The previous blockers appear addressed. I would still prefer better native dialog result diagnostics, but that is not enough to hold this PR. -- |
Actually, we don't need to do it as part of this PR. That should be a separate work that is now needed. |
|
Before I do, has this been tested on all - Electron, Tauri and web interfaces? |
|
nope only on tauri, ok will try with the other. |
|
@pascalandr - The attachment is handled a bit differently in CodeNomad / opencode. The current PR uses a standard local attachment behavior but we need to support
I have created another PR on top of this with the changes. #432 |
|
Superseded by #432 |
|
Thanks for working on this @pascalandr |
## Summary - Reuses the directory browser for web file attachment selection and removes the separate filesystem browser dialog. - Reads web-selected files through the filesystem browser API so selection respects unrestricted and configured workspace roots. - Keeps Electron/Tauri picker selection on the FileList ingestion path so picked files behave like dropped files with byte-backed attachments. ## Validation - npm run typecheck --workspace @codenomad/ui - npm run typecheck --workspace @neuralnomads/codenomad - npm run typecheck --workspace @neuralnomads/codenomad-electron-app - cargo check - git diff --check ## Notes - Follow-up to #417; this branch currently includes the commits from that PR plus the attachment picker parity fix. --------- Co-authored-by: Pascal André <pascalandr@gmail.com>


Summary
Closes #380
Validation