Skip to content

feat(flow-chat): support external file context input - #2756

Merged
wgqqqqq merged 4 commits into
GCWing:1.0.0-explorefrom
wgqqqqq:wgq/external-file-composer-input
Sep 3, 2026
Merged

feat(flow-chat): support external file context input#2756
wgqqqqq merged 4 commits into
GCWing:1.0.0-explorefrom
wgqqqqq:wgq/external-file-composer-input

Conversation

@wgqqqqq

@wgqqqqq wgqqqqq commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add one ordered, path-aware intake for external files, directories, and images in the Desktop chat composer.
  • Accept multi-item native drag/drop and OS file clipboard paste while preserving internal context drag/drop, bitmap image paste, normal text paste, and large-text capsules.
  • Normalize and deduplicate POSIX/Windows paths, classify entries through workspace metadata, keep successful items when part of a batch is invalid, and respect the existing image count limit.
  • Fix WebKit's equivalent non-collapsed caret range so the first Backspace removes the adjacent file chip atomically instead of only moving the visible caret.
  • Reject controller-local paths for Remote Workspace, Peer Device Mode, Detached Dispatch, and server/web sessions instead of forwarding or silently copying them.

Fixes #1276

Related reports consolidated into this request: #2352 and #2312.

Type and Areas

Type: Feature / regression fix / test / docs

Areas: Desktop/Tauri, Web UI flow chat, interactive capability catalog, E2E

Motivation / Impact

The composer previously understood only BitFun-internal drag payloads, and the main Tauri window disabled native drag/drop handling, so files dragged from Finder/Explorer never reached chat as real paths. Clipboard handling also treated only the first image file specially and otherwise fell back to text.

Desktop users running a local workspace or local managed worktree can now reference repository-external files and directories directly from the composer. No public submission API or generic binary attachment protocol is introduced; non-image files remain existing path contexts.

Verification

  • pnpm --dir src/web-ui run test:run src/flow_chat/components/RichTextInput.test.tsx src/flow_chat/utils/externalFileIntake.test.ts src/infrastructure/files/useLocalFileDrop.test.ts — passed, 42/42 tests.
  • BITFUN_E2E_APP_MODE=debug pnpm --dir tests/e2e exec wdio run ./config/wdio.conf.ts --spec "./specs/l1-external-file-input.spec.ts" — passed.
  • pnpm run check:web — passed.
  • pnpm run i18n:audit — passed.
  • pnpm run capabilities:generate && pnpm run capabilities:check && pnpm run capabilities:test — passed, 15/15 capability tests.
  • pnpm run fmt:rs — passed.
  • cargo check -p bitfun-desktop — passed after preparing required generated Desktop resources and configuring the cached sherpa-onnx archive.
  • cargo test -p bitfun-desktop clipboard_file_api — passed, 11/11 matching tests.
  • macOS Desktop manual check — passed for Finder drag/drop of mixed external items, duplicate handling, and first-Backspace deletion across three file chips.

Reviewer Notes

  • Remote behavior is intentionally gated at intake: Remote Workspace, Peer Device Mode, Detached Dispatch, and server/web do not receive controller-local absolute paths.
  • Windows and Linux behavior is covered by path/adapter tests but has not been manually exercised on those platforms.
  • Development was AI-assisted. The automated suite and available macOS Desktop path were fully tested.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Generated with BitFun

Co-authored-by: BitFun <318544290+bitfun-ai@users.noreply.github.com>
@wgqqqqq
wgqqqqq marked this pull request as ready for review September 3, 2026 02:54
@wgqqqqq
wgqqqqq merged commit 09c0ab8 into GCWing:1.0.0-explore Sep 3, 2026
12 checks passed
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