feat(vacay): read-only calendar sharing (#444, #667) (#1637)

* feat(vacay): read-only calendar shares on the server (#444, #667)

* feat(vacay): shared calendars card and ring overlay on desktop

* feat(vacay): share sheet and calendar rings on mobile

* test(vacay): cover the calendar share flows

* docs(vacay): document read-only calendar sharing
This commit is contained in:
Maurice
2026-07-21 13:46:38 +02:00
committed by GitHub
parent 7528706d00
commit 31f6ec1f47
129 changed files with 2593 additions and 97 deletions
+18
View File
@@ -3709,6 +3709,24 @@ function runMigrations(db: Database.Database): void {
const hasFraction = db.prepare("SELECT 1 FROM pragma_table_info('vacay_entries') WHERE name = 'fraction'").get();
if (!hasFraction) db.exec('ALTER TABLE vacay_entries ADD COLUMN fraction REAL NOT NULL DEFAULT 1');
},
// Read-only vacay calendar sharing (#444/#667): a user can let other users
// view their vacation calendar without fusing plans. owner_id is the sharing
// user, user_id the viewer; hidden lets the viewer hide the overlay without
// removing the share. Follows the person, not the plan, so it survives
// fusion and dissolution.
() => {
db.exec(`
CREATE TABLE IF NOT EXISTS vacay_shares (
id INTEGER PRIMARY KEY AUTOINCREMENT,
owner_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
hidden INTEGER NOT NULL DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
UNIQUE (owner_id, user_id)
);
`);
db.exec('CREATE INDEX IF NOT EXISTS idx_vacay_shares_user ON vacay_shares (user_id);');
},
];
if (currentVersion < migrations.length) {