Show the selected range, not just the active cell, in status/formula bar

New store computed selectionRangeName: for a single cell it's identical
to activeCellName ("Umsatz::B2"), for a multi-cell selection it shows
the full primary rectangle ("Umsatz::B2:E6"), and a discontiguous
multi-selection gets a "+N" suffix for the further rectangles.
activeCellName itself is untouched (still anchor-only, since that's what
a formula/edit actually targets) -- only the formula bar's name field and
the status bar's range label switch to the new computed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
wkh
2026-09-02 15:49:35 +02:00
co-authored by Claude Sonnet 5
parent 85a8687020
commit 1046b22e96
5 changed files with 50 additions and 6 deletions
+16
View File
@@ -138,6 +138,22 @@ describe('seed document acceptance (canvas model)', () => {
// the active cell is the anchor -- the first cell of the selection -- not
// wherever the selection was extended to.
expect(s.activeCellName.value).toBe(`Umsatz::${toA1(1, 1)}`);
// selectionRangeName shows the full range instead (status bar / formula bar)
expect(s.selectionRangeName.value).toBe(`Umsatz::${toA1(1, 1)}:${toA1(1, 5)}`);
});
it('selectionRangeName shows a single address for a 1x1 selection and a "+N" suffix for a discontiguous multi-selection', () => {
const s = fresh();
const umsatz = tableId(s, 'Umsatz');
s.setSelection({ tableId: umsatz, anchor: { col: 0, row: 0 }, focus: { col: 0, row: 0 } });
expect(s.selectionRangeName.value).toBe(`Umsatz::${toA1(0, 0)}`);
s.addToSelection(umsatz, 3, 3);
s.addToSelection(umsatz, 5, 5);
// addToSelection() moves the primary rect to the just-clicked cell (see
// "Mehrfachauswahl" tests below) -- the range name follows it, plus a
// "+N" for the other rectangles now in the selection.
expect(s.selectionRangeName.value).toBe(`Umsatz::${toA1(5, 5)} +2`);
});
it('recalculation visits precedents before dependents across tables', () => {