feat(sheet): extract form control checkboxes - #123
Conversation
09cf9e9 to
458d52c
Compare
458d52c to
396865a
Compare
4775c3e to
0b723ac
Compare
|
@cubic-dev-ai review |
There was a problem hiding this comment.
2 issues found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/formats/sheet/xlsx.rs">
<violation number="1" location="src/formats/sheet/xlsx.rs:411">
P2: When a checkbox is anchored at the hidden origin of a merged range, the merge relocation moves it into the first visible row or column. Filter controls anchored in hidden coordinates before merging so hidden controls remain omitted.</violation>
</file>
<file name="src/formats/odf/table.rs">
<violation number="1" location="src/formats/odf/table.rs:28">
P1: Standard ODS places `office:forms` under `office:spreadsheet`, alongside `table:table`. Because `parse_table` receives only the table, `read_checkboxes(elem)` misses those forms and drops every anchored control. Collect forms at spreadsheet scope and pass them into each table parser.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| pending_rows: 0, | ||
| header_rows: 0, | ||
| rows_emitted: 0, | ||
| checkboxes: read_checkboxes(elem), |
There was a problem hiding this comment.
P1: Standard ODS places office:forms under office:spreadsheet, alongside table:table. Because parse_table receives only the table, read_checkboxes(elem) misses those forms and drops every anchored control. Collect forms at spreadsheet scope and pass them into each table parser.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/formats/odf/table.rs, line 28:
<comment>Standard ODS places `office:forms` under `office:spreadsheet`, alongside `table:table`. Because `parse_table` receives only the table, `read_checkboxes(elem)` misses those forms and drops every anchored control. Collect forms at spreadsheet scope and pass them into each table parser.</comment>
<file context>
@@ -23,6 +25,7 @@ pub fn parse_table(elem: &Element, ctx: &Ctx) -> Result<Vec<Block>, ConvertError
pending_rows: 0,
header_rows: 0,
rows_emitted: 0,
+ checkboxes: read_checkboxes(elem),
};
walk_rows(elem, ctx, &mut state, true)?;
</file context>
| // the assembly no longer cares which was which. | ||
| let mut cells: HashMap<(u32, u32), Vec<Inline>> = HashMap::new(); | ||
| for (at, boxes) in sheet.checkboxes.drain() { | ||
| if at.0 < MAX_ROWS && at.1 < MAX_COLS { |
There was a problem hiding this comment.
P2: When a checkbox is anchored at the hidden origin of a merged range, the merge relocation moves it into the first visible row or column. Filter controls anchored in hidden coordinates before merging so hidden controls remain omitted.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/formats/sheet/xlsx.rs, line 411:
<comment>When a checkbox is anchored at the hidden origin of a merged range, the merge relocation moves it into the first visible row or column. Filter controls anchored in hidden coordinates before merging so hidden controls remain omitted.</comment>
<file context>
@@ -400,10 +404,20 @@ pub(super) fn build_table(
+ // the assembly no longer cares which was which.
+ let mut cells: HashMap<(u32, u32), Vec<Inline>> = HashMap::new();
+ for (at, boxes) in sheet.checkboxes.drain() {
+ if at.0 < MAX_ROWS && at.1 < MAX_COLS {
+ cells.insert(at, cell_inlines(sheet.cells.remove(&at), &boxes));
+ }
</file context>
| if at.0 < MAX_ROWS && at.1 < MAX_COLS { | |
| if at.0 < MAX_ROWS && at.1 < MAX_COLS && !hidden_row(at.0) && !hidden_col(at.1) { |
@tomsideguide I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review |
0b723ac to
283fe00
Compare
@tomsideguide I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
283fe00 to
6066677
Compare
|
@cubic-dev-ai review |
@tomsideguide I have started the AI code review. It will take a few minutes to complete. |
The core model gained Inline::Checkbox and moved task-list state out of ListItem in firecrawl#123, which updated the Node, Python, and WASM bindings. The Ruby binding lives only in this fork, so the merge left its inline match non-exhaustive and its list item build reading a field that is gone. Every native build failed to compile. Map the variant the way the other bindings do: kind :checkbox, with the state on a new checked member, which ListItem loses in the same step. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Form control checkboxes are drawing objects floating over the grid, so every spreadsheet reader dropped them (#115).
Each checkbox now lands in the cell its anchor starts in, as
[x]/[ ]plus its caption: xlsx/xlsm/xlsb read the worksheet's VML drawing, xls reads MSODRAWING + OBJ + TXO, ods readsoffice:formscontrols anchored in a cell. Hidden controls, and controls in hidden rows or columns, are omitted like any hidden content.Stacked on #122. Watch: the mixed state and ODS controls anchored to the page (coordinates only) are not placed; the new Excel 365 cell checkboxes still come out as
TRUE/FALSE.Summary by cubic
Extracts form control checkboxes and renders them inline in their anchor cell. Previously these shapes were dropped; now cells show “[x]” or “[ ]” plus the caption so user-visible data survives.
Behavior and coverage
.xlsx/.xlsm/.xlsb): reads legacy VML checkboxes via worksheet.relstovmlDrawing*.vml; ignores non-checkbox shapes andvisibility:hidden..xls: takes anchor fromMSODRAWINGclient anchors, checked state fromOBJ(mixed ignored), caption fromTXO.office:formsform:checkboxreferenced bydraw:controlin a cell; usesform:labelandform:(current-)state.Notes (review and API)
sheet::controls; checkboxes flow throughSheetContent.checkboxesand are merged inbuild_table.FORMandX_VML.Inline::Checkbox(checked)tokens.Written for commit 6066677. Summary will update on new commits.