Prhub

#32586 docs(cookbook): mark every Kimi-K3 cell in-progress; land Playground "Switch base" on the configurator

原始 PR 作者 zijiexia 合并时间 2026-07-28 09:59 文件变更 4 提交数 2 评论 2 代码增减 +112 / -17

执行摘要

Kimi-K3 单元格标记终验进行中,修复 Playground 按钮定位

Kimi-K3 页面原先所有标记为 Not Verified,意图是“无人验证过”,但实际上这些配置运行无误,只是最后权重和服务验证过程尚未完结。两状态(verified/unverified)无法区分“没人看过”和“验证中”两种状态。同时,Playground 的“Switch base”按钮跳转到 ## Deployment 标题,在 Kimi-K3 页面上距配置器 10316 像素,毫无用处,应直接跳转到配置器本身。

文档和 UI 微调,建议快速浏览了解验证状态设计模式。若关注 cookbook 维护流程,值得注意添加新状态时的防御性回退逻辑。

讨论亮点

无 review 讨论,PR 直接通过。

实现拆解

  1. 三态验证引擎:在 _deployment.jsx 中新增 verifyStatusOfcellVerifyStatus 辅助函数,将布尔 verified 扩展为三态字符串 (verified / in-progress / unverified)。修改 badgebadgeDot 样式函数,通过状态查表获取颜色,新增 whiteSpace: nowrap 防止长文本换行。
  2. 配置数据变更:在 configs/moonshotai/kimi-k3.jsx 的每个单元格中添加 verificationStatus: "in-progress",并留下注释说明后续如何升级回 verified: true
  3. Playground 跳转修复:在 _playground.jsx 中镜像定义 DEPLOYMENT_COMPONENT_ID = "deployment-configurator",将按钮的 getElementById 目标从 "deployment" 改为优先使用 DEPLOYMENT_COMPONENT_ID,再回退到 heading id。
  4. 页面文案更新:在 Kimi-K3.mdx 的 Note 中将“Not Verified”改为“Final Verification In Progress”,并将范围限定在 Deploy 面板。
文件 模块 状态 重要度
docs_new/src/snippets/_deployment.jsx 部署配置器 modified 6.88
docs_new/src/snippets/configs/moonshotai/kimi-k3.jsx 模型配置 modified 5.47
docs_new/src/snippets/_playground.jsx Playground modified 4.46
docs_new/cookbook/autoregressive/Moonshotai/Kimi-K3.mdx 文档页面 modified 2.04

关键符号

verifyStatusOf cellVerifyStatus

关键源码片段

docs_new/src/snippets/_deployment.jsx core-logic

核心引擎文件,新增三态验证状态逻辑和 lookup 表,修改 badge 渲染函数,是本次变更的核心。

// 三态验证:扩展布尔 verified 为字符串状态,提供 look-up 标签和颜色
const VERIFY_LABEL = {
  verified: "Verified",
  "in-progress": "Final Verification In Progress",
  unverified: "Not Verified",
};// 将任何状态输入归一化为合法的三态 id
const verifyStatusOf = (status) => {
  // 布尔 true → verified;合法字符串原样返回;其余一律当作 unverified(包括 typo 如 "in_progress")
  if (status === true) return "verified";
  if (status === "verified" || status === "in-progress" || status === "unverified") return status;
  return "unverified";
};// 从 cell 对象中提取验证状态:优先使用 verificationStatus,否则回退到 verified
const cellVerifyStatus = (cell) =>
  cell.verificationStatus !== undefined
    ? verifyStatusOf(cell.verificationStatus)
    : verifyStatusOf(cell.verified);// badge 样式函数:根据归一化后的状态选择背景和文字颜色,whiteSpace: nowrap 防止长标签折行
badge: (status) => ({
  display: "inline-flex",
  alignItems: "center",
  gap: "6px",
  padding: "2px 8px",
  borderRadius: "10px",
  background: {
    verified: isDark ? "#064e3b" : "#d1fae5",
    "in-progress": isDark ? "#1e3a8a" : "#dbeafe",
    unverified: isDark ? "#78350f" : "#fef3c7",
  }[verifyStatusOf(status)],
  color: {
    verified: isDark ? "#a7f3d0" : "#065f46",
    "in-progress": isDark ? "#bfdbfe" : "#1e40af",
    unverified: isDark ? "#fde68a" : "#92400e",
  }[verifyStatusOf(status)],
  fontSize: "11px",
  fontWeight: 600,
  whiteSpace: "nowrap",
}),
docs_new/src/snippets/_playground.jsx core-logic

Playground 组件,修复“Switch base”按钮滚动目标,使其跳转到配置器组件而非标题。

// 在文件开头的常量区域添加(与 _deployment.jsx 保持一致的镜像定义)
// ==== MIRROR of DEPLOYMENT_COMPONENT_ID in _deployment.jsx — keep identical ====
// Snippets cannot import each other. The Deploy panel puts this id on its
// root (carrying its own scrollMarginTop), which is what "jump to the base"
// should land on.
const DEPLOYMENT_COMPONENT_ID = "deployment-configurator";// 在按钮 onClick 中替换硬编码 id
onClick={() => {
  // 优先跳转到配置器本身,回退到 heading slug
  const el = document.getElementById(DEPLOYMENT_COMPONENT_ID)
    || document.getElementById("deployment")
    || document.getElementById("deploy");
  if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
}}

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

低风险。仅影响文档页面前端展示逻辑,无运行时代码。需注意防御性回退:未识别的 status 值解析为 unverified,不会误显示 green badge。Playground 按钮通过回退链确保非配置器页面行为不变。

影响 Kimi-K3 页面所有单元格显示蓝色“Final Verification In Progress”徽标(原黄色“Not Verified”)。影响所有包含 Playground 组件的 cookbook 页面:返回按钮跳转到 #deployment-configurator 而非 ## Deployment 标题。无其他页面影响。

仅文档变更 前端展示逻辑

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论