[Bug] File upload drop target does not accept dropped files reliably #31

Closed
opened 2026-07-14 20:08:42 +02:00 by zemion · 6 comments
Owner

Problem / User Need

The file upload drop target currently does not work reliably. Users expect to drag files into the upload area and have them accepted.

Acceptance Criteria

  • Dropping files onto the upload drop target triggers the same upload flow as selecting files manually.
  • Rejected drops show a clear reason.
  • The behavior is covered by a focused UI/component regression test where feasible.
## Problem / User Need The file upload drop target currently does not work reliably. Users expect to drag files into the upload area and have them accepted. ## Acceptance Criteria - Dropping files onto the upload drop target triggers the same upload flow as selecting files manually. - Rejected drops show a clear reason. - The behavior is covered by a focused UI/component regression test where feasible.
Author
Owner

Codex State: done

Summary

  • Fixed unreliable upload drops by passing the intended file target directly instead of relying on immediate dialog state updates.
  • Upload rejection paths now surface clear errors for missing permission, missing destination, connector targets, and non-file drops.

Changed Files

  • webui/src/features/files/FilesPage.tsx

Verification

  • GOVOPLAN_WEBUI_MODULE_PACKAGES=@govoplan/files-webui npm run build in govoplan-core/webui passed.

Next / Blocked

  • Close after the govoplan-files change is committed and pushed.
## Codex State: done ### Summary - Fixed unreliable upload drops by passing the intended file target directly instead of relying on immediate dialog state updates. - Upload rejection paths now surface clear errors for missing permission, missing destination, connector targets, and non-file drops. ### Changed Files - `webui/src/features/files/FilesPage.tsx` ### Verification - `GOVOPLAN_WEBUI_MODULE_PACKAGES=@govoplan/files-webui npm run build in govoplan-core/webui passed.` ### Next / Blocked - Close after the govoplan-files change is committed and pushed.
Author
Owner

Codex State: done

Summary

  • Follow-up fix: hardened the shared FileDropZone used by the upload dialog so filesystem drops are accepted on dragenter/dragover, propagation is stopped, and files are extracted from DataTransfer.files or DataTransfer.items.
  • Files upload dialog now displays an explicit error when a dialog drop is rejected instead of silently ignoring it.
  • The main file pane also now consumes file drops to avoid the browser opening the dropped file.

Changed Files

  • /mnt/DATA/git/govoplan-core/webui/src/components/FileDropZone.tsx
  • webui/src/features/files/FilesPage.tsx

Verification

  • GOVOPLAN_WEBUI_MODULE_PACKAGES=@govoplan/files-webui npm run build in govoplan-core/webui passed.

Next / Blocked

  • Please hard refresh the running dev page; if the dialog still ignores drops, check the browser console/network panel while dropping because the event path should now either upload or show an error.
## Codex State: done ### Summary - Follow-up fix: hardened the shared FileDropZone used by the upload dialog so filesystem drops are accepted on dragenter/dragover, propagation is stopped, and files are extracted from DataTransfer.files or DataTransfer.items. - Files upload dialog now displays an explicit error when a dialog drop is rejected instead of silently ignoring it. - The main file pane also now consumes file drops to avoid the browser opening the dropped file. ### Changed Files - `/mnt/DATA/git/govoplan-core/webui/src/components/FileDropZone.tsx` - `webui/src/features/files/FilesPage.tsx` ### Verification - `GOVOPLAN_WEBUI_MODULE_PACKAGES=@govoplan/files-webui npm run build in govoplan-core/webui passed.` ### Next / Blocked - Please hard refresh the running dev page; if the dialog still ignores drops, check the browser console/network panel while dropping because the event path should now either upload or show an error.
Author
Owner

Codex State: progress

Summary

  • Extended the upload-dialog drop zone to extract files not only from DataTransfer.files, but also from DataTransferItem.getAsFile(), Chromium file-system handles, and legacy webkit entries.
  • If the browser still exposes only an unreadable URI/path, the warning now says that explicitly instead of asking for a file again.

Changed Files

  • /mnt/DATA/git/govoplan-core/webui/src/components/FileDropZone.tsx
  • webui/src/features/files/FilesPage.tsx

Verification

  • GOVOPLAN_WEBUI_MODULE_PACKAGES=@govoplan/files-webui npm run build in govoplan-core/webui passed.

Next / Blocked

  • Retest after hard refresh. If the red unreadable-file warning remains, the drag source/browser is not exposing file contents to web apps; selecting via the file picker should still work and the remaining work is source/browser-specific diagnostics.

Suggested status label: status/in-progress

## Codex State: progress ### Summary - Extended the upload-dialog drop zone to extract files not only from DataTransfer.files, but also from DataTransferItem.getAsFile(), Chromium file-system handles, and legacy webkit entries. - If the browser still exposes only an unreadable URI/path, the warning now says that explicitly instead of asking for a file again. ### Changed Files - `/mnt/DATA/git/govoplan-core/webui/src/components/FileDropZone.tsx` - `webui/src/features/files/FilesPage.tsx` ### Verification - `GOVOPLAN_WEBUI_MODULE_PACKAGES=@govoplan/files-webui npm run build in govoplan-core/webui passed.` ### Next / Blocked - Retest after hard refresh. If the red unreadable-file warning remains, the drag source/browser is not exposing file contents to web apps; selecting via the file picker should still work and the remaining work is source/browser-specific diagnostics. Suggested status label: `status/in-progress`
Author
Owner

Retest update, 2026-07-20: the Files-only/combined production WebUI build and affected diff checks pass. Static inspection confirms direct target handoff, DataTransfer.files/items/handle fallbacks, drag-event cancellation, and explicit rejection messages.

Closure is premature because the shared FileDropZone change in govoplan-core and the FilesPage change in govoplan-files are both still uncommitted, and this environment has no browser/DOM harness for a real drag/drop smoke test. Keeping this in progress until both changes are integrated and these browser checks pass:

  1. Dialog drop uploads exactly once into the selected folder.
  2. Current-pane/folder-target drop uses that exact target.
  3. Non-file or unreadable drops show a clear reason.
  4. Connector, missing-permission, and busy states reject with the correct reason.
  5. File-picker upload still follows the same path.
Retest update, 2026-07-20: the Files-only/combined production WebUI build and affected diff checks pass. Static inspection confirms direct target handoff, `DataTransfer.files`/items/handle fallbacks, drag-event cancellation, and explicit rejection messages. Closure is premature because the shared `FileDropZone` change in `govoplan-core` and the `FilesPage` change in `govoplan-files` are both still uncommitted, and this environment has no browser/DOM harness for a real drag/drop smoke test. Keeping this in progress until both changes are integrated and these browser checks pass: 1. Dialog drop uploads exactly once into the selected folder. 2. Current-pane/folder-target drop uses that exact target. 3. Non-file or unreadable drops show a clear reason. 4. Connector, missing-permission, and busy states reject with the correct reason. 5. File-picker upload still follows the same path.
Author
Owner

Added strong local regression evidence without external test dependencies:

  • pure resolver tests cover DataTransfer.files, getAsFile(), File System Access file/nested-directory handles, legacy WebKit file entries, empty/unreadable paths, and precedence/no duplicate resolution
  • structural checks cover drag-event cancellation, rejection routing, and explicit selected-target forwarding in FilesPage

npm run test:file-drop-zone, npm run test:file-drop-target, Core structural i18n audit, Files-only production build (1,904 modules), and both diff checks pass.

Keeping the issue open: these source-level tests cannot prove real browser/OS DataTransfer interoperability. One browser smoke must still verify exactly-once dialog upload, current/folder target selection, clear rejection states, and file-picker parity after the local Core and Files changes are integrated.

<!-- codex-progress-file-drop-regression-2026-07-20 --> Added strong local regression evidence without external test dependencies: - pure resolver tests cover `DataTransfer.files`, `getAsFile()`, File System Access file/nested-directory handles, legacy WebKit file entries, empty/unreadable paths, and precedence/no duplicate resolution - structural checks cover drag-event cancellation, rejection routing, and explicit selected-target forwarding in `FilesPage` `npm run test:file-drop-zone`, `npm run test:file-drop-target`, Core structural i18n audit, Files-only production build (1,904 modules), and both diff checks pass. Keeping the issue open: these source-level tests cannot prove real browser/OS `DataTransfer` interoperability. One browser smoke must still verify exactly-once dialog upload, current/folder target selection, clear rejection states, and file-picker parity after the local Core and Files changes are integrated.
Author
Owner

Codex State: done

Summary

  • The file-list surface and upload dialog now route dropped local files through the same explicit-target upload path as the file picker.
  • Rejected drops report permission, destination, connector-space, busy-state, or unreadable-browser-payload reasons instead of failing silently.
  • The reported Zen Browser environment also rejects displaying local files, so that remaining behavior points to browser/local-file exposure rather than the GovOPlaN drop target.

Changed Files

  • webui/src/features/files/FilesPage.tsx
  • webui/scripts/test-file-drop-target-structure.mjs
  • ../govoplan-core/webui/src/components/FileDropZone.tsx
  • ../govoplan-core/webui/src/components/resolveDroppedFiles.ts

Verification

  • govoplan-files/webui: npm run test:file-drop-target (pass)
  • govoplan-core/webui: npm run test:file-drop-zone (pass)
  • govoplan-core/webui: npm run build (pass)

Next / Blocked

  • Reopen with browser/version and console evidence if a browser that exposes local File objects still fails.
## Codex State: done ### Summary - The file-list surface and upload dialog now route dropped local files through the same explicit-target upload path as the file picker. - Rejected drops report permission, destination, connector-space, busy-state, or unreadable-browser-payload reasons instead of failing silently. - The reported Zen Browser environment also rejects displaying local files, so that remaining behavior points to browser/local-file exposure rather than the GovOPlaN drop target. ### Changed Files - `webui/src/features/files/FilesPage.tsx` - `webui/scripts/test-file-drop-target-structure.mjs` - `../govoplan-core/webui/src/components/FileDropZone.tsx` - `../govoplan-core/webui/src/components/resolveDroppedFiles.ts` ### Verification - `govoplan-files/webui: npm run test:file-drop-target (pass)` - `govoplan-core/webui: npm run test:file-drop-zone (pass)` - `govoplan-core/webui: npm run build (pass)` ### Next / Blocked - Reopen with browser/version and console evidence if a browser that exposes local File objects still fails.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-files#31
No description provided.