mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:05:25 +02:00
fix: normalize dimension key ordering for consistent grouping
Products with identical dimensions in different order (e.g. 29x10x15 vs 10x29x15) are now grouped together by sorting dimension values into a canonical form. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
16de3b3a6e
commit
efbcd952b7
@@ -42,7 +42,11 @@ export function DimensionsView({ data, headers, onEdit, onSaveRow, onCaptureStat
|
||||
const il = String(row[COLUMNS.INNER_L] || '0').trim();
|
||||
const ih = String(row[COLUMNS.INNER_H] || '0').trim();
|
||||
|
||||
const key = `${il}x${iw}x${ih}`;
|
||||
// Normalize key by sorting dimension values so different orderings
|
||||
// (e.g. "29x10x15" vs "10x29x15") are treated as the same group
|
||||
const sortedDims = [parseFloat(il) || 0, parseFloat(iw) || 0, parseFloat(ih) || 0]
|
||||
.sort((a, b) => a - b);
|
||||
const key = sortedDims.join('x');
|
||||
if (!groupMap.has(key)) {
|
||||
groupMap.set(key, []);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user