|
|
@@ -46,6 +46,7 @@ import {
|
|
|
getConfigDisplayLabel,
|
|
|
listAllConfigCodes,
|
|
|
useConfigCodes,
|
|
|
+ useConfigCodesReady,
|
|
|
} from '../api/configCodes'
|
|
|
import type {
|
|
|
AIUnderstandingVO,
|
|
|
@@ -188,7 +189,7 @@ export default function RecallTestPage() {
|
|
|
// Tab1: 票圈视频ID — 三栏并列布局(视频详情 / AI理解 / 解构层级 都是召回维度)
|
|
|
// ============================================================================
|
|
|
/** 进入页面默认查询的视频ID, 避免空白态 */
|
|
|
-const DEFAULT_VIDEO_ID = 64632804
|
|
|
+const DEFAULT_VIDEO_ID = 60308273
|
|
|
|
|
|
function VideoIdTab() {
|
|
|
/** URL 上 ?videoId=xxx 优先于默认 ID;有则首次查询后自动按选题召回 */
|
|
|
@@ -637,6 +638,7 @@ function TextRecallTab() {
|
|
|
const [result, setResult] = useState<RecallResultVO | null>(null)
|
|
|
const [loading, setLoading] = useState(false)
|
|
|
const configCodes = useConfigCodes()
|
|
|
+ const configCodesReady = useConfigCodesReady()
|
|
|
const groupedOptions = buildGroupedConfigOptions(configCodes)
|
|
|
/** 召回结果标题展示的维度 meta — 锁定提交瞬间的值, 避免提交后改下拉影响展示 */
|
|
|
const [resultMeta, setResultMeta] = useState<{
|
|
|
@@ -733,14 +735,19 @@ function TextRecallTab() {
|
|
|
}
|
|
|
}, [queryText, configCode, topN, configCodes])
|
|
|
|
|
|
- /** URL 上有 queryText 时, 挂载后自动触发一次召回 (Grafana 跳转 0 点击) */
|
|
|
+ /**
|
|
|
+ * URL 上有 queryText 时, 挂载后自动触发一次召回 (Grafana 跳转 0 点击)
|
|
|
+ * 必须等 configCodes 真实字典加载完, 否则 ALL 模式只会跑 SAFE_FALLBACK 的 2 个维度
|
|
|
+ * (URL 显式带 configCode 时无此约束, 单维度跑就行)
|
|
|
+ */
|
|
|
const autoSearchedRef = useRef(false)
|
|
|
useEffect(() => {
|
|
|
if (autoSearchedRef.current) return
|
|
|
if (!urlQueryText) return
|
|
|
+ if (!urlConfigCode && !configCodesReady) return
|
|
|
autoSearchedRef.current = true
|
|
|
onSubmit()
|
|
|
- }, [urlQueryText, onSubmit])
|
|
|
+ }, [urlQueryText, urlConfigCode, configCodesReady, onSubmit])
|
|
|
|
|
|
return (
|
|
|
<Space direction="vertical" size={16} style={{ width: '100%' }}>
|