Start with an empty document; offer Datei › Neu and Datei › Muster

A first start (nothing in localStorage) now opens a blank document -- one
sheet "Blatt 1" with an empty "Tabelle 1" -- instead of the pre-filled
sample. The file menu gets "Neu" (blank document) and "Muster ·
Umsatzanalyse" (the former seed), both behind a confirm and both starting
a fresh undo history. The toolbar's "Zurücksetzen" button is gone; its job
is now Datei › Muster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
wkh
2026-09-28 02:11:51 +02:00
co-authored by Claude Opus 5.5
parent 86d03346e8
commit 5a79ddee79
5 changed files with 62 additions and 11 deletions
+21
View File
@@ -1,4 +1,7 @@
/**
* Document templates: `createBlankDocument()` (Datei › Neu, and what a first
* start opens) and `createSeedDocument()` (Datei › Muster).
*
* The pre-filled document ("roter Faden" of the study), in the v2 canvas model:
* one sheet ("Analyse") carrying three table objects and a chart object, plus a
* second empty sheet to try things out.
@@ -144,3 +147,21 @@ export function createSeedDocument(): DocumentState {
macros: [],
};
}
/** An empty document: one sheet with one empty table, ready to type into. */
export function createBlankDocument(): DocumentState {
const table = makeTable('Tabelle 1', 40, 40, 12, 6, []);
const sheet = { id: nextId('sheet'), name: 'Blatt 1', objects: [table] };
return {
version: 2,
sheets: [sheet],
activeSheetId: sheet.id,
activeObjectId: table.id,
selection: { tableId: table.id, anchor: { col: 0, row: 0 }, focus: { col: 0, row: 0 } },
locale: 'de-DE',
csvDelimiter: ',',
customFunctions: [],
namedRanges: [],
macros: [],
};
}