res-sheets Phase 4g: array/spill (deferred design) #7
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/.agent#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plan: res-sheets Phase 4g — Array/Spill Functions (design-only)
Goal
Design how
UNIQUE,SORT,FILTER,SEQUENCE, andTRANSPOSEcan return 2D result blocks that spill into neighboring cells. Implementation is deferred until after Phases 4a–4f are complete.Why this is a separate epic
The current
Valuetype is a scalar (Number,Text,Bool,Error,Empty). Array functions produce rectangular results. Supporting them requires either:ValueKindfor arrays plus spill logic inrecalc.goand the TUI renderer, orEither path touches the storage model, dependency graph, and UI rendering.
Affected areas (to be designed)
extra/lib/sheets/formula_value.go— array Value representation.extra/lib/sheets/recalc.go— how a spilled cell writes into neighbors.extra/lib/sheets/tui/view.go— rendering spilled values without overwriting real cell content.extra/lib/sheets/cell.go— possibly aSpillfield onCell.Candidate functions
UNIQUE(range)— remove duplicate rows.SORT(range, [sort_index], [sort_order])— sort by column.FILTER(range, include_range, [if_empty])— include rows where condition is true.SEQUENCE(rows, [columns], [start], [step])— generate numeric grid.TRANSPOSE(range)— swap rows/columns.Open design questions
UNIQUE/SORTcompare mixed text/number values?Next step
Do not implement. Revisit after Phases 4a–4f and Phase 5 are complete.