Explorar o código

fix(chat): 试用引导卡改为页面级常驻,修复跳转后不显示

跳到 /chat/:id/new 时页面处于「准备房间」态,走不到空会话分支;
引导卡移到页面级,组件内部判断条件与只显示一次。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Huccct hai 19 horas
pai
achega
4c4365a5ab

+ 9 - 0
docs/00-tracking/操作追踪.md

@@ -10694,3 +10694,12 @@ Call log:
     - **只显示一次**:localStorage `fmode_trial_onboarding_<userId>`,关掉后不再出现(写法照抄 `app-notification.service`)
     - 两端接入:桌面 `.welcome` 分支上方、移动 `app-m-empty` 之前;底部「重新查看接入提示词」跳 `/plans`
   - 提示词卡片:主按钮 `一键复制` → **`复制并前往会话`**;下方新增「接下来:」三步说明(整段粘贴 / 自动重启网关 / 回 App 验证)。
+
+- 2026-12-04 03:40:00+08:00:**引导卡不显示修复 + 本机 Hermes 提示词实测(停止于身份冲突)**
+  - **引导卡不显示的原因**:复制后跳 `/chat/:id/new`,页面处于「准备房间」状态,走不到「空会话」分支,而引导卡原先插在该分支里。
+  - 修复:引导卡改到**页面级常驻**(桌面 chat-head 之后、移动 trial-expired-bar 附近),组件内部自己判断显示条件与「只显示一次」。
+  - **本机 Hermes 实测**:用用户提供的新提示词(容器 `agent-node-app-9acm7evvif`)执行 → Hermes **正确停止**并报告「本机已有 AGENT_ID=agent-node-app-5ywuhfefqw,与本次不同,禁止覆盖旧身份」。这是提示词第 6 行的预期行为。
+  - 两个待解决:
+    ① 本机 Hermes 仍绑旧容器 `5ywuhfefqw`,要测新容器需先迁移身份(须用户确认,旧容器会掉线);
+    ② 用户给的提示词有效期 `02:51 UTC` 已过,需重新生成。
+  - 验证阻塞:容器 `9acm7evvif` 属主是 18182795512,而 `.claude/dev-login.json` 当前账号是 19170119836,浏览器自动化看不到该容器 → 引导卡实测需用户在自己账号下看。

+ 13 - 2
src/app/desktop/pages/chat/chat.ts

@@ -326,6 +326,16 @@ interface ConversationRow {
               · 对方的容器(offlineBanner())—— 是容器那边的问题
             合并成一条会让用户分不清该刷新自己还是找管理员。
           -->
+          <!--
+            试用接入引导(2026-12-04):放在**页面级**而不是空会话分支 ——
+            跳到 /chat/:id/new 时页面处于「准备房间」状态,走不到空会话分支,
+            引导卡就不会出现(用户实测)。这里只在试用容器未接入成功时首次显示,
+            组件内部自己判断条件与「只显示一次」。
+          -->
+          <div class="trial-onb-hold">
+            <app-trial-onboarding [agent]="chat.agent()" (openInstruction)="goPlans()" />
+          </div>
+
           @if (chat.connection() !== 'connected') {
             <div class="banner-hold">
               <ui-alert
@@ -461,8 +471,6 @@ interface ConversationRow {
                   给「该做什么」的具体引导,而不是一句泛泛的「还没有消息」。
                   建议项点一下即填入输入框(不直接发送,让用户能改)。
                 -->
-                <!-- 试用接入引导(2026-12-04):只在试用容器未接入成功时首次显示 -->
-                <app-trial-onboarding [agent]="chat.agent()" (openInstruction)="goPlans()" />
                 <div class="welcome">
                   <div class="welcome-inner">
                     <!--
@@ -1369,6 +1377,9 @@ interface ConversationRow {
         cursor: pointer;
       }
       /* 容器连接中断提示条(2026-12-03):与 composer 同宽对齐 */
+      /* 试用引导卡容器:组件自身不渲染时整个 div 不占位 */
+      .trial-onb-hold:empty { display: none; }
+
       .conn-interrupt {
         display: flex;
         align-items: center;

+ 6 - 2
src/app/mobile/pages/chat/chat.ts

@@ -158,6 +158,11 @@ type SheetTab = 'task' | 'file' | 'deliver' | 'state';
       />
 
       <!-- 试用到期(2026-12-03):门禁已拦,深链直达时也给明确原因 -->
+      <!-- 试用接入引导(2026-12-04):页面级常驻,组件内部判断条件与只显示一次 -->
+      <div class="trial-onb-hold">
+        <app-trial-onboarding [agent]="chat.agent()" (openInstruction)="goPlans()" />
+      </div>
+
       @if (chat.agent()?.trialExpired) {
         <div class="trial-expired-bar" role="alert">
           <i class="fa-solid fa-hourglass-end" aria-hidden="true"></i>
@@ -243,8 +248,6 @@ type SheetTab = 'task' | 'file' | 'deliver' | 'state';
                 (retry)="retry()"
               />
             } @else {
-              <!-- 试用接入引导(2026-12-04):只在试用容器未接入成功时首次显示 -->
-              <app-trial-onboarding [agent]="chat.agent()" (openInstruction)="goPlans()" />
               <app-m-empty
                 icon="fa-solid fa-comments"
                 title="开始新的对话"
@@ -593,6 +596,7 @@ type SheetTab = 'task' | 'file' | 'deliver' | 'state';
         text-align: center;
       }
       /* 试用到期提示条(2026-12-03):与连接中断条同风格,左侧文案 + 右侧去开通 */
+      .trial-onb-hold:empty { display: none; }
       .trial-expired-bar {
         display: flex;
         align-items: center;