fix(mobile): prioritize practice actions above guidance

This commit is contained in:
2026-07-25 13:17:32 +08:00
parent fa9d6da975
commit 2b3c37677d
4 changed files with 346 additions and 63 deletions
@@ -378,9 +378,15 @@ test('场景目录加载失败时清空旧场景并禁止开始训练', async ()
test('无已发布场景时隐藏常规训练,但仍展示独立实时陪练入口', async () => {
const source = await pageSource('../src/pages/user/practice/index.vue');
const realtimeIndex = source.indexOf('class="panel scenario-card realtime-entry-card employee-card"');
const sceneIndex = source.indexOf('class="panel scene-picker-card employee-card"');
const growthIndex = source.indexOf('class="panel growth-card employee-card"');
assert.match(source, /v-if="loggedIn && practiceView === 'prep' && availableScenarios\.length" class="panel scenario-card practice-scenario-card employee-card"/);
assert.match(source, /v-if="loggedIn && practiceView === 'prep'" class="panel scenario-card realtime-entry-card employee-card"/);
assert.ok(realtimeIndex > -1 && realtimeIndex < sceneIndex && sceneIndex < growthIndex, '核心陪练入口必须排在场景和成长说明之前');
assert.match(source, /v-if="growthDetailsExpanded" class="growth-details"/);
assert.match(source, /return '选一种方式,马上开始';/);
assert.match(source, /:disabled="!canStartRealtime \|\| busy"/);
assert.match(source, /if \(!canStartRealtime\.value \|\| !requireLogin\(\)\) return;/);
assert.doesNotMatch(source, /if \(!canStartPractice\.value \|\| !requireLogin\(\)\) return;\s*speechPlayback\.stop\(\);\s*cancelRecording\(\);\s*turnVoiceGeneration \+= 1;/);
+3 -1
View File
@@ -50,12 +50,14 @@ test('实时陪练通过受认证代理接入,前端不携带供应商密钥
// 页面:人设卡片选择 + 本地持久化;音色 picker 已删除
assert.match(page, /实时陪练 Beta/);
assert.match(page, /实时陪练人设/);
assert.match(page, /选择陪练角色/);
assert.match(page, /aihr_realtime_practice_persona/);
assert.match(page, /selectRealtimePersona/);
assert.match(page, /fetchRealtimePersonas/);
assert.match(page, /createRealtimeSession/);
assert.match(page, /正在查知识库/);
assert.match(page, /activeScenarioName\.value = session\.personaName \|\| '实时陪练'/);
assert.match(page, /realtimeActive && !turns\.length/);
assert.match(page, /class="panel scenario-card realtime-entry-card employee-card"/);
assert.match(page, /const canStartRealtime = computed/);
assert.match(page, /if \(!canStartRealtime\.value \|\| !requireLogin\(\)\) return;/);