ulysses/static/js
Logan Davis ad82ee1c83
feat(calendar): support multiple CalDAV accounts (#2942)
* feat(calendar): support multiple CalDAV accounts

Replaces the single CalDAV credential slot with a named account list so
users can sync both a personal and work calendar simultaneously.

- Add `account_id` column to `CalendarCal` + startup migration
- `_load_caldav_accounts()` in caldav_sync.py reads `caldav_accounts`
  list from prefs, auto-migrating the legacy single `caldav` key on
  first use (no user action required)
- `sync_caldav()` iterates all accounts and aggregates counts/errors
- `writeback_event()` resolves credentials via `CalendarCal.account_id`,
  falling back to the first account for legacy rows
- New REST endpoints: GET/POST/PUT/DELETE `/api/calendar/config/accounts`
- Legacy GET/POST `/api/calendar/config` preserved for backward compat
- Settings UI: one card per account with Label, URL, Username, Password
  fields; Test button works for both unsaved (inline creds) and saved
  (by account_id) accounts; delete removes only that account
- Update test_caldav_url_hardening.py mock to include `_save_for_user`
  and updated `_sync_blocking` signature

* fix(calendar): restore #2765 PK scoping and #2819 writeback URL validation

Two regressions introduced by the multi-account refactor:

1. PK collision (#2765): _stable_cal_id was back to hashing only the URL,
   so two users — or one user with two accounts on the same server — would
   collide on the primary key. Restore owner+account_id in the hash key
   (format: "{owner}\n{account_id}\n{url}") and thread both values through
   _sync_blocking → _writeback_blocking → push_event → find_remote_calendar
   so the hash round-trips correctly on write-back.

2. URL validation dropped (#2819): _load_caldav_accounts imported
   _save_for_user at function scope, causing an ImportError on test mocks
   that only provide _load_for_user, which prevented writeback_event from
   reaching the validate_caldav_url call. Move the import inside the
   migration branch and wrap in try/except (best-effort save; next call
   re-migrates from the still-present legacy key).

Update fake_writeback_blocking in test_caldav_writeback.py to accept the
new owner/account_id optional params.
2026-06-05 20:32:50 +02:00
..
calendar Ignore non-string calendar date inputs (#1649) 2026-06-03 14:16:58 +09:00
color fix: theme color parsing breaks on #rgb shorthand hex (#1213) 2026-06-03 00:30:03 +09:00
compare Isolate HTML popup openers (#2501) 2026-06-04 20:52:41 +02:00
editor fix: computeSnap throws when ctx.otherLayers is not an array (#1716) 2026-06-03 13:34:25 +09:00
emailLibrary Harden email HTML URL sanitization (#2496) 2026-06-04 20:47:47 +02:00
markdown Ignore non-string markdown table rows (#1648) 2026-06-03 14:17:02 +09:00
model fix: model cost/info matches first substring key (gpt-4o-mini billed as gpt-4o) (#1439) 2026-06-04 03:05:37 +01:00
research Whitelist research source links (#2499) 2026-06-04 20:41:35 +02:00
util fix: monthly schedule label shows 21th/22th/31th (ordinal suffix for days >20) (#1577) 2026-06-03 08:57:47 +09:00
a11y.js Improve accessibility across core flows (#86) 2026-06-01 22:04:00 +02:00
admin.js fix(auth): distinguish empty model allowlists (#2938) 2026-06-05 20:27:10 +02:00
assistant.js Rename Character copy to Persona 2026-06-02 12:42:15 +09:00
calendar.js Calendar: cross-session delete sync — 404 = success, refetch on tab focus 2026-06-05 17:05:04 +09:00
censor.js Ignore censor preference storage errors (#1652) 2026-06-03 14:16:55 +09:00
chat.js feat: Add plan mode to the chat agent (#638) 2026-06-05 16:32:25 +02:00
chatRenderer.js fix: prevent document link click from resetting active session (#2055) 2026-06-05 15:05:30 +02:00
chatStream.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
codeRunner.js Fix/windows llama cpp serve and test upstream (#2669) 2026-06-05 14:53:33 +02:00
colorPicker.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
cookbook-diagnosis.js Fix Windows Cookbook background tasks, exit statuses, and empty SSH logs wrapper (#1389) 2026-06-05 14:41:07 +02:00
cookbook-hwfit.js Fix/windows llama cpp serve and test upstream (#2669) 2026-06-05 14:53:33 +02:00
cookbook.js Fix Windows Cookbook background tasks, exit statuses, and empty SSH logs wrapper (#1389) 2026-06-05 14:41:07 +02:00
cookbookDownload.js Cookbook polish: auto-reconnect, ctx slider fixes, scoring, lots of UI 2026-06-03 20:25:25 +09:00
cookbookProgressSignal.js Don't falsely declare a dependency build stale (#1568) (#1768) 2026-06-03 13:23:35 +09:00
cookbookRunning.js Fix/windows llama cpp serve and test upstream (#2669) 2026-06-05 14:53:33 +02:00
cookbookSchedule.js Cookbook scheduler + serve: schedule via Tasks, Stop verifies kill, Ollama auto port-pick 2026-06-05 14:41:43 +09:00
cookbookServe.js Fix/windows llama cpp serve and test upstream (#2669) 2026-06-05 14:53:33 +02:00
document.js fix: prevent document link click from resetting active session (#2055) 2026-06-05 15:05:30 +02:00
documentLibrary.js Settings polish: /setup provider subs, Add API defaults to api kind, picker shows offline endpoints, doc library tracks sub-tab 2026-06-05 14:41:54 +09:00
dragSort.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
emailInbox.js fix: reply-all Cc's the user's own other addresses (multi-account) (#672) 2026-06-02 11:42:20 +09:00
emailLibrary.js fix: guard sp.destroy() in _loadScheduled against null spinner (#1495) 2026-06-03 08:12:47 +09:00
emojiPicker.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
emojiShortcodes.js Render emoji shortcodes as icons in chat (#345) (#629) 2026-06-05 02:28:42 +02:00
escMenuStack.js fix: make transient dropdown/popup menus close on Escape 2026-06-01 14:23:22 -04:00
fileHandler.js feat(ui): allow expanding consolidated file chip regardless of count (#1849) (#2086) 2026-06-04 14:02:52 +01:00
gallery.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
galleryEditor.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
group.js Harden chat streaming DOM sinks (#2498) 2026-06-04 20:49:37 +02:00
init.js fix(ui): keep minimized windows above composer (#1197) 2026-06-02 23:31:09 +09:00
keyboard-shortcuts.js Ignore AltGr keystrokes in Ctrl+Alt keyboard shortcuts (#825) 2026-06-02 11:12:54 +09:00
langIcons.js fix: langIcon throws on an explicit null opts argument (#1740) 2026-06-03 13:29:21 +09:00
markdown.js feat: Add plan mode to the chat agent (#638) 2026-06-05 16:32:25 +02:00
memory.js fix(memory): let manual add specify memory category 2026-06-05 13:17:14 +07:00
modalManager.js feat: Claude Agent integration + cookbook reconnect + UI polish 2026-06-04 08:27:26 +09:00
modalSnap.js Improve edge-docked window behavior (#2779) 2026-06-05 17:07:08 +02:00
modelPicker.js Settings polish: /setup provider subs, Add API defaults to api kind, picker shows offline endpoints, doc library tracks sub-tab 2026-06-05 14:41:54 +09:00
models.js fix(models): stabilize proxy endpoint refresh behavior 2026-06-04 04:56:11 +01:00
modelSort.js Ignore invalid model sort inputs (#1653) 2026-06-03 14:16:52 +09:00
MODULE_SUMMARY.md docs: fix stale documentation references (#1769) 2026-06-03 13:23:21 +09:00
notes.js fix(notes): track + remove the select-mode Esc keydown listener so it doesn't leak per open (#2792) 2026-06-05 16:25:05 +02:00
package.json Fix test suite: ESM module loading and stub isolation (#844) 2026-06-02 11:29:29 +09:00
planWindow.js feat: Add plan mode to the chat agent (#638) 2026-06-05 16:32:25 +02:00
platform.js Ignore AltGr keystrokes in Ctrl+Alt keyboard shortcuts (#825) 2026-06-02 11:12:54 +09:00
presets.js Keep presets loading with bad local state (#1417) 2026-06-03 04:09:28 +09:00
providers.js Show the serving provider in the model-info card (#2185) 2026-06-04 18:22:31 +02:00
rag.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
researchSynapse.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
search-chat.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
search.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
section-management.js Fix Models section collapse dead pause and missing animation 2026-06-01 16:53:46 +02:00
sessions.js fix: prevent document link click from resetting active session (#2055) 2026-06-05 15:05:30 +02:00
settings.js feat(calendar): support multiple CalDAV accounts (#2942) 2026-06-05 20:32:50 +02:00
sidebar-layout.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
signature.js Constrain signature uploads to PNG data (#2844) 2026-06-05 13:17:43 +02:00
skills.js feat(skills): import SKILL.md bundles from public GitHub URLs (#2576) 2026-06-05 19:48:23 +02:00
slashAutocomplete.js Cookbook: scoring fixes, UI polish, false-finished + stale-state bug fixes 2026-06-03 16:32:20 +09:00
slashCommands.js feat: Add plan mode to the chat agent (#638) 2026-06-05 16:32:25 +02:00
spinner.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
storage.js feat: Add plan mode to the chat agent (#638) 2026-06-05 16:32:25 +02:00
tasks.js Cookbook scheduler + serve: schedule via Tasks, Stop verifies kill, Ollama auto port-pick 2026-06-05 14:41:43 +09:00
theme.js fix: theme color parsing breaks on #rgb shorthand hex (#1213) 2026-06-03 00:30:03 +09:00
tileManager.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
tourAutoplay.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
tourHints.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
tts-ai.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
ui.js Revert "fix(ui): allow manual prompt bar resize (#1201)" 2026-06-03 23:03:58 +09:00
voiceRecorder.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
windowDrag.js Improve edge-docked window behavior (#2779) 2026-06-05 17:07:08 +02:00
windowResize.js Make tool windows resizable by dragging edges or corners 2026-06-01 19:49:23 +02:00
workspace.js feat: Add workspace: confine agent tools to a folder (#1103) 2026-06-05 00:06:37 +02:00