feat: bulk ASIN selection via space-separated paste in filters

Allow pasting multiple ASINs separated by spaces in any MultiSelectDropdown
search field and pressing Enter to auto-select all matching options.
Also switch ads CSV/Excel parsing to header-based column mapping for
robustness across different file formats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Vidal Wolf
2026-02-25 14:01:11 +01:00
co-authored by Claude Opus 4.6
parent 69eafe8335
commit 487b8e105e
3 changed files with 47 additions and 65 deletions
+14 -1
View File
@@ -181,7 +181,20 @@ const MultiSelectDropdown: React.FC<MultiSelectDropdownProps> = ({ label, select
onKeyDown={(e) => {
if (e.key === 'Enter') {
e.preventDefault();
if (filteredOptions.length > 0) {
// Check if input contains multiple space-separated terms (bulk paste)
const terms = searchTerm.trim().split(/\s+/).filter(Boolean);
if (terms.length > 1) {
// Bulk select: match each term against options (case-insensitive)
const termsLower = terms.map(t => t.toLowerCase());
const matched = options.filter(opt =>
termsLower.some(t => opt.toLowerCase() === t || opt.toLowerCase().includes(t))
);
if (matched.length > 0) {
onChange(Array.from(new Set([...selected, ...matched])));
}
setIsOpen(false);
setSearchTerm('');
} else if (filteredOptions.length > 0) {
const allSelected = filteredOptions.every(opt => selected.includes(opt));
if (allSelected) {
// Deselect all filtered