Skip to content

feat: add worker to upload CSV file - #3117

Merged
lariciamota merged 120 commits into
vtex:feat/quick-order-by-file-feature-branchfrom
cubos-vtex:feat/BE-71
Feb 25, 2026
Merged

lariciamota merged 120 commits into
vtex:feat/quick-order-by-file-feature-branchfrom
cubos-vtex:feat/BE-71

Conversation

@icaroov

@icaroov icaroov commented Nov 12, 2025 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

This pull request introduces a new file upload and CSV parsing feature to the components package, including reusable hooks and UI components. The main changes are the addition of a FileUploadCard component for uploading files, a useCSVParser hook for parsing CSV files in a web worker, and a useFileUpload hook for managing file upload errors and validation. These new utilities are exported for use in other parts of the application.

This PR it was created from #3109

How it works?

New hooks and utilities:

  • Added useCSVParser hook for parsing CSV files in a web worker, with error handling and CSV template generation.
  • Added useFileUpload hook to manage file upload errors, validation, and rejection reasons.
  • Exported new hooks from the hooks index for easier consumption.
  • Added type exports for CSV parsing to the main index file.

New UI components:

  • Added FileUploadCard component for file selection, drag-and-drop, and template download, with error state and file validation.
  • Added exports for FileUploadCard and FileUploadStatus components and their types.

Dependency updates:

  • Added papaparse to dependencies for running CSV parsing in a web worker.

How to test it?

Nov-12-2025 14-49-47

Starters Deploy Preview

References

Checklist

You may erase this after checking them all 😉

PR Title and Commit Messages

  • PR title and commit messages follow the Conventional Commits specification
    • Available prefixes: feat, fix, chore, docs, style, refactor, ci and test

PR Description

  • Added a label according to the PR goal - breaking change, bug, contributing, performance, documentation..

Dependencies

  • Committed the pnpm-lock.yaml file when there were changes to the packages

Documentation

  • PR description
  • For documentation changes, ping @Mariana-Caetano to review and update (Or submit a doc request)

Summary by CodeRabbit

  • New Features

    • CSV parsing with worker-backed parsing, template generation, Dropzone upload UI and an Upload File dropdown; file-based search integration.
  • Enhancements

    • New file upload hooks, FileUploadCard and FileUploadStatus props for richer status, customizable labels, and improved file name/size formatting.
    • Template download and clearer upload error handling.
  • Refactor

    • Tightened public type signatures and expanded component/hook exports.
  • Style

    • Added Dropzone and upload-related styles and Storybook stories.

@icaroov icaroov self-assigned this Nov 12, 2025
@icaroov
icaroov requested a review from a team as a code owner November 12, 2025 17:53
@icaroov
icaroov requested review from BrunaCubos, emersonlaurentino and hellofanny and removed request for a team November 12, 2025 17:53
@icaroov
icaroov changed the base branch from main to feat/quick-order-by-file-feature-branch November 21, 2025 15:01
@giurigaud

Copy link
Copy Markdown
Contributor

The changelog needs to be added.

@codesandbox-ci

codesandbox-ci Bot commented Dec 3, 2025 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@ArthurTriis1

Copy link
Copy Markdown
Collaborator

Adiciona por favor na descrição do PR o arquivo .csv que estão usando no desenvolvimento

"react-dom": "^18.2.0"
},
"dependencies": {
"papaparse": "^5.5.3",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precisamos checar com o time da faststore a opinião sobre a adição desse pacote, consegue explicar um pouco a necessidade dele?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foi utilizado visando desempenho e simplicidade para processar arquivos CSV grandes. Foi indicado o uso na RFC. Ele lê o CSV em partes (streaming), não trava a tela, já usa Web Worker, detecta separador, trata aspas, dá progresso, permite cancelar e manipula arquivos grandes sem prejudicar a memória.

Comment on lines +13 to +15
'application/vnd.ms-excel': ['.xls'],
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': [
'.xlsx',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acredito que na RFC foi proposto o upload apenas de formato csv, surgiu a necessidade de xls e xlsx tb?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ajustado, aceitando apenas CSV

@ArthurTriis1 ArthurTriis1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A funcionalidade parece estar funcionando bem, mas reforço que precisamos da avaliação do time da faststore sobre a adição da lib papaparse e averiguar se devemos de fato permitir o upload de xls e xlsx.

@BrunaCubos

Copy link
Copy Markdown
Collaborator

A funcionalidade parece estar funcionando bem, mas reforço que precisamos da avaliação do time da faststore sobre a adição da lib papaparse e averiguar se devemos de fato permitir o upload de xls e xlsx.

A adição da lib do papaparse foi indicado para uso na RFC.

@BrunaCubos

Copy link
Copy Markdown
Collaborator

Para desenvolver utilizamos o arquvio fornecido pela propria RFC
FastStore Starter Template.csv

@lariciamota

Copy link
Copy Markdown
Contributor

Oie, pessoal!
Notei que nesse PR tem alguns arquivos do #3109, acredito que esteja faltando rebase e mudar a branch de destino para não ficar misturando. Como o PR anterior também está em revisão e esses arquivos têm mudanças pedidas lá, seria bom ficar com as mudanças separadas para facilitar review e não ter comentários repetidos. Obrigada!

giurigaud and others added 2 commits January 29, 2026 14:20
## What's the purpose of this pull request?

This PR refers to the creation of the Quick Order Drawer, a new
component developed for the Quick Order By File functionality.

The main advantage of the Quick Order functionality is the ability to
add products directly to the cart from the search, which significantly
reduces the number of clicks and browsing time.

<!--- Considering the context, what is the problem we'll solve? Where in
VTEX's big picture our issue fits in? Write a tweet about the context
and the problem itself. --->

## How it works?

<!--- Tell us the role of the new feature, or component, in its context.
Provide details about what you have implemented and screenshots if
applicable. --->
Creating the Quick Order Drawer layout according to Figma.

<img width="1912" height="966" alt="image (3)"
src="https://github.com/user-attachments/assets/65a66428-8db2-45f4-86f5-c28f4236a2e4"
/>

## How to test it?

<!--- Describe the steps with bullet points. Is there any external link
that can be used to better test it or an example? --->

	•	The user uploads the file in the Quick Order interface.
	•	After the upload is completed, the Search button becomes enabled.
	•	The user clicks the Search button to start processing.
	•	The system begins processing the file data.
	•	The Dropdown enters a loading state.
• Even while loading, the Dropdown can be closed without interrupting
the processing.
• Once processing is finished, the system automatically opens the Quick
Order Drawer.


### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References


[Figma](https://www.figma.com/design/0c3DOaXs6rS25LyDWi7uap/Cubos-%C2%B7-FastStore-Features-(H2-2024)?node-id=1-23&node-type=canvas&t=EiFoKx4kFwgKhNEP-0)

<!--- Spread the knowledge: is there any content you used to create this
PR that is worth sharing? --->

<!--- Extra tip: adding references to related issues or mentioning
people important to this PR may be good for the documentation and
reviewing process --->

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [x] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [x] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added Quick Order Drawer component enabling streamlined product
ordering with header, product selection table, quantity adjustments, and
checkout from a side panel.

* **Documentation**
* Added Storybook examples demonstrating Quick Order Drawer with
multiple configuration scenarios.

* **Chores**
* Updated TypeScript React type definitions to latest compatible
versions.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: renato <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
Tasks
[https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69)
[BE-70](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-70)

Here's the completed PR description in English:

- Introduced `FileUploadCard` for file selection and upload
functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error
handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that
triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.

## What's the purpose of this pull request?

This PR introduces a new file upload feature that allows users to
perform bulk searches by uploading CSV files. The feature provides a
modern, user-friendly interface with drag-and-drop support, real-time
upload status tracking, and comprehensive error handling to guide users
through the file upload process.

## How it works?

### FileUploadCard Component
- **File Selection**: Users can either click "Select file" button or
drag-and-drop files into the dropzone
- **Drag & Drop**: Visual feedback with border color and background
changes when dragging files
- **File Input**: Hidden file input that's always present in the DOM to
ensure file picker works in all states
- **Download Template**: Provides a CSV template download option for
users who need guidance on file format
- **Validation**: Only accepts CSV files (`.csv` extension)
- **States**: Manages upload states (uploading, completed, error) with
appropriate UI updates

### FileUploadStatus Component
Displays the current status of the uploaded file with three distinct
states:

1. **Uploading State**
   - Shows spinning CircleNotch icon
   - Displays "Uploading your file..." message
   - Shows filename

2. **Completed State**
   - Shows Table icon in green background
   - Displays filename and file size
   - Shows "Search" button to proceed with the uploaded file

3. **Error State**
   - Shows WarningOctagon icon in red background
- Special styling: light pink background (#FDF6F5) with red border
(#FFDFD9)
   - Displays error title and description in two lines
   - Shows two action buttons: "Download template" and "Select file"

### Error Types
The component handles six different error scenarios:
- **Unsupported**: Wrong file type (non-CSV files)
- **Unreadable**: File can't be parsed or is corrupted
- **Invalid Structure**: Missing headers or incorrect columns
- **Empty**: File has no data
- **Too Large**: File exceeds size limit
- **Unexpected**: Generic error for unknown issues

### Integration
- Added attachment icon button to `SearchInputField` component
- Clicking the attachment button toggles the `FileUploadCard` visibility
- Card appears as a dropdown below the search input
- Smooth animations for show/hide transitions

### Key Features
- **File validation**: Automatically checks file type on selection/drop
- **Error recovery**: Users can easily select a new file or download
template when errors occur
- **Responsive design**: Components adapt to container width
- **Accessibility**: Proper ARIA labels and keyboard navigation support
- **Visual feedback**: Icons, colors, and animations provide clear
status indication

## How to test it?

### Basic File Upload Flow
1. Navigate to a page with the search input
2. Click the attachment icon button (Paperclip icon)
3. The FileUploadCard should appear below the search input
4. Click "Select file" or drag-and-drop a CSV file
5. Observe the uploading state with spinning icon
6. After 2 seconds, see the completed state with "Search" button
7. Click the X button to remove the file and return to initial state

### Drag and Drop
1. Open the FileUploadCard
2. Drag a CSV file over the dropzone
3. Observe the visual feedback (border and background color change)
4. Drop the file to upload

### Error Handling - Unsupported File Type
1. Open the FileUploadCard
2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
3. Observe error state with red icon and pink background
4. Read error message: "Unsupported file type." / "Upload a CSV or use
the template provided."
5. Click "Download template" to get a sample CSV
6. Click "Select file" to try uploading again

### File Removal
1. Upload a file successfully
2. Click the X button in the top-right of the file status
3. Component should return to initial dropzone state


### Starters Deploy Preview

<!-- Add your deploy preview link here -->

## References

- [Phosphor Icons](https://phosphoricons.com/) - Icon library used for
UI elements
- [Conventional Commits](https://www.conventionalcommits.org/) - Commit
message format

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description


[BE-70]:
https://vtex-dev.atlassian.net/browse/BE-70?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* File upload card component enabling file selection via drag-and-drop
or file picker with status indicators
* File upload status component displaying upload progress, success, and
error states with customizable error handling
  * Attachment button in search input for quick file upload access

* **Chores**
  * Added component styling and Storybook demonstrations

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
@icaroov icaroov removed their assignment Feb 6, 2026
@coderabbitai

coderabbitai Bot commented Feb 9, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds CSV upload and parsing with a Dropzone UI: new hooks (useCSVParser, useFileUpload), Dropzone and Dropzone styles, UploadFileDropdown integrated into SearchInput, FileUploadCard/FileUploadStatus prop changes, utilities for file formatting, dependency additions, and updated exports. (50 words)

Changes

Cohort / File(s) Summary
Dependencies
packages/components/package.json, packages/ui/package.json, packages/storybook/package.json
Added react-dropzone, papaparse, @types/papaparse; switched some internal refs to workspace:*.
Hooks
packages/components/src/hooks/useCSVParser.ts, packages/components/src/hooks/useFileUpload.ts, packages/components/src/hooks/index.ts
Added useCSVParser (worker-based PapaParse, validation, template generation, progress) and useFileUpload (rejection/error mapping, defaults); re-exported them.
Dropzone component
packages/components/src/molecules/Dropzone/Dropzone.tsx, packages/components/src/molecules/Dropzone/index.ts, packages/ui/src/components/molecules/Dropzone/styles.scss
New Dropzone wrapping react-dropzone with accept/reject handlers, drag state, file lists, and SCSS; exports DropzoneProps/DropzoneState.
Upload UI (core)
packages/core/src/components/search/UploadFileDropdown/..., .../section.module.scss, .../index.ts
New UploadFileDropdown using useCSVParser + Dropzone, toasts, template download, parsed-results panel, labels/types and re-exports.
SearchInput integration
packages/core/src/components/search/SearchInput/SearchInput.tsx, packages/core/src/components/search/fileUploadCardDefaults.ts
Integrated CSV upload: onFileSearch prop, explicit fileUploadCardProps shape, uploadFileDropdownLabels, defaults, CSV parsing state and handlers.
File upload components
packages/components/src/molecules/FileUploadCard/FileUploadCard.tsx, packages/components/src/molecules/FileUploadStatus/FileUploadStatus.tsx
Adjusted prop surface: several label/error props made required; added formatterFileSize, formatterFileName, isUploading, hasError, optional fileName; updated internal usage and template content.
Polymorphic typing updates
packages/components/src/atoms/Link/Link.tsx, packages/components/src/atoms/List/List.tsx, packages/components/src/molecules/Accordion/AccordionItem.tsx
Tightened forwardRef typings to concrete elements (HTMLAnchorElement, HTMLUListElement, HTMLDivElement) and used Omit<..., 'ref'>, changing exported type signatures only.
Utilities & UI tweaks
packages/core/src/utils/utilities.ts, packages/core/src/components/sections/Navbar/Navbar.tsx, packages/core/src/components/search/SearchInputField/SearchInputField.tsx, packages/ui/src/components/.../SearchInputField/styles.scss
Added formatFileName and formatFileSize; applied default upload card props in Navbar; added SearchInputFieldProps and input styling adjustments.
Public exports, stories & changelogs
packages/components/src/index.ts, packages/components/CHANGELOG.md, packages/core/CHANGELOG.md, packages/storybook/stories/*, various SCSS files
Exported CSV types and Dropzone; added stories for Dropzone/UploadFileDropdown/FileUpload; updated changelogs and included Dropzone styles.

Sequence Diagram

sequenceDiagram
    autonumber
    actor User as "User"
    participant SI as "SearchInput"
    participant UFD as "UploadFileDropdown"
    participant DZ as "Dropzone"
    participant CSV as "useCSVParser"
    participant WW as "WebWorker (PapaParse)"
    participant FUS as "FileUploadStatus"

    User->>SI: open upload UI
    SI->>UFD: render dropdown
    User->>DZ: drop/select CSV file
    DZ->>UFD: onFilesAccepted(files)
    UFD->>CSV: onParseFile(file)
    CSV->>WW: parse (worker: true, chunked)
    WW-->>CSV: chunk results + progress
    CSV-->>UFD: resolve CSVData (rows, totals)
    UFD->>FUS: display results / status
    User->>FUS: click Search
    FUS->>SI: emit parsed CSVData
    SI->>SI: call onFileSearch(CSVData)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • lemagnetic
  • lariciamota

Poem

📂✨ A file drifts into Dropzone light,
PapaParse hums through worker night,
Rows align and errors fade away,
SearchInput sings the parsed array,
Bulk upload joy — CSV saved for day!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.83% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main feature addition: CSV file upload functionality using a web worker via PapaParse.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into feat/quick-order-by-file-feature-branch

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

brunass and others added 23 commits February 24, 2026 11:35
- Updated `useFileUpload` to use `FileRejection` type for better type safety.
- Introduced `UploadFileDropdown` component with improved CSV file handling using `useCSVParser` hook.
- Simplified error handling and template generation for CSV uploads.
- Added lazy loading for `UploadFileDropdown` in `SearchInput` component.
This PR refers to the creation of the Quick Order Drawer, a new
component developed for the Quick Order By File functionality.

The main advantage of the Quick Order functionality is the ability to
add products directly to the cart from the search, which significantly
reduces the number of clicks and browsing time.

<!--- Considering the context, what is the problem we'll solve? Where in
VTEX's big picture our issue fits in? Write a tweet about the context
and the problem itself. --->

<!--- Tell us the role of the new feature, or component, in its context.
Provide details about what you have implemented and screenshots if
applicable. --->
Creating the Quick Order Drawer layout according to Figma.

<img width="1912" height="966" alt="image (3)"
src="https://github.com/user-attachments/assets/65a66428-8db2-45f4-86f5-c28f4236a2e4"
/>

<!--- Describe the steps with bullet points. Is there any external link
that can be used to better test it or an example? --->

	•	The user uploads the file in the Quick Order interface.
	•	After the upload is completed, the Search button becomes enabled.
	•	The user clicks the Search button to start processing.
	•	The system begins processing the file data.
	•	The Dropdown enters a loading state.
• Even while loading, the Dropdown can be closed without interrupting
the processing.
• Once processing is finished, the system automatically opens the Quick
Order Drawer.

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

[Figma](https://www.figma.com/design/0c3DOaXs6rS25LyDWi7uap/Cubos-%C2%B7-FastStore-Features-(H2-2024)?node-id=1-23&node-type=canvas&t=EiFoKx4kFwgKhNEP-0)

<!--- Spread the knowledge: is there any content you used to create this
PR that is worth sharing? --->

<!--- Extra tip: adding references to related issues or mentioning
people important to this PR may be good for the documentation and
reviewing process --->

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [x] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [x] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* Added Quick Order Drawer component enabling streamlined product
ordering with header, product selection table, quantity adjustments, and
checkout from a side panel.

* **Documentation**
* Added Storybook examples demonstrating Quick Order Drawer with
multiple configuration scenarios.

* **Chores**
* Updated TypeScript React type definitions to latest compatible
versions.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: renato <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
Tasks
[https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69)
[BE-70](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-70)

Here's the completed PR description in English:

- Introduced `FileUploadCard` for file selection and upload
functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error
handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that
triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.

This PR introduces a new file upload feature that allows users to
perform bulk searches by uploading CSV files. The feature provides a
modern, user-friendly interface with drag-and-drop support, real-time
upload status tracking, and comprehensive error handling to guide users
through the file upload process.

- **File Selection**: Users can either click "Select file" button or
drag-and-drop files into the dropzone
- **Drag & Drop**: Visual feedback with border color and background
changes when dragging files
- **File Input**: Hidden file input that's always present in the DOM to
ensure file picker works in all states
- **Download Template**: Provides a CSV template download option for
users who need guidance on file format
- **Validation**: Only accepts CSV files (`.csv` extension)
- **States**: Manages upload states (uploading, completed, error) with
appropriate UI updates

Displays the current status of the uploaded file with three distinct
states:

1. **Uploading State**
   - Shows spinning CircleNotch icon
   - Displays "Uploading your file..." message
   - Shows filename

2. **Completed State**
   - Shows Table icon in green background
   - Displays filename and file size
   - Shows "Search" button to proceed with the uploaded file

3. **Error State**
   - Shows WarningOctagon icon in red background
- Special styling: light pink background (#FDF6F5) with red border
(#FFDFD9)
   - Displays error title and description in two lines
   - Shows two action buttons: "Download template" and "Select file"

The component handles six different error scenarios:
- **Unsupported**: Wrong file type (non-CSV files)
- **Unreadable**: File can't be parsed or is corrupted
- **Invalid Structure**: Missing headers or incorrect columns
- **Empty**: File has no data
- **Too Large**: File exceeds size limit
- **Unexpected**: Generic error for unknown issues

- Added attachment icon button to `SearchInputField` component
- Clicking the attachment button toggles the `FileUploadCard` visibility
- Card appears as a dropdown below the search input
- Smooth animations for show/hide transitions

- **File validation**: Automatically checks file type on selection/drop
- **Error recovery**: Users can easily select a new file or download
template when errors occur
- **Responsive design**: Components adapt to container width
- **Accessibility**: Proper ARIA labels and keyboard navigation support
- **Visual feedback**: Icons, colors, and animations provide clear
status indication

1. Navigate to a page with the search input
2. Click the attachment icon button (Paperclip icon)
3. The FileUploadCard should appear below the search input
4. Click "Select file" or drag-and-drop a CSV file
5. Observe the uploading state with spinning icon
6. After 2 seconds, see the completed state with "Search" button
7. Click the X button to remove the file and return to initial state

1. Open the FileUploadCard
2. Drag a CSV file over the dropzone
3. Observe the visual feedback (border and background color change)
4. Drop the file to upload

1. Open the FileUploadCard
2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
3. Observe error state with red icon and pink background
4. Read error message: "Unsupported file type." / "Upload a CSV or use
the template provided."
5. Click "Download template" to get a sample CSV
6. Click "Select file" to try uploading again

1. Upload a file successfully
2. Click the X button in the top-right of the file status
3. Component should return to initial dropzone state

<!-- Add your deploy preview link here -->

- [Phosphor Icons](https://phosphoricons.com/) - Icon library used for
UI elements
- [Conventional Commits](https://www.conventionalcommits.org/) - Commit
message format

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description

[BE-70]:
https://vtex-dev.atlassian.net/browse/BE-70?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* File upload card component enabling file selection via drag-and-drop
or file picker with status indicators
* File upload status component displaying upload progress, success, and
error states with customizable error handling
  * Attachment button in search input for quick file upload access

* **Chores**
  * Added component styling and Storybook demonstrations

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
@lariciamota
lariciamota merged commit a38c730 into vtex:feat/quick-order-by-file-feature-branch Feb 25, 2026
1 check passed
ataideverton added a commit that referenced this pull request Mar 4, 2026
This pull request introduces a new file upload and CSV parsing feature
to the `components` package, including reusable hooks and UI components.
The main changes are the addition of a `FileUploadCard` component for
uploading files, a `useCSVParser` hook for parsing CSV files in a web
worker, and a `useFileUpload` hook for managing file upload errors and
validation. These new utilities are exported for use in other parts of
the application.

This PR it was created from #3109

**New hooks and utilities:**

* Added `useCSVParser` hook for parsing CSV files in a web worker, with
error handling and CSV template generation.
* Added `useFileUpload` hook to manage file upload errors, validation,
and rejection reasons.
* Exported new hooks from the hooks index for easier consumption.
* Added type exports for CSV parsing to the main index file.

**New UI components:**

* Added `FileUploadCard` component for file selection, drag-and-drop,
and template download, with error state and file validation.
* Added exports for `FileUploadCard` and `FileUploadStatus` components
and their types.

**Dependency updates:**

* Added `papaparse` to dependencies for running CSV parsing in a web
worker.

![Nov-12-2025
14-49-47](https://github.com/user-attachments/assets/6aaf4cbd-4b2e-45ea-9a36-1278b8c2dc88)

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

- [Card](https://vtex-dev.atlassian.net/browse/BE-71)
-
[Figma](https://www.figma.com/design/YjU7SKqgLar3oxCP3SwagX/B2B-%C2%B7-Order-entry?node-id=53-3753&t=khUOMzHdN5djYyKo-0)

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [x] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* CSV parsing with worker-backed parsing, template generation, Dropzone
upload UI and an Upload File dropdown; file-based search integration.

* **Enhancements**
* New file upload hooks, FileUploadCard and FileUploadStatus props for
richer status, customizable labels, and improved file name/size
formatting.
  * Template download and clearer upload error handling.

* **Refactor**
* Tightened public type signatures and expanded component/hook exports.

* **Style**
  * Added Dropzone and upload-related styles and Storybook stories.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Giuliana Rigaud <[email protected]>
Co-authored-by: renato <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Everton Ataide <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request Mar 4, 2026
3 of 4 tasks
thiagopereira-vtex pushed a commit that referenced this pull request Mar 10, 2026
## Summary

- Replace hardcoded version references (`^3.97.0-dev.2`) with
`workspace:*` protocol for `@faststore/components` and `@faststore/ui`
in `packages/ui/package.json` and `packages/storybook/package.json`
- This ensures local packages are always resolved from the monorepo
workspace during development

## Motivation

Extracted from PR #3117 as requested in [code
review](#3117) by @lariciamota, so
we can identify possible problems easier by isolating this change.

## Changed files

- `packages/ui/package.json` — `@faststore/components` dependency and
peerDependency changed to `workspace:*`
- `packages/storybook/package.json` — `@faststore/components` and
`@faststore/ui` dependencies changed to `workspace:*`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Switched internal package references in Storybook and UI to
workspace-based declarations to improve build consistency.
* Aligned dependency declarations across the monorepo to reduce version
mismatch risks and streamline local development and local testing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
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.

8 participants