Commit Graph

538 Commits

Author SHA1 Message Date
Brandon Thomas 2cb5405b20 Merge pull request #47 from harrisonoconnorhover/codex/popup-dismissal
Fix worksheet popups staying open after outside clicks (#41)
2026-10-10 11:57:42 -04:00
Brandon Thomas 34ed83d13f Merge pull request #8 from switch87/desktop-log-file
Desktop: write log records to standard error and a rotating log file

# Conflicts:
#	apps/gridcraft/src/main.rs
2026-10-10 11:57:41 -04:00
Brandon Thomas 0feb404c68 Merge pull request #22 from DWAA1660/fix/windows-dx12-startup
Default Windows startup to DirectX 12
2026-10-10 11:57:31 -04:00
Brandon Thomas 0796c50816 Merge pull request #75 from DWAA1660/fix/71-snapshot-instructions
Fix the documented offscreen snapshot command (#71)
2026-10-10 11:57:30 -04:00
Brandon Thomas 674d422dc0 Merge pull request #77 from DWAA1660/fix/73-vertical-scrollbar
Add the missing vertical worksheet scrollbar (#73)
2026-10-10 11:57:29 -04:00
Brandon Thomas e165db1ffd Merge pull request #74 from DWAA1660/fix/70-inherit-cell-formatting
Preserve whole-sheet formatting when entering empty cells (#70)
2026-10-10 11:57:28 -04:00
Brandon Thomas f8b98775b8 Merge pull request #96 from harrisonoconnorhover/codex/system-theme
Add System appearance alongside Light and Dark themes
2026-10-10 11:57:27 -04:00
Brandon Thomas 38369a7566 Merge pull request #106 from harrisonoconnorhover/codex/border-previews
Preview border presets and fix shared-edge removal
2026-10-10 11:57:27 -04:00
Brandon Thomas 7f6739e665 Merge pull request #119 from agammann/fix/text-to-columns-escaped-quotes
Preserve doubled text qualifiers in Text to Columns
2026-10-10 11:57:26 -04:00
Brandon Thomas f736286f24 Merge pull request #50 from LloydNicholson/rotated-wrap-text
Issue #48: rotated text with Wrap Text draws upright (grid and print)

# Conflicts:
#	crates/ui-egui/tests/interaction.rs
2026-10-10 11:57:25 -04:00
Brandon Thomas 0aaaf9aeab Merge pull request #53 from LloydNicholson/general-number-fit
Issue #51: General numbers fit by the cell's own font, not 11pt
2026-10-10 11:57:15 -04:00
Brandon Thomas 7f9d77a12a Merge pull request #60 from MarekSpodBiedry/issue-58
ROUND: keep 15 significant digits when asked for 15+ digits, so ROUND(0.1+0.2,15) is 0.3 (#58)
2026-10-10 11:57:14 -04:00
Brandon Thomas 882a19568e Merge pull request #68 from LloydNicholson/fix/date-1900-feb-29
Issue #124: DATE(1900,2,29) is serial 60, as in Excel
2026-10-10 11:57:14 -04:00
Brandon Thomas 453882c6fe Merge pull request #67 from LloydNicholson/fix/sumif-sum-range-resize
Issue #123: SUMIF/AVERAGEIF size the sum range like the criteria range
2026-10-10 11:57:13 -04:00
Brandon Thomas 62d84cbbf5 Merge pull request #65 from MarekSpodBiedry/issue-63
XLSX: write _xlpm. prefix on LET/LAMBDA parameter names, strip it on read (#63)
2026-10-10 11:57:12 -04:00
Brandon Thomas 54df7e1fc5 Merge pull request #115 from nihilist-narwhal/feat-spill-range-operator
Formulas: the spill range operator (A1#)
2026-10-10 11:57:11 -04:00
Brandon Thomas c30a720998 Merge pull request #114 from nihilist-narwhal/fix-defined-name-entry
Names: R1C1-style names, Create from Selection bottom/right, LAMBDA name case
2026-10-10 11:57:10 -04:00
Brandon Thomas 986b6c6ea6 Merge pull request #113 from nihilist-narwhal/fix-defined-name-scopes
Names: keep sheet-level names with their sheet on move, copy and delete
2026-10-10 11:57:09 -04:00
Brandon Thomas 1cdee3ee02 Merge pull request #111 from nihilist-narwhal/fix-protection-commands
Protection: enforce locked cells for every command, keep hidden formulas hidden
2026-10-10 11:57:08 -04:00
Brandon Thomas a678c5d25f Merge pull request #34 from MarekSpodBiedry/issue-21
Fix: inserting or deleting rows, columns or cells cancels copy/cut mode (#21)
2026-10-10 11:57:08 -04:00
Brandon Thomas e92a67bbba Merge pull request #112 from nihilist-narwhal/fix-shifted-cell-references
Insert/Delete Cells: adjust references like Excel
2026-10-10 11:57:07 -04:00
Brandon Thomas 1b20cb873d Merge pull request #85 from nihilist-narwhal/xlsx-spill-cached-errors
XLSX: cache #SPILL! and #CALC! as #VALUE! so Excel can open the file
2026-10-10 11:57:06 -04:00
lloyd 3509bcfd87 macOS: open documents from Finder, the Dock and `open -a` (#69)
Double-clicking a workbook, Open With, dropping on the Dock icon and
`open -a GridCraft book.xlsx` send the app a kAEOpenDocuments Apple event
instead of command-line paths. winit 0.30 doesn't handle it, so AppKit
answered "GridCraft cannot open files in the Excel Workbook format".

Register the handler with the audited fmv-macos-events crate that PdfCraft
and PhotoCraft already use: it does the Objective-C interop (unsafe, which
this workspace forbids) behind a safe main-thread API and leaves winit's
delegate alone. Opened paths go through SheetApp::open_path; a quit event
closes the window. The registration lives in main() until the event loop
returns, so the event that launched the app is caught too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 14:17:14 +02:00
Fabio Lussi ded67f51d2 fix(fill): clamp month and year date series to the month's last day
Fill Series by month used the previous cell's day as an overflowing DATE()
day, so Jan 31 + 1 month became Mar 3 and February was skipped. The same
overflow affected year steps from Feb 29 and the autofill month pattern.

Each item is now computed from the start date plus n months and the day is
clamped to the target month's length (Jan 31, Feb 28, Mar 31, Apr 30), so
the clamp does not compound. Leap years are handled.

Fixes #132

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 13:28:07 +02:00
Fabio Lussi 61b264ac21 functions: MIN() accepts zero arguments
Excel documents the first argument of MIN as optional and returns 0
when there are no numbers. MIN was registered with a minimum of one
argument, so =MIN() returned #VALUE!. The aggregate already returns 0
for an empty list, so only the registered arity needed to change.

Fixes #138

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 13:26:36 +02:00
nihilist-narwhal f16fed557e Charts: write and read chartex parts
Histogram, box & whisker, waterfall, funnel, treemap and sunburst charts
were written as clustered columns, and reading skipped such charts in
files made by Excel, which keeps them as cx:chartSpace (chartex) parts.

The writer now writes these kinds as chartEx parts, as Excel lays them
out: the data goes through hidden _xlchart.v1.N workbook names, each
part comes with chart style and colour parts, and the drawing frames it
in mc:AlternateContent with a text-box fallback. Fills are written out
(series in theme accents, waterfall decreases and treemap/sunburst boxes
in their own, a white chart area), so they don't depend on the style
part. The reader reads the parts back (resolving the _xlchart names,
which aren't kept as names) with data, title, axis titles, legend,
labels and colours, and follows mc:AlternateContent in drawings.
2026-10-10 06:25:24 -05:00
nihilist-narwhal e5d34fd63a Recalc: dynamic arrays don't spill in tables
Excel doesn't support spilled arrays in tables: a formula such as
=SEQUENCE(2) entered in a table cell shows #SPILL! ("Spill range in
table"). GridCraft spilled it over the table's cells. An array whose
formula is in a table is now blocked, both when it is computed and when
it is written back.
2026-10-10 05:40:36 -05:00
nihilist-narwhal 8011191824 Go To: a table name selects the table's data
Go To (and the Name Box) with a table's name selected the whole table,
header and totals rows included. In Excel a table's name stands for its
data rows, as in formulas (=SUM(Table1) adds only the data).
2026-10-10 05:30:49 -05:00
nihilist-narwhal 985257b166 Tables: typing in the header row renames the column
Editing a table's header cell changed only the cell: the column kept its
old name, so =SUM(Table1[a]) still worked after the header read "zz",
and saving wrote the old names back into the header row, undoing the
edit on reopening. As in Excel, the column now takes the new header;
an emptied header becomes ColumnN and a repeated one gets a number
("a2"), written back into the cell, and structured references follow
the new name.
2026-10-10 05:30:49 -05:00
Harrison O'Connor-Hoover 8846dadc52 Fix #128: preserve references when cutting cells across sheets 2026-10-10 06:11:29 -04:00
Brandon Thomas c1b1eb6757 Merge pull request #109 from harrisonoconnorhover/codex/fast-drag-selection
Preserve quick selection drags and clarify the fill handle
2026-10-10 06:07:57 -04:00
Brandon Thomas 6f52f1fd3d Merge pull request #94 from harrisonoconnorhover/codex/keyboard-navigation
Fix Enter navigation returning to the last clicked cell
2026-10-10 06:07:56 -04:00
Brandon Thomas 14b59a71f5 Merge pull request #97 from harrisonoconnorhover/codex/file-menu
Add a visible File menu to the shared ribbon
2026-10-10 06:07:56 -04:00
Brandon Thomas 1c6cb3bce9 Merge pull request #95 from harrisonoconnorhover/codex/screenshot-timeout-advice
Recommend supported recovery steps after a screenshot timeout
2026-10-10 06:07:55 -04:00
nihilist-narwhal 97f7dca886 Recalc: INDIRECT and OFFSET see spills laid out in the same pass
A formula whose references are only known while evaluating isn't in the
dependency graph, so when it read a spill area before the array was laid
out in the same pass, nothing evaluated it again. With the full
recalculation now laying every spill out afresh, =INDIRECT("F7") over
a spill moved by an inserted row read 0 after Calculate Now. Such
formulas are evaluated once more when a pass computed any array.
2026-10-10 04:59:27 -05:00
nihilist-narwhal be8e379ca0 Recalc: formulas over a blocked spill see #SPILL!
A dynamic array that couldn't spill was only rejected when results were
written back, after formulas evaluated later in the same pass had read
the array as if it had spilled. With 1s in A1:C3 except B2 =
SEQUENCE(2,2,9) (blocked), =SUM(A1:C3) gave 47 after a full
recalculation (opening a file, Calculate Now) instead of #SPILL!; a
reader through OFFSET kept the wrong value even when entered one cell
at a time. The spill area is now checked as soon as the array is
computed, so the anchor is #SPILL! for everything after it.
2026-10-10 04:45:41 -05:00
nihilist-narwhal 303eabaad1 Recalc: an array that read another array's old spill is evaluated again
When two dynamic arrays were recalculated in the same pass and the
first read the second's spill area before the second was evaluated, it
read the old values. Formulas reading a spill area that changed are
evaluated again, but dynamic arrays were left out of that second round
(only to keep an array from re-queuing itself), so with D11 =
SEQUENCE(1,3,A1) and G5 = UNIQUE(VSTACK(F9:F12,A1)), changing A1 from 1
to 10 left 3 in G6 instead of 12. Only the array itself is left out
now.
2026-10-10 04:42:51 -05:00
nihilist-narwhal 880163d135 Recalc: a spill that goes away unblocks the arrays it blocked
With =SEQUENCE(5) in F8 and =SEQUENCE(1,3) in E10 (blocked by F10),
typing 0 into F9 blocks F8's array, which frees F10, but E10 stayed
#SPILL! until a full recalculation. When a formula stops spilling over
an area, #SPILL! anchors above or to the left of it are evaluated again.
2026-10-10 04:36:06 -05:00
nihilist-narwhal e51c1d98fb Recalc: clearing a distant blocker unblocks the spill
Clearing a cell re-evaluated #SPILL! anchors only within 64 rows and
columns above and to the left of it, so =SEQUENCE(100) in A1 stayed
#SPILL! after the blocker in A90 was cleared. Emptied cells now look
for blocked anchors any distance above or to the left, with one pass
over the formulas per sheet however many cells were cleared.

Fixes #139.
2026-10-10 04:31:28 -05:00
nihilist-narwhal dcc5434bc8 Recalc: structural edits don't leave old spills behind
Inserting or deleting rows and columns moved formula cells but not the
values they had spilled, and the full recalculation that follows
reconciled spills only at the formulas' new positions. =SEQUENCE(3) in
A5 with row 1 deleted showed #SPILL! in A4 (blocked by its own old
values in A6:A7); deleting the anchor's row left 2 and 3 behind. A full
recalculation now drops all spills and lays them out again from the
formulas.

Fixes #133.
2026-10-10 04:27:44 -05:00
nihilist-narwhal fc2f00bd50 Recalc: a range ending in INDEX depends on the cells it spans
=SUM(C3:INDEX(B9:C11,2,2)) adds C3:C10, but only C3 and B9:C11 were
recorded as its precedents, so typing into C5 left the total unchanged
until a full recalculation. A range whose ends are function results now
depends on the box spanned by the references inside it, which contains
any cell those functions can return.
2026-10-10 04:24:42 -05:00
nihilist-narwhal 48910d71d2 Recalc: replacing or clearing a spilling formula removes its spill
Typing a value over a dynamic array formula, or clearing it, left the
values it had spilled: with =SEQUENCE(3) in A1, typing 2 into A1 kept
2 and 3 in A2:A3, and =SUM(A1:A3) gave 7. Only formulas are evaluated
again, so the old spill of a cell that no longer holds a formula was
never written back. It is now removed when the formula goes, and the
formulas reading its area are recalculated.
2026-10-10 04:24:41 -05:00
nihilist-narwhal 5ad3c6eed3 Paste Special operations: keep text, errors and formulas
Add, Subtract, Multiply and Divide replaced every cell that didn't hold
a plain number with the pasted value: multiplying a column by 1 turned
numbers stored as text, headers and #N/A all into 1, and a formula into
a constant. As in Excel, numbers stored as text now take part (the
usual way to turn them into numbers), other text and errors stay, and
a formula is kept and combined with the pasted number: =(B3*2)*1.
2026-10-10 03:51:49 -05:00
nihilist-narwhal 60b60619b2 AutoFill: refuse a source as large as the sheet
The target was capped at 5 million cells but the source wasn't: with the
whole sheet as source and A1 as target, AutoFill read all 17 billion
source cells one column at a time and never finished.
2026-10-10 03:46:15 -05:00
nihilist-narwhal e5af1fcbff Spilled blank cells show 0
A formula's result that is a blank cell shows 0, but blanks inside an
array result spilled as blank cells: =A1:A3, or FILTER or SORT of a
range with blanks, left empty cells that ISBLANK saw as blank and
COUNT skipped. Excel shows 0 in each. GROUPBY and PIVOTBY keep the
blank cells of their own layout.
2026-10-10 03:19:45 -05:00
nihilist-narwhal 62b17379e3 Ranges keep their size past the used range
A multi-cell reference was read only up to the sheet's used range, so
the array it gave depended on what else was on the sheet:
ROWS(A1:A10*1), COUNTBLANK(A1:A10) and SUMPRODUCT(--(A1:A10="")) came
out smaller than in Excel, and changed as cells were entered elsewhere
without the formula recalculating. References of up to 16,384 cells now
keep their size; larger ones (A:A, ranges reserved for data to come
such as $A$2:$A$50000) still stop at the used range, so that formulas
over them stay fast.
2026-10-10 03:19:45 -05:00
nihilist-narwhal 1b0b2009aa Current region: grow past 10,000 rows, in linear time
current_region (Ctrl+A, and the range that sort, filter, AutoSum,
tables and Get Data use when one cell is selected) grew the region one
ring of cells per step and stopped after 10,000 steps, rescanning every
cell of the ring each time. With 20,000 rows of data and one cell
selected, data.sortDescending sorted only the first 10,001 rows and
left the rest as they were; a 100,000-row region took 30 s and was cut
at row 10,001.

It now grows one side at a time while the line next to that side has
data (diagonals included), checking only the cells of that line, with
no step limit.
2026-10-10 03:17:10 -05:00
nihilist-narwhal a059c8e196 Repeated headers: number pivot fields and table columns in linear time
Each header was checked against every name before it, once per suffix
tried, so a source whose headers repeat (a row of thousands of equal
labels, such as check boxes) took cubic time: 4,000 columns took 28 s
in Recommended PivotTables, and a row of 16,384 hung the app, in
PivotTables, in Insert Table and in Get Data from Table/Range. Taken
names and the next suffix of each header are now kept in hash maps, in
the pivot source, in table creation and in the XLSX pivot cache; the
names are the same as before.
2026-10-10 03:05:48 -05:00
nihilist-narwhal 7fece30d49 Remove Duplicates: compare only the part of the range with data
Given whole columns ("range":"D:D"), Remove Duplicates compared a
million blank rows and reported 1,048,573 removed duplicates; given the
whole sheet it ran for minutes, as it also did on a table resized to
the whole sheet. Rows and columns past the used range are blank, so
they are left out: the result is the same and the counts match the
data.
2026-10-10 02:49:31 -05:00
nihilist-narwhal 684567cc9a Whole-sheet selection: Fill and Remove Duplicates stay within the data
With the whole sheet selected (Ctrl+A on an empty sheet), Fill Down,
Right, Up and Left tried to fill all 17 billion cells and ran out of
memory, and Remove Duplicates scanned every row for minutes. Fill Up
and Fill Left also took their source row or column before narrowing the
selection to the data, so they filled up to row 1,048,576 even when the
sheet had data.

Whole rows and columns now narrow to the used range before anything
else (nothing to do on an empty sheet), Remove Duplicates works on the
active cell of an empty sheet, and a fill of more than 5,000,000 cells
is refused, as Auto Fill already does.
2026-10-10 02:33:26 -05:00