Files
AIclinicalresearch/frontend-v2/src/modules/ssa/index.tsx
HaHafeng 740ef8b526 fix(ssa): Fix Agent mode chat leaking plan/result details + navigation reset
Backend (ChatHandlerService):
- Replace LLM-generated hints with fixed-text hints for plan/code/result steps
  to prevent SystemPrompt intent instruction conflict causing verbose chat output
- Add sendFixedHint() helper for deterministic SSE text delivery (no LLM call)
- Cancel old plan_pending/code_pending executions when regenerating plan
- Eliminates 3 unnecessary LLM calls per analysis cycle (faster response)

Frontend (SSAModule):
- Use location.key as useEffect dependency to ensure store reset on every
  navigation (fixes stale session when re-entering from other modules)
- TopNavigation uses replace:true for active module re-click to avoid
  browser history clutter

Tested: Agent mode plan/code/result hints now show brief fixed text in chat,
detailed content exclusively in right workspace panel

Made-with: Cursor
2026-03-09 08:38:02 +08:00

30 lines
876 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* SSA 智能统计分析模块主入口
*
* V11 版本 - 100% 还原原型图设计
* - 左侧抽屉栏(可展开/收起)
* - 中间对话区(居中布局 max-w-3xl
* - 右侧工作区(动态 60% 宽度)
*/
import React, { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import { useSSAStore } from './stores/ssaStore';
import SSAWorkspace from './SSAWorkspace';
import './styles/ssa.css';
import './styles/ssa-workspace.css';
const SSAModule: React.FC = () => {
const { reset } = useSSAStore();
const location = useLocation();
// location.key 在每次 navigate() 调用时都会变化(即使 URL 相同),
// 确保从其他模块返回或重复点击导航栏都能重置到全新状态
useEffect(() => {
reset();
}, [location.key, reset]);
return <SSAWorkspace />;
};
export default SSAModule;