From 38b8fc0e9927c4146b4c8b309b2bcc644abd63d0 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Wed, 25 Feb 2026 23:02:35 +0900
Subject: feat(decks): add default note type setting per deck

Allow each deck to specify a default note type that is auto-selected
when creating new notes. Includes DB schema migration, server API
updates, sync layer support, and UI for editing the default in the
deck settings modal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---
 src/client/pages/DeckDetailPage.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/client/pages/DeckDetailPage.tsx')

diff --git a/src/client/pages/DeckDetailPage.tsx b/src/client/pages/DeckDetailPage.tsx
index 0a02051..99e919b 100644
--- a/src/client/pages/DeckDetailPage.tsx
+++ b/src/client/pages/DeckDetailPage.tsx
@@ -8,7 +8,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { useAtomValue } from "jotai";
 import { Suspense, useState } from "react";
 import { Link, useParams } from "wouter";
-import { cardsByDeckAtomFamily, deckByIdAtomFamily } from "../atoms";
+import { cardsByDeckAtomFamily, type Deck, deckByIdAtomFamily } from "../atoms";
 import { CreateNoteModal } from "../components/CreateNoteModal";
 import { ErrorBoundary } from "../components/ErrorBoundary";
 import { LoadingSpinner } from "../components/LoadingSpinner";
@@ -204,6 +204,9 @@ export function DeckDetailPage() {
 			<CreateNoteModal
 				isOpen={isCreateModalOpen}
 				deckId={deckId}
+				defaultNoteTypeId={
+					queryClient.getQueryData<Deck>(["decks", deckId])?.defaultNoteTypeId
+				}
 				onClose={() => setIsCreateModalOpen(false)}
 				onNoteCreated={() => {
 					queryClient.invalidateQueries({
-- 
cgit v1.3-1-g0d28

