refactor(panel): one + for every box that takes files, at a comment field's left
This follows up on #4281. You noted that the + in a plan comment's field sat on the right, beside Send, and was styled differently from the agent composer's. You also asked to reuse components where possible.
Changes
-
New shared component:
AttachFilesButtoninpackages/panel/src/tasks/attach-files-button.tsx. It draws the + with its tooltip and the hidden file picker that clears itself after each pick. It takes an optional label, anacceptfilter, and an optional ref to the picker input, for a box whose ⋯ menu also opens the picker. -
All four boxes that take files now use it:
- the agent composer (it passes its picker ref, so the ⋯ menu's "Attach files" still opens the picker);
- the Inbox's answer box;
- a channel's chat box (images only, labelled "Attach images");
- a plan comment's field.
This removes three copies of the same button-plus-input markup.
-
The comment field's + now sits at the left of its foot, as the other boxes' do, at the same size and style. Previously it was compact and grouped with Dictate and Send on the right.
Nothing changes in how any box behaves.
Tests
These suites pass unchanged:
- plan comments
- workspace chat
- Inbox
- agent composer's ⋯ menu
- New task dialog
- composer
Made with Luke