Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

docs: app-shell.mdx 的 Header Bar / Content Area 两处数值与 AppShell.tsx 不符(「64px / 4rem」实为 h-14=56px;「4 on mobile」实为 p-3,且 mobile 的 pb-20 未记) #3914

Closed

Description

@yinlianghui

发现于 #3902 的实现(分支 claude/issue-3902-pageheader-responsive-claim),不在该 PR 处理 —— #3902 的判定面被钉在 content/docs/layout/page-header.mdx 的 Responsive Behavior 那一行,这两条在另一个文件、另一个组件(AppShell)。

在 origin/main @ c2ecbaed9 核过。

现象

content/docs/layout/app-shell.mdx:59-74

### Header Bar

The header bar provides:
- Sidebar toggle button
- Custom navbar content area
- Fixed height (64px / 4rem)
- Border bottom separator
- Background matching app theme

### Content Area

The main content area features:
- Responsive padding (4 on mobile, 6 on desktop)
- Automatic scrolling
- Flexible height (fills viewport)
- Custom className support

两条数值都与源码不符:

  1. :64 「Fixed height (64px / 4rem)」 —— packages/layout/src/AppShell.tsx:249 的 header class 是
    sticky top-0 z-30 flex h-14 w-full shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4。
    h-14 = 3.5rem = 56px。整个文件里 header 高度类只有这一处(grep h-1[0-9] 在 AppShell.tsx 唯一命中 :249),没有别处把它覆盖成 64px。文档写的 64px / 4rem 对应 h-16 —— 不存在。

  2. :71 「Responsive padding (4 on mobile, 6 on desktop)」 —— AppShell.tsx:257 是
    flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6 pb-20 sm:pb-4 md:pb-6。
    实际是三档:mobile p-3(3,不是 4)、sm:p-4、md:p-6;此外 mobile 的底部 padding 被 pb-20(5rem)单独抬高(看形状是给移动端底部栏留净空),文档完全没记。覆盖 className 的作者按「4 on mobile」去算,在 mobile 和 sm 两档都会算错,底部那一档差得最多。

为什么值得记一笔

与 #3786 / #3902 是同一类病:文档把 Tailwind 间距/尺寸写成具体数字,而这些数字随源码漂移后,读者无法从文档自身判断真假 —— 偏偏照这些数字算的正是要覆盖间距的作者。#3786 已修好的 page-header 「Styling → Container」节给了一个不易漂移的写法可以照抄。

建议处置

按 AppShell.tsx:249 / :257 现状改写这两行:高度写 h-14(56px),padding 写清 mobile/sm/md 三档并记上 mobile 的 pb-20;或改成不重复数值、指向源码的说法。不到 4 行,无产品决策。

参考位置

  • content/docs/layout/app-shell.mdx:64、:71
  • packages/layout/src/AppShell.tsx:249、:257

关联:#3902(发现于此)、#3786(同类假断言的先例)

Activity

  1. claude commented on Aug 9, 2026

    @claude
    Contributor

    Triage: pm:queue (objectui in-repo; whole-repo seat, no domain label per protocol).

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  2. self-assigned this
    on Aug 9, 2026
  3. yinlianghui commented on Aug 9, 2026

    @yinlianghui
    ContributorAuthor

    🔒 认领(objectui 分片 PM,session session_01GTRjn8xBqp75dk7kFupVRt,恢复批次 1 补位)

    • 分支:claude/issue-3914-appshell-docs-numbers
    • 范围按正文:content/docs 的 app-shell 页两处数值与 AppShell.tsx 实况对齐(Header Bar h-14=56px 非「64px/4rem」;Content Area 实为 p-3 且 mobile pb-20 未记)—— 以当前 main 的 AppShell.tsx 实测为准改写,docs-only。
    • 文件面:content/docs/** 对应页(⛔ releases/ 不碰);⛔ 不改 AppShell.tsx 本体(文档向代码对齐,不是反向)。

    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