Skip to content

fix(editor): stop section bands becoming tables and list fields - #12

Merged
iamgp merged 1 commit into
mainfrom
fix/scan-section-bands
Sep 17, 2026
Merged

iamgp merged 1 commit into
mainfrom
fix/scan-section-bands

Conversation

@iamgp

@iamgp iamgp commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Why the change

Worksheet forms title each section with a merged band such as "Supplementary Pages" or "Equipment", and the scan read those bands as data: as a table header over the section, or as the label of a list field over the section's own row labels.

Special things to note

Change outline

Two guards, both keyed on the same shape: a run of cells that is one merged region is a title, not data.

 findTableSuggestions
   assessHeaderRow
+  if (isSectionBand(row, run)) continue          # a band titles the section, it does not name columns
   measureTableBlock

 findRangeSuggestions
   label = sheet.data[row][col]
+  if (label cell is merged across columns) continue   # a band never starts a list field
   depthAt(...)
isSectionBand(row, startCol, endCol)
  for every column in the run
    if the cell is not merged, or its merge is not exactly startCol..endCol
      return false
  return true

The section band that used to be read as a header row, in the reported shape:

 row 28  [ Blank and NPC preparation            ]   merged A28:F28
 row 29    PBS aliquoted for Blank and NPC ...   Yes
-        -> table "blank_and_npc_preparation_table" over A28:F, headers [Blank and NPC preparation x6]
+        -> no suggestion
 editor/src/
 └── lib/
     ├── suggestions.ts          # isSectionBand guard in the table and range paths
     └── suggestions.test.ts     # 2 new cases: band as header, band as list label

Worksheet forms title each section with a merged band such as "Supplementary
Pages" or "Equipment". When the row underneath held a single label and a status
value, the scan read the band as a table header and proposed a table over the
section, and it also read the band as the label of a list field over the section's
own row labels.

A run that is one merged region is now treated as a section title: it never
becomes a table header, and it never starts a range field.
@iamgp
iamgp merged commit 50b510e into main Sep 17, 2026
6 checks passed
@iamgp
iamgp deleted the fix/scan-section-bands branch September 17, 2026 16:07
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.

1 participant