ArkHost/HelixNotes
14
150
Fork
You've already forked HelixNotes
13

Fix custom theme not applied on startup (light-theme dividers) #200

Merged
ArkHost merged 1 commit from MaZy/HelixNotes:fix/custom-theme-startup-race into main 2026年07月03日 13:34:12 +02:00
Contributor
Copy link

Launching with a custom dark theme left every divider in light-theme colors until you re-toggled the theme in Settings.

applyTheme was copy-pasted across the components and the copies drifted. Three of them (+page.svelte's onMount block, AppLayout.svelte, NoteWindow.svelte) had no custom-* branch, so for a custom theme they stripped the dark class and data-theme attribute, matched nothing, and fell back to the bare light :root values.

+layout.svelte applied the custom theme correctly, but AppLayout — the always-mounted shell — re-runs its own broken copy from an $effect on $theme, immediately wiping it out. Dividers gave it away because custom themes override --border-color but not --border-light, which dividers use.

Fix: consolidate into a single applyTheme(which already owns darkThemes/isDarkTheme) with a real custom-* branch, and have every call site use it and pass the loaded custom themes so custom-* ids resolve.

Launching with a custom dark theme left every divider in light-theme colors until you re-toggled the theme in Settings. `applyTheme` was copy-pasted across the components and the copies drifted. Three of them (+page.svelte's onMount block, AppLayout.svelte, NoteWindow.svelte) had no custom-* branch, so for a custom theme they stripped the dark class and data-theme attribute, matched nothing, and fell back to the bare light :root values. `+layout.svelte` applied the custom theme correctly, but `AppLayout` — the always-mounted shell — re-runs its own broken copy from an `$effect` on `$theme`, immediately wiping it out. Dividers gave it away because custom themes override `--border-color` but not `--border-light`, which dividers use. Fix: consolidate into a single `applyTheme`(which already owns darkThemes/isDarkTheme) with a real `custom-*` branch, and have every call site use it and pass the loaded custom themes so `custom-*` ids resolve.

Thank you!

Thank you!
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ArkHost/HelixNotes!200
Reference in a new issue
ArkHost/HelixNotes
No description provided.
Delete branch "MaZy/HelixNotes:fix/custom-theme-startup-race"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?