mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-12 17:04:57 +03:00
fix(web-test): adaptive header detection threshold for narrow spreadsheets
Hardcoded threshold of 3 non-empty cells prevented header detection in spreadsheets with 1-2 columns (e.g. query console results). Use Math.min(3, maxCol + 1) so narrow tables can still be parsed structurally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1056,7 +1056,7 @@ function buildSpreadsheetMapping(allCells) {
|
||||
// Find header rows
|
||||
let detailIdx = -1;
|
||||
for (let i = firstDataIdx - 1; i >= 0; i--) {
|
||||
if (nonEmpty(rows[i]) >= 3) { detailIdx = i; break; }
|
||||
if (nonEmpty(rows[i]) >= Math.min(3, maxCol + 1)) { detailIdx = i; break; }
|
||||
}
|
||||
if (detailIdx === -1) return null; // no headers detected
|
||||
|
||||
|
||||
Reference in New Issue
Block a user