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:
@@ -77,7 +77,7 @@ import type {
|
||||
TextObject,
|
||||
} from './types';
|
||||
import { defaultTableView, DEFAULT_ROW_H, MIN_GRID_SIZE, MAX_GRID_SIZE } from './types';
|
||||
import { createSeedDocument } from '../data/seed';
|
||||
import { createBlankDocument, createSeedDocument } from '../data/seed';
|
||||
import { validateDocument } from '../io/json';
|
||||
|
||||
const STORAGE_KEY = 'numolus:doc:v2';
|
||||
@@ -535,7 +535,7 @@ function loadInitial(): DocumentState {
|
||||
} catch {
|
||||
/* missing / corrupt / stale-schema -> clean fallback */
|
||||
}
|
||||
return createSeedDocument();
|
||||
return createBlankDocument();
|
||||
}
|
||||
|
||||
// ---- store singleton --------------------------------------------------
|
||||
@@ -2848,6 +2848,11 @@ function createStore() {
|
||||
applyDocumentState(next);
|
||||
resetHistory();
|
||||
}
|
||||
/** Datei › Neu: an empty document. */
|
||||
function newDocument() {
|
||||
replaceDocument(createBlankDocument());
|
||||
}
|
||||
/** Datei › Muster: the pre-filled sample document. */
|
||||
function resetToSeed() {
|
||||
replaceDocument(createSeedDocument());
|
||||
}
|
||||
@@ -3040,6 +3045,7 @@ function createStore() {
|
||||
pointDrag,
|
||||
// document
|
||||
replaceDocument,
|
||||
newDocument,
|
||||
resetToSeed,
|
||||
appendSheets,
|
||||
addTableFromCells,
|
||||
|
||||
Reference in New Issue
Block a user