Files
DeepTutor/web/components/visualize/VisualizeConfigPanel.tsx
Bingxi Zhao (Frank) 2745e8bde9 feat(book): introduce book capability and restructure guide/co_writer modules
- Add new `deeptutor/book/` module with multi-agent pipeline
  (ideation, spine, page planner, source explorer, synthesizer)
  and rich block system (text, code, figure, quiz, flash cards,
  callout, deep dive, timeline, animation, concept graph, etc.)
- Add `/api/routers/book.py` and `deeptutor_cli/book.py` entry points
- Add web UI under `web/app/(workspace)/book/` with sidebar,
  chat panel, page reader, spine editor, progress timeline, and
  block renderers
- Move `deeptutor/agents/co_writer` -> `deeptutor/co_writer` and
  `deeptutor/agents/guide` -> `deeptutor/guide` (then remove guide
  entirely now superseded by book)
- Remove legacy guide UI, hooks, types, and API router
- Update visualize agents/prompts, notebook service, prompt manager,
  session turn runtime, and shared services to support new flows
- Refresh chat composer, sidebar, notebook selector, and locales

Made-with: Cursor
2026-04-20 00:33:33 +08:00

54 lines
1.5 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>
<option value="html">{t("HTML")}</option>
</select>
</Field>
</CollapsibleConfigSection>
);
}