refactor: implement template-driven node tree and human-readable vault layout
Unified Node model: added template_id, fs_path, archived, sort_order fields. Template registry: system templates embedded as JSON (folder/project/client/ document/recipe), with Registry for enabled/disabled/filtered access. SafeDisplayNameToPathSegment: human-readable path segments with Cyrillic support, illegal char replacement, uniqueness via numeric suffixes. Sidebar refactored: system views (Today/Inbox/Activity) separate from workspace tree. Creation menu built dynamically from enabled templates. Create/Rename/Move: physical folder operations with fs_path update, recursive descendant path updates. DB migration 012: adds template_id, fs_path, archived columns. Vault migration command: rebuilds fs_path for existing nodes. Tests: safename, registry, node model, repository integration. Docs: VAULT_LAYOUT.md, TEMPLATES.md, PLAN.md updated. i18n: nav.system, nav.workspace, template.*, common.rename/archive, migrate.* keys added to ru.json and en.json.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package storage
|
||||
|
||||
// migration012 — add template_id, fs_path, archived columns to nodes.
|
||||
const migration012 = `
|
||||
ALTER TABLE nodes ADD COLUMN template_id TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE nodes ADD COLUMN fs_path TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE nodes ADD COLUMN archived INTEGER NOT NULL DEFAULT 0;
|
||||
`
|
||||
@@ -68,6 +68,7 @@ var migrationFiles = map[int]string{
|
||||
9: migration009,
|
||||
10: migration010,
|
||||
11: migration011,
|
||||
12: migration012,
|
||||
}
|
||||
|
||||
func (db *DB) runInitialSchema() error {
|
||||
|
||||
Reference in New Issue
Block a user