From e726e760c27d4e214b16536d8025dc4ee97ff894 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?=
<80620802+burakboduroglu@users.noreply.github.com>
Date: Sat, 19 Sep 2026 21:27:01 +0300
Subject: [PATCH] =?UTF-8?q?style:=20=F0=9F=92=84=20exam=20question=20panel?=
=?UTF-8?q?=20and=20flush=20table=20headers=20-=20exam=20"add/edit=20quest?=
=?UTF-8?q?ion"=20opens=20in=20the=20wide=20side=20panel=20instead=20of=20?=
=?UTF-8?q?a=20centred=20=20=20dialog=20whose=20footer=20covered=20the=20s?=
=?UTF-8?q?crolling=20form=20-=20form=20footer=20reaches=20over=20the=20pa?=
=?UTF-8?q?nel's=20bottom=20padding,=20right-aligned=20actions,=20=20=20an?=
=?UTF-8?q?d=20a=20hint=20that=20tapping=20a=20letter=20marks=20the=20corr?=
=?UTF-8?q?ect=20answer=20-=20sectioned=20DataTable=20frame=20drops=20its?=
=?UTF-8?q?=20inner=20padding,=20so=20the=20header=20row=20sits=20=20=20fl?=
=?UTF-8?q?ush=20on=20the=20card=20edge=20and=20the=20sticky=20header=20no?=
=?UTF-8?q?=20longer=20lets=20rows=20show=20above=20it=20-=20includes=20th?=
=?UTF-8?q?e=20i18n=20keys=20for=20the=20question=20generator=20that=20fol?=
=?UTF-8?q?lows?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/exams/exam-questions-panel.tsx | 22 +++++++++-----
src/components/exams/question-form.tsx | 28 +++++++++++-------
src/components/ui/data-table.tsx | 6 +++-
src/i18n/locales/en.ts | 29 ++++++++++++++++++-
src/i18n/locales/tr.ts | 29 ++++++++++++++++++-
src/i18n/messages.ts | 27 +++++++++++++++++
6 files changed, 120 insertions(+), 21 deletions(-)
diff --git a/src/components/exams/exam-questions-panel.tsx b/src/components/exams/exam-questions-panel.tsx
index 51d7946..5c476a6 100644
--- a/src/components/exams/exam-questions-panel.tsx
+++ b/src/components/exams/exam-questions-panel.tsx
@@ -19,7 +19,6 @@ import { Alert } from "@/components/ui/alert";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { ConfirmDialog } from "@/components/ui/confirm-dialog";
-import { FormDialog } from "@/components/ui/form-dialog";
import { SidePanel } from "@/components/ui/side-panel";
import { BankQuestionPicker } from "@/components/exams/bank-question-picker";
import { QuestionForm, type QuestionValues } from "@/components/exams/question-form";
@@ -290,16 +289,23 @@ export function ExamQuestionsPanel(props: {
/>
-
{error()}
} diff --git a/src/components/exams/question-form.tsx b/src/components/exams/question-form.tsx index f50a7c0..156bb0d 100644 --- a/src/components/exams/question-form.tsx +++ b/src/components/exams/question-form.tsx @@ -58,6 +58,8 @@ export type QuestionFormInitial = { export function QuestionForm(props: { initial?: QuestionFormInitial; + /** Starting text/kind for a new question (an AI-generated draft); ignored when `initial` is set. */ + draft?: { text: string; kind: QuestionKind }; subjects: Subject[]; /** True while `subjects` is still loading, so a missing subject is not misreported. */ subjectsPending?: boolean; @@ -72,10 +74,10 @@ export function QuestionForm(props: { }) { const t = useT(); let textAreaRef: HTMLTextAreaElement | undefined; - const [text, setText] = createSignal(props.initial?.text ?? ""); + const [text, setText] = createSignal(props.initial?.text ?? props.draft?.text ?? ""); // No first-subject default: the subject is submitted, so the user picks it. const [subjectId, setSubjectId] = createSignal(props.initial?.subject ?? ""); - const [kind, setKind] = createSignal{t("questions.correctHint")}
+