mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 01:39:51 +08:00
- Promote "Answer now" to a universal escape hatch via answer_now_context; orchestrator re-routes any capability to chat._stage_answer_now. - Co-Writer: draggable split + persistent ratio + line-anchored bidirectional scroll sync using a hidden mirror for wrap-aware editor y. - SaveToNotebookModal: optional message-selection mode with quick presets; rebuild transcript / userQuery from the selected subset. - Adopt the real notebook API (/api/v1/notebook/*) across Knowledge tab, guide notebook picker, and save-to-notebook flow; new typed helpers in web/lib/notebook-api.ts (listNotebooks/getNotebook/createNotebook/...). - Extract CollapsibleConfigSection; unify Quiz / Math Animator / Visualize / Deep Research panels behind one collapsed-summary header. - Replace streaming spinner with a dedicated Stop button; persistent composer header; mask-gradient on messages container. - TutorBotManager: public load/save/merge API; atomic write via temp + Path.replace; merge_bot_config with explicit-clear semantics; new tests/services/tutorbot/test_manager_config.py. - MarkdownRenderer: trackSourceLines passes data-source-line through; RichCodeBlock skips Prism for unlabeled/plaintext fences; mermaid detection includes flow/seq/sequence editor.md fences. - UI/theme: deeper foregrounds + warmer borders for light/Snow themes; /guide migrated off hardcoded slate/indigo to design tokens; HistorySessionPicker themed and timestamp-seconds bug fixed. - Filter system messages out of UnifiedChatContext.hydrateMessages and ChatMessageList so backend grounding context never renders as a bubble. - Bug fixes (already merged earlier in dev): * tutorbot config wipe on restart (#332) * selective_access_log middleware unpack crash (#334/#335) * 15 npm security vulnerabilities — jspdf/next/mermaid (#330) - Drive-by: remove "// README" typo from .env.example_CN. - Add v1.1.1 release notes and update README. Made-with: Cursor
76 lines
2.2 KiB
TypeScript
76 lines
2.2 KiB
TypeScript
"use client";
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
import {
|
|
summarizeMathAnimatorConfig,
|
|
type MathAnimatorFormConfig,
|
|
} from "@/lib/math-animator-types";
|
|
import {
|
|
CollapsibleConfigSection,
|
|
Field,
|
|
INPUT_CLS,
|
|
} from "@/components/chat/home/composer-field";
|
|
|
|
interface MathAnimatorConfigPanelProps {
|
|
value: MathAnimatorFormConfig;
|
|
onChange: (next: MathAnimatorFormConfig) => void;
|
|
collapsed: boolean;
|
|
onToggleCollapsed: () => void;
|
|
}
|
|
|
|
export default function MathAnimatorConfigPanel({
|
|
value,
|
|
onChange,
|
|
collapsed,
|
|
onToggleCollapsed,
|
|
}: MathAnimatorConfigPanelProps) {
|
|
const { t } = useTranslation();
|
|
const update = <K extends keyof MathAnimatorFormConfig>(
|
|
key: K,
|
|
val: MathAnimatorFormConfig[K],
|
|
) => onChange({ ...value, [key]: val });
|
|
|
|
return (
|
|
<CollapsibleConfigSection
|
|
collapsed={collapsed}
|
|
summary={summarizeMathAnimatorConfig(value)}
|
|
onToggleCollapsed={onToggleCollapsed}
|
|
bodyClassName="flex flex-wrap items-end gap-x-3 gap-y-2 px-3.5 pb-2.5"
|
|
>
|
|
<Field label="Output" width="w-[100px]">
|
|
<select
|
|
value={value.output_mode}
|
|
onChange={(e) => update("output_mode", e.target.value as MathAnimatorFormConfig["output_mode"])}
|
|
className={`${INPUT_CLS} w-full`}
|
|
>
|
|
<option value="video">{t("Video")}</option>
|
|
<option value="image">{t("Image")}</option>
|
|
</select>
|
|
</Field>
|
|
|
|
<Field label="Quality" width="w-[100px]">
|
|
<select
|
|
value={value.quality}
|
|
onChange={(e) => update("quality", e.target.value as MathAnimatorFormConfig["quality"])}
|
|
className={`${INPUT_CLS} w-full`}
|
|
>
|
|
<option value="low">{t("Low")}</option>
|
|
<option value="medium">{t("Medium")}</option>
|
|
<option value="high">{t("High")}</option>
|
|
</select>
|
|
</Field>
|
|
|
|
<Field label="Style Hint" width="min-w-[160px] flex-1">
|
|
<input
|
|
type="text"
|
|
value={value.style_hint}
|
|
onChange={(e) => update("style_hint", e.target.value)}
|
|
placeholder={t("Style, pacing, color...")}
|
|
className={`${INPUT_CLS} w-full`}
|
|
/>
|
|
</Field>
|
|
</CollapsibleConfigSection>
|
|
);
|
|
}
|
|
|