feat(reader): implement FEAT-01 Focus Zen Mode (100% vh/vw, auto-hiding HUD, hotkeys F/Esc, native fullscreen)
This commit is contained in:
@@ -331,6 +331,8 @@ def _migrate(conn: sqlite3.Connection):
|
||||
title TEXT NOT NULL,
|
||||
subtitle TEXT DEFAULT '',
|
||||
golden_formula TEXT NOT NULL,
|
||||
cheatsheet_table TEXT DEFAULT '',
|
||||
detailed_notes TEXT DEFAULT '',
|
||||
contrast_explanation_json TEXT NOT NULL,
|
||||
journaling_prompt TEXT NOT NULL,
|
||||
exercises_json TEXT NOT NULL,
|
||||
@@ -340,6 +342,18 @@ def _migrate(conn: sqlite3.Connection):
|
||||
conn.execute("CREATE INDEX IF NOT EXISTS idx_grammar_units_num ON grammar_units(unit_num);")
|
||||
conn.execute("CREATE INDEX IF NOT EXISTS idx_grammar_units_level ON grammar_units(level);")
|
||||
|
||||
# Safe migration: add cheatsheet_table and detailed_notes columns if not present
|
||||
existing_grammar_cols = {
|
||||
row[1] for row in conn.execute("PRAGMA table_info(grammar_units)").fetchall()
|
||||
}
|
||||
grammar_migrations = [
|
||||
("cheatsheet_table", "TEXT DEFAULT ''"),
|
||||
("detailed_notes", "TEXT DEFAULT ''"),
|
||||
]
|
||||
for col, definition in grammar_migrations:
|
||||
if col not in existing_grammar_cols:
|
||||
conn.execute(f"ALTER TABLE grammar_units ADD COLUMN {col} {definition}")
|
||||
|
||||
conn.execute("""
|
||||
CREATE TABLE IF NOT EXISTS grammar_progress (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
||||
Reference in New Issue
Block a user