fix: resolve all QA/UAT report issues (P0-P3)
Made-with: Cursor
This commit is contained in:
@@ -482,12 +482,21 @@ export default function GenerationPage() {
|
||||
<Select><SelectTrigger className="h-8 text-xs"><SelectValue placeholder="Passage Difficulty (Optional)" /></SelectTrigger>
|
||||
<SelectContent>{CEFR_LEVELS.map((l) => <SelectItem key={l} value={l}>{l}</SelectItem>)}</SelectContent>
|
||||
</Select>
|
||||
<Input placeholder="Topic (Optional)" className="h-8 text-xs" id={`topic-${pi}`} />
|
||||
<Input placeholder="Approximate Word Count (Optional)" className="h-8 text-xs" type="number" id={`wc-${pi}`} />
|
||||
<Input placeholder="Topic (Optional)" className="h-8 text-xs"
|
||||
value={passage.category || ""}
|
||||
onChange={(e) => {
|
||||
const p = [...st.passages]; p[pi] = { ...p[pi], category: e.target.value };
|
||||
updateModuleState("reading", { passages: p });
|
||||
}} />
|
||||
<Input placeholder="Approximate Word Count (Optional)" className="h-8 text-xs" type="number"
|
||||
value={passage.divider || ""}
|
||||
onChange={(e) => {
|
||||
const p = [...st.passages]; p[pi] = { ...p[pi], divider: e.target.value };
|
||||
updateModuleState("reading", { passages: p });
|
||||
}} />
|
||||
<Button size="sm" className="w-full text-xs" disabled={generatePassageMut.isPending}
|
||||
onClick={() => {
|
||||
const topicEl = document.getElementById(`topic-${pi}`) as HTMLInputElement;
|
||||
generatePassageMut.mutate({ index: pi, topic: topicEl?.value || "", difficulty: st.difficulty[0] || "B2", wordCount: 300 });
|
||||
generatePassageMut.mutate({ index: pi, topic: passage.category || "", difficulty: st.difficulty[0] || "B2", wordCount: Number(passage.divider) || 300 });
|
||||
}}>
|
||||
{generatePassageMut.isPending ? <Loader2 className="h-3 w-3 mr-1 animate-spin" /> : <Sparkles className="h-3 w-3 mr-1" />}
|
||||
Generate
|
||||
@@ -588,11 +597,15 @@ export default function GenerationPage() {
|
||||
Audio Context <ChevronDown className="h-3 w-3" />
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent className="pt-2 space-y-2">
|
||||
<Input placeholder="Topic" className="h-8 text-xs" id={`ltopic-${si}`} />
|
||||
<Input placeholder="Topic" className="h-8 text-xs"
|
||||
value={sec.category || ""}
|
||||
onChange={(e) => {
|
||||
const sections = [...st.listeningSections]; sections[si] = { ...sections[si], category: e.target.value };
|
||||
updateModuleState("listening", { listeningSections: sections });
|
||||
}} />
|
||||
<div className="flex gap-2">
|
||||
<Button size="sm" className="flex-1 text-xs" onClick={() => {
|
||||
const topicEl = document.getElementById(`ltopic-${si}`) as HTMLInputElement;
|
||||
generationService.generateListeningContext({ topic: topicEl?.value || "general conversation", section_type: sec.type })
|
||||
generationService.generateListeningContext({ topic: sec.category || "general conversation", section_type: sec.type })
|
||||
.then((res) => {
|
||||
const r = res as Record<string, unknown>;
|
||||
const sections = [...st.listeningSections];
|
||||
@@ -694,14 +707,18 @@ export default function GenerationPage() {
|
||||
Generate Instructions <ChevronDown className="h-3 w-3" />
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent className="pt-2 space-y-2">
|
||||
<Input placeholder="Topic" className="h-8 text-xs" id={`wtopic-${ti}`} />
|
||||
<Input placeholder="Topic" className="h-8 text-xs"
|
||||
value={task.category || ""}
|
||||
onChange={(e) => {
|
||||
const tasks = [...st.writingTasks]; tasks[ti] = { ...tasks[ti], category: e.target.value };
|
||||
updateModuleState("writing", { writingTasks: tasks });
|
||||
}} />
|
||||
<Select><SelectTrigger className="h-8 text-xs"><SelectValue placeholder="Difficulty (Optional)" /></SelectTrigger>
|
||||
<SelectContent>{CEFR_LEVELS.map((l) => <SelectItem key={l} value={l}>{l}</SelectItem>)}</SelectContent>
|
||||
</Select>
|
||||
<Button size="sm" className="w-full text-xs" disabled={generateWritingMut.isPending}
|
||||
onClick={() => {
|
||||
const topicEl = document.getElementById(`wtopic-${ti}`) as HTMLInputElement;
|
||||
generateWritingMut.mutate({ topic: topicEl?.value || "general", difficulty: st.difficulty[0] || "A1", taskIndex: ti });
|
||||
generateWritingMut.mutate({ topic: task.category || "general", difficulty: st.difficulty[0] || "A1", taskIndex: ti });
|
||||
}}>
|
||||
{generateWritingMut.isPending ? <Loader2 className="h-3 w-3 mr-1 animate-spin" /> : <Sparkles className="h-3 w-3 mr-1" />}
|
||||
Generate
|
||||
|
||||
Reference in New Issue
Block a user