Capture-phase keydown to override parent shortcuts: do not
Trying to re-bind a global keyboard shortcut at the page level when a parent layout already owns it
In a SvelteKit (or any nested-component) app where a parent layout registers a window keydown listener for global shortcuts like n/g/t, the temptation when a child page wants to reuse one of those keys is to attach a capture-phase listener on window with stopImmediatePropagation. This should work — capture runs before bubble, your handler stops propagation only for the key you handle, others bubble through normally. In practice it broke unrelated shortcuts (/ for search stopped working) and seemed to cause hydration weirdness on client-side nav. Theory: capture-phase on window combined with SvelteKit hydration timing creates subtle conflicts that are not worth debugging. The pragmatic fix is to just pick a different key for the page-level action (c for create instead of n) and stay in the regular bubble phase — the design fidelity loss is small, and global shortcuts keep working everywhere.
When a page wants a shortcut the layout already claims, do not try to override it with capture-phase tricks — pick a different unused key and document the mapping. Also: wrap any side-effecting load-function calls (vault writes, git commits, etc.) in try-catch so a transient failure does not blank the page on nav.