Repository navigation
Checkboxes: ribbon button, Excel's value and Delete rules, XLSX cell controls (#196) - #305
Merged
Merged
Conversation
…controls (storytold#196) insert.checkbox existed but had no ribbon button, replaced existing values with FALSE and was written to XLSX as an invalid number format. Now: Insert > Checkbox (Cell Controls); empty cells start FALSE, other values stay and display as General; toggling an emptied box checks it and only checkbox cells toggle; Delete unchecks first, then removes the boxes; XLSX reads and writes the checkbox as Excel's feature-property-bag cell control ([MS-XLSX] 2.1.22, 2.3.9, 2.4.99). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Merged — thank you for the contribution! If you haven't already, come join us on the ArtCraft Discord: https://discord.gg/artcraft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #196
Root cause
GridCraft already had cell checkboxes (
insert.checkbox, drawn in the grid, toggled by click or Space), but:checkbox. That is not a valid Excel format code, and Excel doesn't read it as a checkbox.What changed
checkboxmarker format now renders as General innumfmt).crates/xlsx/src/feature_bags.rs), from the public [MS-XLSX] spec sections 2.1.22, 2.3.9.1–2.3.9.4, 2.4.99, 2.6.229–2.6.239 and the Styles extension table 2.2.4.9:xfextLst({C7286773-470A-42A8-94C5-96B5CB345126}) holdingxfpb:xfComplement i="0".xl/featurePropertyBag/featurePropertyBag.xmlpart holds the chain Checkbox ← XFControls (CellControl) ← XFComplement (XFControls) ← XFComplements (MappedFeaturePropertyBags).…/2022/11/relationships/FeaturePropertyBag.xfwhose complement resolves through that chain to aCheckboxbag becomes a checkbox. Bad indexes, wrong bag types or a missing part just mean "not a checkbox"; nothing panics.Tests
checkboxes_keep_values_toggle_and_delete_in_two_passescheckboxes_survive_xlsx_as_cell_controls(write → read round trip; a plain cell next to it stays General)feature_bags::tests::written_chain_resolves_and_hostile_chains_do_notinteraction::space_toggles_the_active_checkbox_without_clicking_the_hovered_cellstill passes.cargo test -p gridcraft-enginecargo test -p gridcraft-xlsxcargo test -p gridcraft-numfmtcargo test -p gridcraft-ui-egui --lib --test interactioncargo fmtandcargo clippy --all-targets -D warningson numfmt, engine, xlsx and ui-eguiNot done
defaultkey (2.3.9.4) is not read or written; absent means FALSE.DXFComplements, 2.3.9.5) is not handled.Unverified assumptions (needs confirmation in Excel)
defaultkey suggests Excel may write FALSE on insert.🤖 Generated with Claude Code