Skip to content

Fix: restore Add photos & files in Pocodex - #20

Open
xIGBClutchIx wants to merge 1 commit into
davej:mainfrom
xIGBClutchIx:fix/browser-file-picker-attachments
Open

Fix: restore Add photos & files in Pocodex#20
xIGBClutchIx wants to merge 1 commit into
davej:mainfrom
xIGBClutchIx:fix/browser-file-picker-attachments

Conversation

@xIGBClutchIx

Copy link
Copy Markdown
Contributor

Summary

This restores Add photos & files in Pocodex so browser sessions open a working file chooser again and attach the selected files instead of failing with Unable to open file picker.

What changed

  • add a browser-side attachment picker helper in the bootstrap script that returns the selected files in the shape the current Codex bundle expects
  • patch extracted and cached webview attachment assets so non-file: browser sessions use that helper instead of the native pick-files route
  • reuse in-memory image bytes for browser-picked image attachments so the bundle does not fall back to read-file-binary on files that only exist in the browser chooser
  • add focused regression coverage for both freshly extracted and already cached webview bundles

Root cause

  • Pocodex only handled the older hidden-input attachment path, but the current desktop bundle moved Add photos & files into a bundled pick-files flow
  • in browser-served Pocodex, that native pick-files route is unsupported, so the composer surfaced Unable to open file picker
  • image attachments also needed a browser-safe byte path because the bundle otherwise tried to read chooser-only files through the native binary file bridge

Impact

  • Add photos & files opens a real browser file chooser again in Pocodex
  • regular files and images attach to the composer without the picker error
  • regression coverage now protects the extracted and cached webview patch paths this fix depends on

Validation

  • pnpm run check:commit
  • pnpm exec vitest run test/codex-bundle.test.ts
  • pnpm exec tsx src/cli.ts --dev --listen 127.0.0.1:8799
  • live local verification on http://127.0.0.1:8799/ that Add photos & files attaches README.md and artifacts/icon.png as composer chips without showing Unable to open file picker

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