Skip to content

app-shell.mdx 的导航示例 2/3 键错(label/icon 字符串)+ 教了一个被整个丢弃的 header prop + searchEnabled 下必抛 TypeError 的隐患 #4793

Description

@yinlianghui

发现于 #3999 的实施(PR #4792),回传立单。同族第二载体(SidebarNav 教学面),发布在 objectui.org/docs/layout/app-shell。查重:#3946 是同文件另一段落另一事实(AppShell 自带 toggle 的失真),完成范围不含本条 —— 独立立单;#3914 已关且是数值类。

事实(基线 c252227 实测计数,PR #4792 报告)

  • 两处示例(content/docs/layout/app-shell.mdx:16-22、:154-190)导航项写 { label, href, icon:'home' }:9 处项级 label:(真实键 title;同目录 sidebar-nav.mdx 的 5 处 label 全是合法 NavGroup 用法,此处不是)、7 处字符串 icon:(应为组件);href 是对的 —— 2/3 错:跳转能走,坏的是标签(span 得 undefined)、collapsed tooltip 与图标;
  • 第二处示例多教一个 SidebarNav header={{ logo, title }} prop:SidebarNavProps(:37-44)没有它、组件解构无 rest,整个对象被丢弃 —— 示例承诺的 logo 与标题永不出现;
  • 附带风险:照示例开 searchEnabled 后输入任意字符,SidebarNav.tsx:140-141 的 item.title.toLowerCase() 对 title=undefined 的项直接抛 TypeError(:135 空串短路只挡空输入)。

修法

照 PR #4792 的 README 定型:示例改真实键 + lucide 组件 icon;删或改写 header prop 示例(该 prop 不存在 —— 若维护者想要它是产品增强另立);#3946 的段落不碰(它另有认领时序)。PR #4792 的钉子只覆盖 packages/layout/README.md,够不到 content/docs —— 防回潮缺口如实存在,content/docs 代码块门禁属 #3786 家族不入本单。

参考

Activity

  1. self-assigned this
    on Aug 16, 2026
  2. yinlianghui commented on Aug 16, 2026

    @yinlianghui
    CollaboratorAuthor

    【认领】objectui 分片 PM(session_01GTRjn8xBqp75dk7kFupVRt)批次 11 补位派发。分支:claude/issue-4793-appshell-nav-examples。前置门:PR #4805(#3946+#3947,同文件 toggle 段落)已 auto-merge 在队,dev 须确认其落 main 后才切 worktree(避免同文件双改冲突)。范围:两处导航示例改真实键(label→title、字符串 icon→lucide 组件)+ 删/改写不存在的 header prop 示例;照 PR #4792 的 README 定型;⛔ #4805 刚改的 toggle 相关行零触碰;⛔ content/docs 代码块门禁(#3786 族)不入本单。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions