State Management
The application relies exclusively on Svelte 5 runes ($state, $derived, $effect) for reactivity, replacing all legacy Svelte stores.
Svelte Runes
State is encapsulated in singleton classes or closures exported from src/lib/state/.
issuesStore.svelte.ts: Holds the normalized Map of all issues.configStore.svelte.ts: Holds user preferences (theme, view mode).modeStore.svelte.ts: Tracks whether the user is in Local or Remote edit mode.
Commit Queue
To avoid rate-limiting GitHub's API during rapid typing, all I/O mutations are routed through a Debounced Commit Queue.
Performance
The Commit Queue groups multiple edits to the same file within a 2-second window into a single Git commit.
Optimistic Updates
When a user edits an issue:
- The UI calls
issuesStore.updateIssue(id, payload). - The store updates the rune immediately. The UI re-renders synchronously.
- The store pushes a
WriteTaskinto the Commit Queue. - If the remote write fails, the Commit Queue triggers a rollback in the
issuesStoreand shows a toast error.