Commit Graph

64 Commits

Author SHA1 Message Date
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
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 9c29ef3fff Formulas: the spill range operator A1#
formula::parse("Sheet1!$D$1#") failed with "unknown error literal".
A # right after a cell reference is now the spill range operator: it
evaluates to the anchor's current spill range, or #REF! when the cell
doesn't spill (or its spill is blocked). Its users depend on the
anchor, so they recalculate when the spill grows or shrinks. Names can
use it.

Files have no # operator: like Excel, the writer stores A1# as
_xlfn.ANCHORARRAY(A1), and the parser reads that back as A1#.
2026-10-09 23:29:35 -05:00
nihilist-narwhal d4d38fd224 Names: calls of LAMBDA names keep the name's case
The parser upper-cases function names, so =Double(4) showed as
=DOUBLE(4). Calls of LAMBDA names are now spelled like the name when
a formula is entered and when a file is read.
2026-10-09 23:27:39 -05:00
nihilist-narwhal b28b4b729f Names: Create from Selection uses bottom and right, keeps existing names
formulas.createFromSelection ignored bottom and right, and replaced any
workbook name with the same label without asking. Bottom-row and
right-column labels now name the cells above and to their left. An
existing name is kept and listed in the result's skipped, unless
replace is set (Excel asks; a command doesn't open dialogs).
2026-10-09 23:27:38 -05:00
nihilist-narwhal 8029433b1c Names: refuse R1C1-style names
valid_name refused R and C but took R1C1, R2, C3 and RC, which Excel
refuses because they read as R1C1 references.
2026-10-09 23:27:38 -05:00
nihilist-narwhal 68fac6d861 Insert/Delete Cells: adjust references like Excel
Delete Cells built the references' edit and then discarded it, so
references into the deleted cells didn't become #REF!, and Insert Cells
treated the shift as a move of everything below, so =SUM(A1:A5) didn't
grow to A1:A6 when A3 was inserted.

Two new structural edits, InsertCells and DeleteCells, adjust a
reference like inserting/deleting rows (columns) when it lies within the
shifted columns (rows), and leave it as it is otherwise, as Excel does.
Formulas, defined names, chart series, conditional-format, validation,
table and print-area ranges, notes, links and sparklines follow.
2026-10-09 23:27:21 -05:00
nihilist-narwhal e294345599 Protection: keep hidden formulas hidden
On a protected sheet a formula formatted Hidden still showed with Show
Formulas on, matched Find in formulas, and showed in the formula bar
when a cell of its spill range was selected.
2026-10-09 23:25:58 -05:00
nihilist-narwhal 2a3d1ffd7f Protection: refuse every edit of a locked cell on a protected sheet
Only cell.set checked protection. The check now runs where every edit
is committed: an edit that changes the value or formula of a locked
cell on a protected sheet is refused with Excel's message, whichever
command made it (clear, paste, fills, setValues, replace, goal seek,
sort, insert/delete cells...).

Inserting and deleting rows and columns follow the protection's
options, and deleted lines must not hold locked cells.
2026-10-09 23:25:58 -05:00
nihilist-narwhal b53a190ea1 Names: keep sheet-level names with their sheet
Moving a sheet left its sheet-level names on whatever sheet took its
index, and copying it shifted nothing and copied no names. Moving now
re-indexes name scopes, and a copy gets copies of the sheet's names,
referring to the copy, as in Excel.

Deleting a sheet left names that referred to it pointing at nothing;
they now become #REF!. formulas.deleteName honours scope, and the Name
Manager's Delete passes it.
2026-10-09 22:52:49 -05:00
Harrison O'Connor-Hoover 198e8ecb05 Issue #28: retain quick selection drag endpoints and clarify fill handle 2026-10-09 23:05:46 -04:00
harrisonoconnorhover daf4591da0 Expose basic file operations in the shared ribbon (#93) 2026-10-09 21:35:53 -04:00
harrisonoconnorhover 91d44508b1 Correct screenshot timeout recovery advice (#78) 2026-10-09 21:27:18 -04:00
harrisonoconnorhover 698a2a8009 Keep keyboard navigation separate from pointer clicks (#87) 2026-10-09 21:26:06 -04:00
Brandon Thomas 13664fe66b Bump version to 0.4.0 (from 0.3.0) for release; refresh contributors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 21:02:14 -04:00
nihilist-narwhal 311b1a593f Contributors: add nihilist-narwhal 2026-10-09 17:14:59 -05:00
nihilist-narwhal cd083cfc50 XLSX: cache #SPILL! and #CALC! as #VALUE!
They are not error codes of the file format, and Excel refuses to open a
file whose cached values contain them ("Parameter error"). Any workbook
with a blocked spill could not be opened in Excel. Excel caches these
errors as #VALUE! itself.
2026-10-09 17:14:59 -05:00
MarekSpodBiedry b8b3ba0b0e XLSX: write _xlpm. prefix on LET/LAMBDA parameter names, strip it on read (#63) 2026-10-09 20:57:44 +02:00
lloyd 8fe3276cb8 SUMIF/AVERAGEIF size the sum range like the criteria range
Excel adds up the range that starts at sum_range's top-left cell and has
the criteria range's height and width, whatever size sum_range has. With
A1:B3 = a,1 / b,2 / a,3, =SUMIF(A1:A3,"a",B1) is 4; GridCraft gave 1,
because if_numbers only saw sum_range's values (one cell) and read them
at the criteria positions. Its comment promised the resizing, but by then
the argument was a plain value.

The evaluator has the references, so it now does the resizing, as it does
for OFFSET and INDEX: for SUMIF and AVERAGEIF with three arguments, a
single-area sum range reference becomes resized_sum_range(sum, criteria
height, criteria width), cut off at the sheet's edge. It works across
sheets and through names. The dependency graph records the resized
range, so editing a cell inside it recalculates; when the criteria range
isn't a plain reference the formula is recalculated every time instead.
SUMIFS and AVERAGEIFS keep requiring same-size ranges (#VALUE!
otherwise).

Tests: a single-cell, shorter, wider, longer and horizontal sum range,
whole-column criteria, editing a cell of the resized range, the sheet
edge, another sheet and a defined name, and SUMIFS/AVERAGEIFS size
mismatches. They fail before the fix (1 instead of 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 20:44:18 +02:00
lloyd ecaead4c12 DATE(1900,2,29) is serial 60, as in Excel
serial_from_ymd worked out the real calendar date and then moved serials
up to 60 down by one. February 1900 has no 29th in the real calendar, so
DATE(1900,2,29) and DATEVALUE("2/29/1900") rolled over to 1 March (61),
and DATE(1900,3,0) gave 28 February (59). Excel's 1900 system keeps the
Lotus leap day: serial 60 is 29 February 1900, and DAY(60) already
said so.

The serial of the first of the month is now taken in Excel's calendar
(one lower up to February 1900), and the day, with any overflow, counts
on from there. So day and month overflow pass through serial 60 both
ways: DATE(1900,1,60), DATE(1900,4,-31) and DATE(1901,-10,29) are 60 too.
Month and day arithmetic is checked, so hostile values return None.

days_in_month_in gives February 1900 29 days in the 1900 system; EDATE
and EOMONTH use it, so EOMONTH(60,0) is 60 rather than the day before,
and the text parser uses it in place of its own special case. The 1904
system is unchanged (1900 is before its epoch).

Tests: serials around the leap day (overflow both ways, every serial
0-366 round-trips through its year, month and day), hostile months and
days, parsing 2/29/1900 and 1900-02-29, DATE/DATEVALUE/EDATE/EOMONTH
in the 1900 system and the 1904 system. The DATE, DATEVALUE and serial
cases fail before the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 20:36:08 +02:00
MarekSpodBiedry 2c2d92ef6b ROUND: keep 15 significant digits when asked for 15+ digits, so ROUND(0.1+0.2,15) is 0.3 (#58) 2026-10-09 19:29:29 +02:00
lloyd 903bbb096d Issue #51: General numbers fit by the cell's own font, not 11pt
grid.rs measured the digit width once, for an 11pt cell font, and
display_text judged how many General digits fit from that whatever the
cell's size. 9pt marks such as 100 in columns with a stored width of 4
(common in mark sheets) came out as ##. The width is now measured per cell
with its own font and size, as print.rs already does; the shared 11pt
measurement and its paint_quadrant parameter go away.

Test: a 9pt 100 in a 28px column draws in full, while 123456789 next to it
still shows ####. Fails before the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 17:23:15 +02:00
lloyd ad6e77f6ef Issue #48: rotated text with Wrap Text draws upright (grid and print)
Narrow columns with tall, upright headers (mark sheets) set both a text
rotation and Wrap Text. The wrap path drew the text flat and returned before
the rotation was applied, so headers came out as 3-4 character fragments.

- Rotated text no longer takes the flat wrap path. Upright (+/-90 deg) text
  wraps to the row height, its lines stacking across the column; other
  angles keep one line, as before.
- Downward text was anchored at the bottom-left and ran out of the cell
  (over the row headers); it now starts at the top, one block-height in.
- Upright text no longer overflows into empty neighbours: its width is its
  line height, and the overflow repainted their gridlines.
- Print/PDF gets the same three fixes.

Tests: ui-egui interaction test (shapes drawn at +/-90 deg, inside a
one-column clip) and a print test (every text block on the page rotated,
a few long lines each). Each failed before the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 17:13:40 +02:00
Brandon Thomas 51b531be3e
Merge pull request #13 from XusBadia/dmg-background
macOS DMG: branded window background and icon layout
2026-10-09 09:20:56 -04:00
MarekSpodBiedry 4dd49f7b95 Fix: inserting or deleting rows, columns or cells cancels copy/cut mode (#21) 2026-10-09 10:45:50 +02:00
Xus Badia be33eba7d1 macOS DMG: branded window background and icon layout
The DMG opened as a plain Finder window. It now shows the app icon's figure on
the GridCraft colour, with GridCraft.app and the Applications link side by side.
Same approach as PhotoCraft's and VectorCraft's (storytold/photocraft#1201,
storytold/vectorcraft#493).

- packaging/macos/dmg/: background.svg (source; text outlined, no paper grain,
  the figure an <image> of assets/app-icon), background.tiff (1x + 2x HiDPI,
  16-colour palette, Deflate, sRGB; ~26 KB)
  and dmg-layout.DS_Store (Finder view settings: window, icon size 128,
  positions, background).
- generate.py writes the TIFF and the layout on any OS, byte-for-byte
  reproducible, with nothing from the machine that ran it (no paths, users,
  disk names or volume UUIDs).
- package.sh copies them into the staging folder; the image is still built with
  hdiutil makehybrid. Nothing extra runs in the signing job.
- The volume name drops the version: the layout finds the background through
  an alias that includes the volume name. The DMG file name keeps the version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 07:43:50 +02:00
Brandon Thomas fb823899c5 Bump version to 0.3.0 (from 0.2.0) for release
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:02:29 -04:00
Brandon Thomas 26a6969626
README Downloads: where to get it first, then builds with Windows before macOS (#15)
Co-authored-by: Brandon Thomas <shared2@storyteller.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 09:50:17 -04:00
Brandon Thomas 64c223c5f8
Release: Flatpak x86_64/aarch64, AppImage zsync updates, README Downloads (#14)
- AppImages embed gh-releases-zsync update information and ship a .zsync beside them;
  the linux job installs zsync and checks both.
- New flatpak job (x86_64 on ubuntu-24.04, aarch64 on ubuntu-24.04-arm) repackages the
  linux tarball with packaging/linux/flatpak-bundle.sh and the new bundle manifest; the
  from-source manifest gets the same commented finish-args, and packaging-lint checks
  that the two agree.
- Jobs that sign nothing (version, linux, flatpak, web, FreeBSD packaging) no longer use
  the release environment, so a branch dispatch is a dry run; the draft-release job still
  needs the signed jobs and only runs on the release branch.
- README: Downloads section listing every build.

Co-authored-by: Brandon Thomas <shared2@storyteller.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 09:31:42 -04:00
Brandon Thomas a3cbb9b9a7 Bump version to 0.2.0 (from 0.1.0) for release
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 08:13:30 -04:00
Brandon Thomas c6b6f4177c Release CI: macOS job on macos-15-xlarge
Custom macOS larger runners in a runner group do not pick up jobs; the
built-in M2 Pro label does. Only release.yml uses it, and the
actions_macos_xl budget caps the monthly spend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:08:13 -04:00
Brandon Thomas 3809fb7680 Release CI: macOS job on the org macos-release runner
The standard macOS runners are shared with all CI and queue for an hour or
more. The macos-release runner (GitHub-hosted M2 Pro) is in a runner group
usable only by release.yml on the release branch, with a monthly spend cap
on the actions_macos_xl SKU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:55:05 -04:00
Brandon Thomas 39082d13c8
About: contributor and model credits compiled in (grab bag + table, self-submitted names) (#2)
* About: contributors compiled in from contributors.json (grab bag + table, sortable, name toggle)

Adds an About GridCraft dialog (tabs About · Contributors · Models) following the craftrules
standard (standards/contributors.md): contributors/contributors.json is generated by
craftrules/scripts/contributors.py and baked into the binary by crates/ui-egui/build.rs as
static tables. Each contributor line: @username, opt-in display/real name, PRs, commits,
lines +/−/Δ, binary assets +/−, first/last commit. Sortable by every column; alphabetical
ignores case and the leading @.

Reachable from the macOS app menu (About GridCraft, previously a web link), Help ▸
Contributors…, and Automate ▸ About GridCraft in the ribbon (all platforms and the web).
Dialog hyperlinks open through the host's open_url service. The snapshot example gains
--dialog 'name={json}' for offscreen renders of dialogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Contributors: self-submitted names in contributors/people.toml; AGENTS.md credit-yourself section

build.rs reads contributors/people.toml next to the generated contributors.json and shows a name only
for entries the generator verified as written by that person (craftrules standards/contributors.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Contributors: regenerate (verified people.toml entries)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:16:34 -04:00
Brandon Thomas a60bd2f40e
Rename PrintCraft to PdfCraft (storytold/pdfcraft) (#1)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:45:37 -04:00
Brandon Thomas efbcb01b77 CI: build workflows run only from the release branch
Release, FreeBSD and Windows ARM64 builds no longer run on main, PRs or a
schedule; every build job checks for refs/heads/release so a manual run
from another branch is skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 02:08:46 -04:00