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/DeckCardsPage.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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

diff --git a/src/client/pages/DeckCardsPage.tsx b/src/client/pages/DeckCardsPage.tsx
index 8c839da..b791eac 100644
--- a/src/client/pages/DeckCardsPage.tsx
+++ b/src/client/pages/DeckCardsPage.tsx
@@ -22,7 +22,12 @@ import {
 } from "react";
 import { useDebouncedCallback } from "use-debounce";
 import { Link, useParams } from "wouter";
-import { type Card, cardsByDeckAtomFamily, deckByIdAtomFamily } from "../atoms";
+import {
+	type Card,
+	cardsByDeckAtomFamily,
+	type Deck,
+	deckByIdAtomFamily,
+} from "../atoms";
 import { CreateNoteModal } from "../components/CreateNoteModal";
 import { DeleteCardModal } from "../components/DeleteCardModal";
 import { DeleteNoteModal } from "../components/DeleteNoteModal";
@@ -638,6 +643,9 @@ export function DeckCardsPage() {
 			<CreateNoteModal
 				isOpen={isCreateModalOpen}
 				deckId={deckId}
+				defaultNoteTypeId={
+					queryClient.getQueryData<Deck>(["decks", deckId])?.defaultNoteTypeId
+				}
 				onClose={() => setIsCreateModalOpen(false)}
 				onNoteCreated={handleCardMutation}
 			/>
-- 
cgit v1.3-1-g0d28

