mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 07:10:15 +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
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
import {
|
|
summarizeVisualizeConfig,
|
|
type VisualizeFormConfig,
|
|
} from "@/lib/visualize-types";
|
|
import {
|
|
CollapsibleConfigSection,
|
|
Field,
|
|
INPUT_CLS,
|
|
} from "@/components/chat/home/composer-field";
|
|
|
|
interface VisualizeConfigPanelProps {
|
|
value: VisualizeFormConfig;
|
|
onChange: (next: VisualizeFormConfig) => void;
|
|
collapsed: boolean;
|
|
onToggleCollapsed: () => void;
|
|
}
|
|
|
|
export default function VisualizeConfigPanel({
|
|
value,
|
|
onChange,
|
|
collapsed,
|
|
onToggleCollapsed,
|
|
}: VisualizeConfigPanelProps) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<CollapsibleConfigSection
|
|
collapsed={collapsed}
|
|
summary={summarizeVisualizeConfig(value)}
|
|
onToggleCollapsed={onToggleCollapsed}
|
|
bodyClassName="flex flex-wrap items-end gap-x-3 gap-y-2 px-3.5 pb-2.5"
|
|
>
|
|
<Field label="Render Mode" width="w-[120px]">
|
|
<select
|
|
value={value.render_mode}
|
|
onChange={(e) =>
|
|
onChange({ ...value, render_mode: e.target.value as VisualizeFormConfig["render_mode"] })
|
|
}
|
|
className={`${INPUT_CLS} w-full`}
|
|
>
|
|
<option value="auto">{t("Auto")}</option>
|
|
<option value="chartjs">{t("Chart.js")}</option>
|
|
<option value="svg">{t("SVG")}</option>
|
|
<option value="mermaid">{t("Mermaid")}</option>
|
|
</select>
|
|
</Field>
|
|
</CollapsibleConfigSection>
|
|
);
|
|
}
|