-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cli): Add batch styling operations support #88
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Current State
The batch command currently only supports `put` and `putf` operations for values and formulas:
[
{"op": "put", "ref": "A1", "value": "Hello"},
{"op": "putf", "ref": "B1", "formula": "=A1"}
]Proposal
Extend batch operations to support styling and other mutations:
[
{"op": "put", "ref": "A1", "value": "Title"},
{"op": "style", "ref": "A1:E1", "bold": true, "bg": "navy", "fg": "white"},
{"op": "merge", "ref": "A1:E1"},
{"op": "border", "ref": "A1:E10", "style": "thin"},
{"op": "colwidth", "col": "A", "width": 15},
{"op": "rowheight", "row": 1, "height": 20}
]Benefits
- Single-pass workbook creation with full formatting
- Atomic operations (all succeed or none)
- Reduced I/O (one read + one write)
- Better for scripted/automated workflows
- Enables complex template population
Proposed Operations
| Operation | Properties | Description |
|---|---|---|
put |
ref, value | Set cell value (existing) |
putf |
ref, formula | Set formula (existing) |
style |
ref, bold, italic, bg, fg, fontSize, fontName, align, valign, wrap, numFormat | Apply cell style |
merge |
ref | Merge cell range |
unmerge |
ref | Unmerge cell range |
border |
ref, style, color | Apply borders |
colwidth |
col, width | Set column width |
rowheight |
row, height | Set row height |
hide |
row OR col | Hide row/column |
comment |
ref, text, author | Add cell comment |
Implementation Notes
- Parse batch JSON into sealed trait of operations
- Execute operations sequentially on sheet
- Validate all operations before executing (fail-fast)
- Consider transaction-like semantics
Priority
Medium - significant usability improvement for automation.
Related
- Similar to Excel's macro recording capability
- Would enable "template" workflows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request