[LAY-2690] Make statement upload a drag-and-drop zone - #1794
Draft
augmentcode[bot] wants to merge 2 commits into
Draft
[LAY-2690] Make statement upload a drag-and-drop zone#1794augmentcode[bot] wants to merge 2 commits into
augmentcode[bot] wants to merge 2 commits into
Conversation
Shrink the task description textarea to one line for upload tasks and replace the "Select files" button with a dropzone that also opens the file picker. The dropzone mirrors the CsvUpload pattern and keeps multi-file selection. Co-authored-by: Augment <noreply@augmentcode.com>
Contributor
|
Storybook preview — add the It renders stories against a live sandbox business instead of MSW fixtures, and rebuilds on every push while the |
Contributor
Author
|
FE Review Healer🩹 on behalf of sarah@layerfi.com Live preview🎨 View Storybook preview — Chromatic build 598 Updated: 2026-09-02T19:08Z Stories included
Session: https://cosmos.augmentcode.com/session?agentId=01M1HNT2854GPJPPAA59SEMX6Z |
Contributor
Author
|
FE Review Healer🩹 on behalf of sarah@layerfi.com 👀 watching this PR — I'll respond to comments, reviews, and pushes automatically. Remove the |
The description box kept the textarea's default two rows, so the min-block size override never took effect. The dropzone sentence inherited a stray 16px bottom margin from the tasks list, which pushed the icon below the text and the whole group above the box centre, and the Browse button kept the button font size instead of the surrounding 12px. Co-authored-by: Augment <noreply@augmentcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Frontend Expert🎨 on behalf of darren@layerfi.com
🎨 View Storybook preview — Chromatic build 597
Description
Jeffrey asked for two changes to the statement upload inside bookkeeping tasks (Slack thread):
The dropzone follows the existing
CsvUploadpattern:useDropzonewithnoClick, a hidden input on the drop container, and a Browse button that opens the picker. Multi-file selection stays available, so you can drop or pick several statements at once.Changes
src/components/features/bookkeeping/TasksListItem/TasksListItem.tsxFileInputbutton in the "no files selected" state with a drop container built fromuseDropzone.data-drag-activeattribute.data-upload-documentso only upload tasks get the single-line description box.task.userResponseType === TaskUserResponseType.UploadDocumentcheck intoisUploadDocumentTask.src/components/features/bookkeeping/TasksListItem/tasksListItem.scss(new)TextAreato1lhfor upload tasks only. The sharedTextAreadefault is unchanged.CsvUploaduses.src/components/features/bookkeeping/TasksListItem/TasksListItem.scratch.stories.tsx(new, scratch)New string:
upload:label.drag_drop_files_browse— "Drag and drop files, or<browse>Browse</browse>." It sits in the shareduploadnamespace beside the existing single-file variant. The locale JSON is untouched; extraction collects the key.bookkeeping:TasksListItem.action.select_filesno longer has a call site. Extraction removes it.Blockers
None.
How this has been tested?
Stories in the Chromatic build:
Measured in a headless browser against the built Storybook:
1px dashed rgb(224, 224, 225), "Drag and drop files, or Browse."Dropping two files on the zone sets
data-drag-activeon drag enter, replaces the zone with the selected-files list (statement-1.pdf,statement-2.pdf), and shows the Cancel and Submit actions.Commands:
npm run typecheck— passes.npm run lint— passes.npm test -- --run— 47 files, 345 tests, all pass.npm run i18n:check— ok (1368 keys).npm run storybook:build— passes.npm run stories:check-render— all 122 stories render, including both new play functions.The repo defines no
test-storybookscript, so interaction tests run throughstories:check-renderinstead.The scratch story file is listed above. The cleanup GitHub Action removes it on approval.
Follow-up fixes (commit
7d7ecc6)Frontend Expert🎨 on behalf of darren@layerfi.com
Jeffrey reviewed the first Chromatic build and reported two problems. Both are fixed.
1lhoverride set onlymin-block-size, so the textarea kept its defaultrows="2"height of 57 px. The override now setsblock-size: 1lhas well, which gives 38 px: one 19.6 px line, 8 px of padding above and below, and 1 px of border on each edge. The text is centred because the content box holds exactly one line..Layer__UI__Buttonsetsfont-size: var(--text-md)(14 px), andvariant='text'does not inherit the surrounding size, so Browse rendered at 14 px inside a 12 px sentence. A scoped rule now setsfont-size: inheriton buttons inside the dropzone.tasksList.scssappliedmargin-bottom: var(--spacing-md)to every.Layer__Punder.Layer__tasks-list-item__body-info, which also reached the dropzone sentence. That 16 px margin grew the icon-and-text row to 33 px, soalign-items: centerdropped the icon 9 px below the text and pushed the group 4 px above the box centre. The rule now uses the child combinator> .Layer__P, so it applies only to the question paragraph it was written for.Files changed in the follow-up
src/components/features/bookkeeping/TasksListItem/tasksListItem.scsssrc/components/features/bookkeeping/TasksList/tasksList.scssMeasurements, before and after
Headless Chromium at 1200 px wide, measured against the built Storybook.
The icon and the text row share the same centre line, and the equal 17 px gaps show the group is centred in the box.
Verification
npm run typecheck— passes.npm run lint— passes.npm test -- --run— 47 files, 345 tests, all pass.npm run i18n:check— ok (1368 keys).npm run storybook:build— passes.npm run stories:check-render— all 122 stories render.Pull Request opened by Augment Code | View session