Skip to content

fix(site/src/pages/AgentsPage): prevent file drop navigation when the composer cannot attach - #30642

Closed
DanielleMaywood wants to merge 1 commit into
refactor/agents-remove-chat-inputfrom
fix/agents-readonly-drop
Closed

DanielleMaywood wants to merge 1 commit into
refactor/agents-remove-chat-inputfrom
fix/agents-readonly-drop

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Collaborator

Follow-up in the #30545 composer refactor stack. Depends on #30639.

Frame attached its drag handlers only when canAttachFiles was true. Dropping a file on a composer that could not attach (for example, the create form while organization authorization is pending) left the browser default in place, so the browser navigated away to open the file.

The handlers now stay attached. File drags always call preventDefault. The drag highlight and attachFiles still require canAttachFiles.

Key decisions
  • Ported from the refactor(site): prototype compound agent composer #30545 reference Frame: dragover and drop call preventDefault only for file drags, so non-file drags reach the editor.
  • Regression coverage is the existing AgentCreateForm DelayedOrganizationAuthorization play assertion, which now expects the pending drop to be prevented (dispatchEvent returns false) without attaching. It fails without the fix. No Vitest test was added because that story already covers the case.

Generated by Coder Agents on behalf of @DanielleMaywood.

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

CODAGT-1405

@DanielleMaywood

Copy link
Copy Markdown
Collaborator Author

Closing stack until can be re-prioritized

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