diff --git a/docs/frontend-analytics-manifest.json b/docs/frontend-analytics-manifest.json index 48bcf09c2..9a3366834 100644 --- a/docs/frontend-analytics-manifest.json +++ b/docs/frontend-analytics-manifest.json @@ -3,7 +3,7 @@ "description": "Source declarations, not runtime DOM counts, pageviews, successful outcomes or a closed runtime enum. Forwarding sites require explicit callers. See frontend-analytics.md for gaps and event policy.", "counts": {"routes":54,"uniqueIds":804,"literalJsxSites":823,"literalJsxValues":977,"navigationDefinitions":29,"forwardingSites":36}, "routes": [ - {"name":"landingRoute","path":"/","declaration":{"file":"web/src/app/router.tsx","line":258},"implementation":{"file":"web/src/pages/landing.tsx","line":257,"export":"LandingPage"},"guarded":false,"roleProtected":false}, + {"name":"landingRoute","path":"/","declaration":{"file":"web/src/app/router.tsx","line":258},"implementation":{"file":"web/src/pages/landing.tsx","line":258,"export":"LandingPage"},"guarded":false,"roleProtected":false}, {"name":"skillsRoute","path":"skills","declaration":{"file":"web/src/app/router.tsx","line":264},"implementation":{"file":"web/src/pages/home.tsx","line":12,"export":"HomePage"},"guarded":false,"roleProtected":false}, {"name":"loginRoute","path":"login","declaration":{"file":"web/src/app/router.tsx","line":270},"implementation":{"file":"web/src/pages/login.tsx","line":22,"export":"LoginPage"},"guarded":true,"roleProtected":false}, {"name":"registerRoute","path":"register","declaration":{"file":"web/src/app/router.tsx","line":281},"implementation":{"file":"web/src/pages/register.tsx","line":55,"export":"RegisterPage"},"guarded":false,"roleProtected":false}, @@ -59,12 +59,12 @@ {"name":"adminNamespacesRoute","path":"admin/namespaces","declaration":{"file":"web/src/app/router.tsx","line":770},"implementation":{"file":"web/src/pages/admin/namespaces.tsx","line":104,"export":"AdminNamespacesPage"},"guarded":true,"roleProtected":true} ], "definitions": [ - {"file":"web/src/app/layout.tsx","line":88,"ids":["navigation.home.open"]}, - {"file":"web/src/app/layout.tsx","line":89,"ids":["skill.publish.open"]}, - {"file":"web/src/app/layout.tsx","line":90,"ids":["navigation.skills.open"]}, - {"file":"web/src/app/layout.tsx","line":91,"ids":["navigation.github.open"]}, - {"file":"web/src/app/layout.tsx","line":92,"ids":["navigation.suites.open"]}, - {"file":"web/src/app/layout.tsx","line":93,"ids":["navigation.dashboard.open"]}, + {"file":"web/src/app/layout.tsx","line":89,"ids":["navigation.home.open"]}, + {"file":"web/src/app/layout.tsx","line":90,"ids":["skill.publish.open"]}, + {"file":"web/src/app/layout.tsx","line":91,"ids":["navigation.skills.open"]}, + {"file":"web/src/app/layout.tsx","line":92,"ids":["navigation.github.open"]}, + {"file":"web/src/app/layout.tsx","line":93,"ids":["navigation.suites.open"]}, + {"file":"web/src/app/layout.tsx","line":94,"ids":["navigation.dashboard.open"]}, {"file":"web/src/features/namespace/namespace-management-nav.tsx","line":26,"ids":["namespace.skills.open"]}, {"file":"web/src/features/namespace/namespace-management-nav.tsx","line":27,"ids":["namespace.members.open"]}, {"file":"web/src/features/namespace/namespace-management-nav.tsx","line":28,"ids":["namespace.reviews.open"]}, @@ -90,24 +90,24 @@ {"file":"web/src/pages/dashboard.tsx","line":91,"ids":["account.security.open"]} ], "sites": [ - {"file":"web/src/app/layout.tsx","line":125,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.home.open"]}, - {"file":"web/src/app/layout.tsx","line":138,"host":"Link","prop":"data-analytics-id","event":"click","forward":"item.analyticsId"}, - {"file":"web/src/app/layout.tsx","line":158,"host":"button","prop":"data-analytics-id","event":"click","ids":["navigation.menu.toggle"]}, - {"file":"web/src/app/layout.tsx","line":174,"host":"Link","prop":"data-analytics-id","event":"click","ids":["auth.login.open"]}, - {"file":"web/src/app/layout.tsx","line":192,"host":"Link","prop":"data-analytics-id","event":"click","forward":"item.analyticsId"}, - {"file":"web/src/app/layout.tsx","line":250,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.skills.open"]}, - {"file":"web/src/app/layout.tsx","line":251,"host":"Link","prop":"data-analytics-id","event":"click","ids":["skill.publish.open"]}, - {"file":"web/src/app/layout.tsx","line":252,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.dashboard.open"]}, - {"file":"web/src/app/layout.tsx","line":259,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.documentation.open"]}, - {"file":"web/src/app/layout.tsx","line":260,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.cli.open"]}, - {"file":"web/src/app/layout.tsx","line":261,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.repository.open"]}, - {"file":"web/src/app/layout.tsx","line":268,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.license.open"]}, - {"file":"web/src/app/layout.tsx","line":269,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.contributing.open"]}, - {"file":"web/src/app/layout.tsx","line":270,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.changelog.open"]}, - {"file":"web/src/app/layout.tsx","line":271,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.conduct.open"]}, - {"file":"web/src/app/layout.tsx","line":278,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.community.open"]}, - {"file":"web/src/app/layout.tsx","line":279,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.privacy.open"]}, - {"file":"web/src/app/layout.tsx","line":280,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.terms.open"]}, + {"file":"web/src/app/layout.tsx","line":127,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.home.open"]}, + {"file":"web/src/app/layout.tsx","line":140,"host":"Link","prop":"data-analytics-id","event":"click","forward":"item.analyticsId"}, + {"file":"web/src/app/layout.tsx","line":160,"host":"button","prop":"data-analytics-id","event":"click","ids":["navigation.menu.toggle"]}, + {"file":"web/src/app/layout.tsx","line":176,"host":"Link","prop":"data-analytics-id","event":"click","ids":["auth.login.open"]}, + {"file":"web/src/app/layout.tsx","line":195,"host":"Link","prop":"data-analytics-id","event":"click","forward":"item.analyticsId"}, + {"file":"web/src/app/layout.tsx","line":253,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.skills.open"]}, + {"file":"web/src/app/layout.tsx","line":254,"host":"Link","prop":"data-analytics-id","event":"click","ids":["skill.publish.open"]}, + {"file":"web/src/app/layout.tsx","line":255,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.dashboard.open"]}, + {"file":"web/src/app/layout.tsx","line":262,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.documentation.open"]}, + {"file":"web/src/app/layout.tsx","line":263,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.cli.open"]}, + {"file":"web/src/app/layout.tsx","line":264,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.repository.open"]}, + {"file":"web/src/app/layout.tsx","line":271,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.license.open"]}, + {"file":"web/src/app/layout.tsx","line":272,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.contributing.open"]}, + {"file":"web/src/app/layout.tsx","line":273,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.changelog.open"]}, + {"file":"web/src/app/layout.tsx","line":274,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.conduct.open"]}, + {"file":"web/src/app/layout.tsx","line":281,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.community.open"]}, + {"file":"web/src/app/layout.tsx","line":282,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.privacy.open"]}, + {"file":"web/src/app/layout.tsx","line":283,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.terms.open"]}, {"file":"web/src/features/auth/auth-shell.tsx","line":19,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.home.open"]}, {"file":"web/src/features/auth/auth-shell.tsx","line":28,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.home.open"]}, {"file":"web/src/features/auth/login-button.tsx","line":71,"host":"Button","prop":"data-analytics-id","event":"click","ids":["auth.oauth.request"]}, @@ -786,17 +786,17 @@ {"file":"web/src/pages/home.tsx","line":126,"host":"SkillCard","prop":"analyticsId","event":"click+keydown-enter-space","ids":["skill.card.open"]}, {"file":"web/src/pages/join.tsx","line":58,"host":"Button","prop":"data-analytics-id","event":"click","ids":["namespace.join.retry"]}, {"file":"web/src/pages/join.tsx","line":70,"host":"Button","prop":"data-analytics-id","event":"click","ids":["namespace.join.confirm"]}, - {"file":"web/src/pages/landing.tsx","line":92,"host":"input","prop":"data-analytics-id","event":"keydown-enter","ids":["discovery.query.enter"]}, - {"file":"web/src/pages/landing.tsx","line":106,"host":"button","prop":"data-analytics-id","event":"click","ids":["discovery.suggestion.search"]}, - {"file":"web/src/pages/landing.tsx","line":132,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.skills.open"]}, - {"file":"web/src/pages/landing.tsx","line":358,"host":"Link","prop":"data-analytics-id","event":"click","ids":["skill.publish.open"]}, - {"file":"web/src/pages/landing.tsx","line":361,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.skills.open"]}, - {"file":"web/src/pages/landing.tsx","line":424,"host":"Button","prop":"data-analytics-id","event":"click","ids":["discovery.popular.open"]}, - {"file":"web/src/pages/landing.tsx","line":437,"host":"SkillCard","prop":"analyticsId","event":"click+keydown-enter-space","ids":["skill.card.open"]}, - {"file":"web/src/pages/landing.tsx","line":453,"host":"Button","prop":"data-analytics-id","event":"click","ids":["discovery.latest.open"]}, - {"file":"web/src/pages/landing.tsx","line":466,"host":"SkillCard","prop":"analyticsId","event":"click+keydown-enter-space","ids":["skill.card.open"]}, - {"file":"web/src/pages/landing.tsx","line":483,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.repository.open"]}, - {"file":"web/src/pages/landing.tsx","line":486,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.documentation.open"]}, + {"file":"web/src/pages/landing.tsx","line":93,"host":"input","prop":"data-analytics-id","event":"keydown-enter","ids":["discovery.query.enter"]}, + {"file":"web/src/pages/landing.tsx","line":107,"host":"button","prop":"data-analytics-id","event":"click","ids":["discovery.suggestion.search"]}, + {"file":"web/src/pages/landing.tsx","line":133,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.skills.open"]}, + {"file":"web/src/pages/landing.tsx","line":359,"host":"Link","prop":"data-analytics-id","event":"click","ids":["skill.publish.open"]}, + {"file":"web/src/pages/landing.tsx","line":362,"host":"Link","prop":"data-analytics-id","event":"click","ids":["navigation.skills.open"]}, + {"file":"web/src/pages/landing.tsx","line":425,"host":"Button","prop":"data-analytics-id","event":"click","ids":["discovery.popular.open"]}, + {"file":"web/src/pages/landing.tsx","line":438,"host":"SkillCard","prop":"analyticsId","event":"click+keydown-enter-space","ids":["skill.card.open"]}, + {"file":"web/src/pages/landing.tsx","line":454,"host":"Button","prop":"data-analytics-id","event":"click","ids":["discovery.latest.open"]}, + {"file":"web/src/pages/landing.tsx","line":467,"host":"SkillCard","prop":"analyticsId","event":"click+keydown-enter-space","ids":["skill.card.open"]}, + {"file":"web/src/pages/landing.tsx","line":484,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.repository.open"]}, + {"file":"web/src/pages/landing.tsx","line":487,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.documentation.open"]}, {"file":"web/src/pages/login.tsx","line":87,"host":"button","prop":"data-analytics-id","event":"click","ids":["auth.personal.select"]}, {"file":"web/src/pages/login.tsx","line":90,"host":"button","prop":"data-analytics-id","event":"click","ids":["auth.enterprise.select"]}, {"file":"web/src/pages/login.tsx","line":97,"host":"form","prop":"data-analytics-id","event":"submit","ids":["auth.login.submit"]}, @@ -920,14 +920,14 @@ {"file":"web/src/shared/components/confirm-dialog.tsx","line":76,"host":"Button","prop":"data-analytics-id","event":"click","forward":"cancelAnalyticsId"}, {"file":"web/src/shared/components/confirm-dialog.tsx","line":79,"host":"Button","prop":"data-analytics-id","event":"click","forward":"confirmAnalyticsId"}, {"file":"web/src/shared/components/copy-button.tsx","line":25,"host":"Button","prop":"data-analytics-id","event":"click","forward":"analyticsId"}, - {"file":"web/src/shared/components/landing-quick-start.tsx","line":51,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.view.select"]}, - {"file":"web/src/shared/components/landing-quick-start.tsx","line":78,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.prompt.copy"]}, - {"file":"web/src/shared/components/landing-quick-start.tsx","line":174,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.command.copy"]}, - {"file":"web/src/shared/components/landing-quick-start.tsx","line":193,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.command.copy"]}, - {"file":"web/src/shared/components/landing-quick-start.tsx","line":232,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.command.copy"]}, - {"file":"web/src/shared/components/landing-quick-start.tsx","line":273,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.cli.open"]}, - {"file":"web/src/shared/components/landing-quick-start.tsx","line":321,"host":"a","prop":"data-analytics-id","event":"click","ids":["guide.package.download"]}, - {"file":"web/src/shared/components/landing-quick-start.tsx","line":371,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.mode.select"]}, + {"file":"web/src/shared/components/landing-quick-start.tsx","line":52,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.view.select"]}, + {"file":"web/src/shared/components/landing-quick-start.tsx","line":79,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.prompt.copy"]}, + {"file":"web/src/shared/components/landing-quick-start.tsx","line":175,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.command.copy"]}, + {"file":"web/src/shared/components/landing-quick-start.tsx","line":194,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.command.copy"]}, + {"file":"web/src/shared/components/landing-quick-start.tsx","line":233,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.command.copy"]}, + {"file":"web/src/shared/components/landing-quick-start.tsx","line":274,"host":"a","prop":"data-analytics-id","event":"click","ids":["navigation.cli.open"]}, + {"file":"web/src/shared/components/landing-quick-start.tsx","line":322,"host":"a","prop":"data-analytics-id","event":"click","ids":["guide.package.download"]}, + {"file":"web/src/shared/components/landing-quick-start.tsx","line":372,"host":"button","prop":"data-analytics-id","event":"click","ids":["guide.mode.select"]}, {"file":"web/src/shared/components/language-switcher.tsx","line":60,"host":"Button","prop":"data-analytics-id","event":"click","ids":["navigation.language.open"]}, {"file":"web/src/shared/components/language-switcher.tsx","line":80,"host":"button","prop":"data-analytics-id","event":"click","ids":["navigation.language.select"]}, {"file":"web/src/shared/components/pagination.tsx","line":52,"host":"Button","prop":"data-analytics-id","event":"click","forward":"analyticsId"}, diff --git a/openspec/changes/improve-my-skills-management/design.md b/openspec/changes/improve-my-skills-management/design.md index 474de733a..b9d1bf50c 100644 --- a/openspec/changes/improve-my-skills-management/design.md +++ b/openspec/changes/improve-my-skills-management/design.md @@ -39,25 +39,33 @@ 先完成一个可执行筛选切片并创建 Draft PR,再完成卡片和操作。实现收敛后执行一次集中独立 Review,随后冻结代码,形成需求追踪矩阵并运行源检查、精确提交镜像及浏览器关键业务路径。截图只证明视觉结果,不替代接口与最终状态断言。 -## 原型视觉基线与管理页面范围 +## 原型视觉基线与统一站点框架 -以已确认原生 Figma 稿及最终执行生成脚本为视觉来源,原生 Medium 字重采用500;本地 HTML 仅作辅助对照;旧覆盖前的30px操作高度不作为基线。用户追加确认将外壳和页头推广至控制台与设置页,卡片紧凑字号仅作用于技能列表,不将11px元数据字号套用到表单正文。 +以已确认原生 Figma 稿及最终执行生成脚本为视觉来源,原生 Medium 字重采用500;本地 HTML 仅作辅助对照;旧覆盖前的30px操作高度不作为基线。用户追加确认将共享外壳推广至控制台、设置页和公共页面,卡片紧凑字号仅作用于技能列表,不将11px元数据字号套用到表单正文。 | 区域 | 本页基线 | 生产适配 | | --- | --- | --- | | 标题/简介/元数据/状态 | 15px/24px、12px/20px、11px/18px、10px/20px | 桌面标题列390px、可收缩,后接状态;窄屏不固定列宽且最多两行,完整名称保留于title及详情 | | 状态与图标 | 状态圆角5px、内边距0/7px、低饱和底色;元数据图标13px | 小字前景色加深到4.5:1对比;真实头像或首字回退32px,不推断技能类别 | | 卡片与操作 | 圆角12px、卡片间距12px、桌面内边距18px/20px、移动14px | 更新72×32px、更多32×32px;768px以下更新进入菜单,保留相同权限及预填参数 | -| 页面框架 | 控制台采用1440px外壳、224px侧栏;设置页使用同一外壳的1072px紧凑模式(224px侧栏+80px内容边距+768px表单),桌面右栏左右40px、顶部36px | 手机左右16px、顶部18px;侧栏桌面20px水平/32px顶部及移动16px内边距,设置外壳整体居中收窄,表单保持左对齐及阅读宽度;审核详情可使用1500px宽版 | +| 页面框架 | 站点正文、导航与页脚统一1440px最大宽度;外边距16px/24px/40px;控制台224px侧栏 | 控制台内部不重复添加站点外边距,顶部手机18px/桌面36px;侧栏、列表、设置、审核共享外壳;内部正文及输入区域可限制阅读宽度 | | 筛选与菜单 | 筛选控件40px、胶囊32px;菜单宽208px、圆角10px、条目36px、图标16px;发布按钮36px | 不伪造状态计数;浅色与深色分别适配 | 原型中的彩色类别头像与固定技能数据是演示样例,不能据此生成生产语义;真实技能图片、生命周期、只读状态与审核目标仍来自现有接口。短可见性标签和图标旁保留完整范围说明,长坐标可截断但保留完整悬停文本及复制操作;768px以下隐藏下载统计,桌面仍展示。公共导航高度及内容继续遵循应用外壳,不宣称整个应用逐像素复刻原型。 -## 统一外壳、说明高度与默认头像 +## 统一站点外壳、说明高度与默认头像 - 控制台首页删除页内重复侧栏,由公共 Layout 与其他管理页统一组织。导航过滤仅保留现有角色与能力规则;外壳和侧栏的路径判断使用同一个已解析路由,防止加载期间组合新外壳与旧内容。 -- 发布页继续使用无侧栏流程,市场、搜索、登录及公共技能详情不进入本轮管理外壳。设置页整体外壳连同侧栏居中收窄,表单在右栏内左对齐并限制阅读宽度;较宽审核内容以明确模式保留,不为每个页面另写位置特例。 +- 发布页继续使用无侧栏流程;市场、开源技能、搜索、套件、详情与控制台使用相同站点宽度及外边距,但不添加管理侧栏。首页保留全幅背景,所有分区正文复用同一框架。设置与审核取消独立1072px/1500px外壳,不为页面另写宽度特例;正文、表单字段和授权小卡可保留内部阅读宽度。登录注册分栏保留。 - 常规管理与设置页面复用统一页头。命名空间和审核资源详情本轮继承共享外壳,保留资源型标题和专用内容结构,后续随详情页风格改造处理;不得通过管理外壳下的通用 `h1` 选择器污染 Markdown 正文或公共资源组件。 - 技能卡片按实际内容确定高度:空简介不渲染空说明区,有简介时最多展示两行;推广关系、申请范围或只读提示仅在该卡片存在时展示,不让其他卡片预留空行。统一头像、标题、状态与操作的布局及内边距,不要求元数据跨卡片绝对对齐或卡片等高;提示、风险说明和头像预览可自然增高。完整说明保留文本提示及真实详情入口。 - 头像组件提供可选稳定种子,以命名空间与技能标识散列映射有限柔和配色,包含明暗主题;不调用渲染期随机数,不按展示名猜测行业或类别。列表显式传入种子,既有未选用此能力的调用保持原样。真实图片优先,失败时使用相同种子的首字回退。 - 长短说明样例使用独立命名前缀,通过真实上传和现有审核流程建立;不得修改已有版本差异、状态和分页回归所依赖的数据。验收比较空简介与短简介的紧凑程度、提示仅在对应卡片展示、截断后的完整内容可达性,以及刷新或改名后的默认头像一致性。 + +## 全站宽度一致性验收 + +站点框架由共享常量定义1440px最大宽度及16px/24px/40px响应式外边距。导航、页脚和首页各全幅分区正文使用同一来源;普通公共页和控制台通过公共Layout获得外壳,页面根节点不得再次叠加站点级max-width或水平padding。控制台设置/审核与列表共享相同侧栏位置;嵌入式比较Dialog与独立比较页面分别保持自身滚动和框架职责。 + +验收覆盖1920px、1440px及390px代表视口、明暗主题、长标题和导航/表单/表格;核对clientWidth下的框架居中与外边距、跨控制台页侧栏起点、无页面横溢。普通用户与匿名导航能力保持;仅调整外层布局,不改变路由、取数或业务权限。 + +顶部导航在1280px以下采用折叠菜单,控制台侧栏仍使用原有1024px分栏断点。顶部栏内层最小56px,加底边框后为57px;展开导航的粘性偏移使用相同57px,保留控件触达尺寸,不以压缩字号处理英文导航换行。 diff --git a/openspec/changes/improve-my-skills-management/proposal.md b/openspec/changes/improve-my-skills-management/proposal.md index 5df213482..44ff622ba 100644 --- a/openspec/changes/improve-my-skills-management/proposal.md +++ b/openspec/changes/improve-my-skills-management/proposal.md @@ -1,10 +1,10 @@ -# 统一控制台布局并优化“我的技能”管理页面 +# 统一站点布局并优化“我的技能”管理页面 ## Why 现有列表将更新、可见范围和治理动作平铺在卡片中,长名称、状态及元数据容易争抢空间。用户已确认独立卡片、统一筛选面板、权限感知的更多菜单,以及跳转详情、弹窗比较版本的交互方向。 -单页原型落地后,用户进一步确认本轮统一控制台与设置页的共享外壳。控制台首页自行组织侧栏、子页使用不同宽度框架,造成跨页标题和侧栏位置不一致;列表还需覆盖长说明、状态补充提示及稳定多色的默认头像。 +单页原型落地后,用户进一步确认本轮统一控制台、设置与公共页面的站点外壳。控制台首页自行组织侧栏、子页使用不同宽度框架,造成跨页标题和侧栏位置不一致;列表还需覆盖长说明、状态补充提示及稳定多色的默认头像。 ## What Changes @@ -13,10 +13,10 @@ - 保留“更新”主要操作,将次要操作集中到更多菜单,遵守现有服务端权限和状态条件。 - 进入真实技能详情后支持返回列表上下文;版本比较采用居中弹窗。 - 补齐中英文本、键盘操作、窄屏及深色主题验证。 -- 将共享外壳用于控制台首页、带侧栏的管理子页和设置页,统一侧栏、内容起点、中性背景及页头;表单保留阅读宽度、审核详情保留宽版。 +- 站点首页、市场、开源技能、套件、详情、控制台和设置使用统一1440px框架与响应式外边距;导航和页脚同步对齐,移除控制台内的独立宽度模式;内部表单、文章及登录分栏保留合理阅读结构。 - 说明与补充提示按实际内容展示:空简介不占位,有简介最多两行,不为其他卡片的提示预留空区;统一内边距而非强制等高,保留完整权限与审核信息。 - 默认技能头像按稳定标识选取柔和明暗配色,真实上传图片优先;以独立真实技能样例验证长短说明的显示。 ## Impact -调整 Web 控制台与设置页的共享布局、技能卡片及其复用组件、测试和文档。沿用现有接口,不修改数据库、发布审核流程、权限判定和部署配置。市场、搜索、登录和公共技能详情不在本轮重设计范围;发布页保留无侧栏专用流程。PR #1043 的介绍字段缺陷单独处理;本变更不宣称解决该 PR 的业务问题。 +调整 Web 站点公共页面、控制台与设置页的共享布局、技能卡片及其复用组件、测试和文档。沿用现有接口,不修改数据库、发布审核流程、权限判定和部署配置。公共页面本轮仅统一外层宽度、去除重复容器和边距,不重新设计详情内容;登录分栏保留,发布页保持无侧栏专用流程。PR #1043 的介绍字段缺陷单独处理;本变更不宣称解决该 PR 的业务问题。 diff --git a/openspec/changes/improve-my-skills-management/specs/my-skills-management/spec.md b/openspec/changes/improve-my-skills-management/specs/my-skills-management/spec.md index 44f7d4afc..aeb6693ab 100644 --- a/openspec/changes/improve-my-skills-management/specs/my-skills-management/spec.md +++ b/openspec/changes/improve-my-skills-management/specs/my-skills-management/spec.md @@ -61,7 +61,7 @@ #### Scenario: 原型视觉基线与页面职责 - **WHEN** 用户打开“我的技能”列表 - **THEN** 卡片、筛选、标签和图标按设计文档的本页量化视觉基线展示,窄屏保留菜单内更新操作 -- **AND** 控制台与设置页使用统一管理外壳,公共页面及独立发布流程保留各自布局 +- **AND** 控制台、设置和公共页面使用统一站点框架;公共页面与独立发布流程不新增管理侧栏 ### Requirement: REQ-MYS-07 稳定的默认头像配色 系统 SHALL 支持按稳定技能标识选择有限的柔和明暗配色,不在渲染时随机换色,不根据技能名称推断类别。真实上传图片 SHALL 优先于默认头像。 @@ -72,11 +72,11 @@ - **AND** 没有传入新配色选项的既有头像调用保持原有行为 ### Requirement: REQ-DASH-01 共享管理外壳 -系统 SHALL 将控制台首页、带侧栏的管理子页及设置页交由同一外壳提供侧栏、内容起点、背景和页头层级;首页不得再嵌套一套侧栏。设置页 SHALL 采用整体居中收窄的外壳,侧栏与表单一起组织,不能仅限制表单而保留宽内容区;控制台列表仍使用宽版外壳,审核详情可使用声明的宽版模式。 +系统 SHALL 将控制台首页、带侧栏的管理子页及设置页交由同一外壳提供侧栏、内容起点、背景和页头层级;首页不得再嵌套一套侧栏。所有控制台及设置、审核页面 SHALL 使用同一1440px最大宽度与响应式外边距,不设置不同页面宽度模式;内部表单和文章可限制阅读宽度。 #### Scenario: 跨页面切换 - **WHEN** 用户在控制台首页、技能、套件、命名空间、收藏、订阅、Token、审核与设置页面间切换 -- **THEN** 同一宽度模式内侧栏及右侧标题起点保持一致,不因空状态或页面切换重复加边距;设置页采用同一共享外壳的紧凑模式 +- **THEN** 同一视口下侧栏及右侧内容起点保持一致,不因空状态或页面切换重复加边距 - **AND** 窄屏保留现有可操作的控制台导航,宽表格或长内容不能使整页横向溢出 ### Requirement: REQ-DASH-02 导航权限与专用流程保持 @@ -84,5 +84,13 @@ #### Scenario: 不同身份与专用页面 - **WHEN** 普通用户、只读所有者或平台管理身份进入管理页面,或跳转到发布、搜索、登录及公共详情 -- **THEN** 现有权限控制及导航能力保持,发布流程不重复显示侧栏,公共页面不套入管理外壳 +- **THEN** 现有权限控制及导航能力保持,发布流程不重复显示侧栏,公共页面不增加管理侧栏 - **AND** 路由加载期间以一致的已解析路由选择外壳,避免旧内容与新外壳错误组合 + +### Requirement: REQ-SITE-01 统一站点内容框架 +系统 SHALL 为首页各分区正文、技能市场、开源技能、套件、详情、控制台及设置提供同一1440px最大内容框架,使用16px/24px/40px响应式外边距;导航与页脚 SHALL 复用该框架。页面不得叠加重复站点边距或以不同页面最大宽度覆盖共享框架。 + +#### Scenario: 公共页面与控制台切换 +- **WHEN** 用户在首页、市场、开源技能、套件、详情和控制台之间导航 +- **THEN** 同一视口的站点外框宽度、居中与响应式边距一致,首页背景可全幅铺展但正文对齐共享框架 +- **AND** 登录分栏、内部表单及文章阅读宽度保持合理,不因统一外壳而拉伸输入控件或破坏比较弹窗的滚动 diff --git a/openspec/changes/improve-my-skills-management/tasks.md b/openspec/changes/improve-my-skills-management/tasks.md index 7cb431736..2fcc4acc1 100644 --- a/openspec/changes/improve-my-skills-management/tasks.md +++ b/openspec/changes/improve-my-skills-management/tasks.md @@ -23,5 +23,12 @@ ## 人工反馈:内容密度与表单宽度 - [x] 移除空简介与跨卡片补充行占位,保留两行截断及自身提示。 -- [x] 设置页侧栏和内容整体收窄居中;控制台列表、发布及公共详情保持对应布局模式。 +- [x] 完成上一轮设置页收窄方案;该方案被下方“全站统一内容框架”要求替代,不作为最终宽度规则。 - [ ] 真实预览比较空/短/长简介与有无提示卡片,检查桌面及手机设置页布局和滚动。 + +## 人工反馈:全站统一内容框架 + +- [x] 取消设置与审核的独立宽度,统一全部控制台外壳。 +- [x] 统一首页/市场/开源技能/套件/详情的外层框架及导航、页脚。 +- [x] 清理页面重复水平边距,保留内部阅读宽度和专用交互布局。 +- [ ] 真实浏览器检查桌面及手机站点框架、导航与设置/控制台切换。 diff --git a/web/src/app/layout-console.test.tsx b/web/src/app/layout-console.test.tsx index 8cd4ea687..a59e0ec73 100644 --- a/web/src/app/layout-console.test.tsx +++ b/web/src/app/layout-console.test.tsx @@ -1,6 +1,6 @@ /** @vitest-environment jsdom */ import type { ReactNode } from 'react' -import { cleanup, render, screen, within } from '@testing-library/react' +import { cleanup, fireEvent, render, screen, within } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' let pathname = '/dashboard' @@ -23,6 +23,7 @@ vi.mock('@/shared/components/theme-toggle', () => ({ ThemeToggle: () => null })) vi.mock('@/shared/components/user-menu', () => ({ UserMenu: () => null })) vi.mock('@/features/notification/notification-bell', () => ({ NotificationBell: () => null })) +import { APP_FRAME_CLASS_NAME } from '@/shared/lib/layout-frame' import { Layout } from './layout' beforeEach(() => { pathname = '/dashboard'; resolvedPathname = pathname; roles = []; canChangePassword = false }) @@ -45,6 +46,54 @@ describe('shared console layout composition', () => { expect(screen.queryByRole('complementary')).toBeNull() }) + it.each(['/search', '/github', '/suites', '/settings/profile', '/dashboard/reviews/42', '/dashboard/publish'])('aligns the header, main frame and footer on %s', (path) => { + pathname = path + resolvedPathname = path + render() + for (const frame of [ + screen.getByRole('banner').firstElementChild, + screen.getByRole('main').firstElementChild, + screen.getByRole('contentinfo').firstElementChild, + ]) { + for (const token of APP_FRAME_CLASS_NAME.split(' ')) { + expect(frame?.classList.contains(token)).toBe(true) + } + } + expect(screen.getByRole('banner').classList.contains('max-w-[1440px]')).toBe(false) + }) + + it('keeps global navigation collapsible on intermediate screens without changing the console breakpoint', () => { + render() + const header = screen.getByRole('banner') + const desktopNavigation = within(header).getByRole('navigation') + const toggle = within(header).getByRole('button', { name: 'layout.openNavigation' }) + expect(desktopNavigation.classList.contains('xl:flex')).toBe(true) + expect(desktopNavigation.classList.contains('lg:flex')).toBe(false) + expect(toggle.classList.contains('xl:hidden')).toBe(true) + fireEvent.click(toggle) + const expandedNavigation = screen.getAllByRole('navigation') + .find(navigation => navigation.parentElement?.classList.contains('sticky')) + expect(expandedNavigation?.parentElement?.classList.contains('xl:hidden')).toBe(true) + expect(screen.getByRole('complementary').classList.contains('lg:w-56')).toBe(true) + }) + + it('preserves mobile navigation and frames the expanded menu consistently', () => { + render() + const toggle = screen.getByRole('button', { name: 'layout.openNavigation' }) + fireEvent.click(toggle) + expect(toggle.getAttribute('aria-expanded')).toBe('true') + const mobileLink = screen.getAllByRole('link', { name: 'nav.marketplace' }) + .find(link => link.parentElement?.classList.contains('flex-col')) + expect(mobileLink).toBeTruthy() + for (const token of APP_FRAME_CLASS_NAME.split(' ')) { + expect(mobileLink?.parentElement?.classList.contains(token)).toBe(true) + } + // Routing is mocked here; exercise the menu callback without jsdom document navigation. + mobileLink!.addEventListener('click', event => event.preventDefault(), { once: true }) + fireEvent.click(mobileLink!) + expect(toggle.getAttribute('aria-expanded')).toBe('false') + }) + it('retains role and account-capability filtering in the centralized sidebar', () => { const view = render() const sidebar = screen.getByRole('complementary') @@ -62,17 +111,16 @@ describe('shared console layout composition', () => { expect(within(sidebar).getByText('sidebar.githubSync')).toBeTruthy() }) - it('keeps the settings frame until the wider dashboard route resolves', () => { + it('keeps a single frame while settings-to-dashboard navigation resolves', () => { pathname = '/dashboard/skills' resolvedPathname = '/settings/profile' const view = render() const main = screen.getByRole('main') - expect(main.firstElementChild?.classList.contains('max-w-[1072px]')).toBe(true) + expect(main.firstElementChild?.classList.contains('max-w-[1440px]')).toBe(true) expect(within(screen.getByRole('complementary')).getByRole('link', { name: 'sidebar.profile' }).classList.contains('bg-accent')).toBe(true) resolvedPathname = pathname view.rerender() expect(main.firstElementChild?.classList.contains('max-w-[1440px]')).toBe(true) - expect(main.firstElementChild?.classList.contains('max-w-[1072px]')).toBe(false) expect(screen.getAllByRole('complementary')).toHaveLength(1) }) diff --git a/web/src/app/layout-header-style.test.ts b/web/src/app/layout-header-style.test.ts index 11ed5c926..ec9ffec33 100644 --- a/web/src/app/layout-header-style.test.ts +++ b/web/src/app/layout-header-style.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest' -import { APP_HEADER_ELEVATED_CLASS_NAME, getAppHeaderClassName } from './layout-header-style' +import { APP_FRAME_CLASS_NAME } from '@/shared/lib/layout-frame' +import { APP_HEADER_CONTENT_CLASS_NAME, APP_HEADER_ELEVATED_CLASS_NAME, getAppHeaderClassName } from './layout-header-style' describe('getAppHeaderClassName', () => { it('keeps the header flat before the page starts scrolling', () => { @@ -10,6 +11,13 @@ describe('getAppHeaderClassName', () => { expect(className).not.toContain('bg-white') }) + it('keeps the header background full bleed and its controls inside the common frame', () => { + expect(APP_HEADER_CONTENT_CLASS_NAME).toContain(APP_FRAME_CLASS_NAME) + expect(APP_HEADER_CONTENT_CLASS_NAME).toContain('min-h-[56px]') + expect(getAppHeaderClassName(false)).not.toContain('max-w-') + expect(getAppHeaderClassName(false)).not.toMatch(/\b(?:sm:|md:|lg:)?px-/) + }) + it('adds a subtle drop shadow after the header becomes sticky', () => { expect(getAppHeaderClassName(true)).toContain(APP_HEADER_ELEVATED_CLASS_NAME) }) diff --git a/web/src/app/layout-header-style.ts b/web/src/app/layout-header-style.ts index 4c1d420b5..2600c746b 100644 --- a/web/src/app/layout-header-style.ts +++ b/web/src/app/layout-header-style.ts @@ -1,7 +1,10 @@ import { cn } from '@/shared/lib/utils' +import { APP_FRAME_CLASS_NAME } from '@/shared/lib/layout-frame' export const APP_HEADER_BASE_CLASS_NAME = - 'sticky top-0 z-50 flex items-center justify-between border-b border-border/30 bg-background/70 px-4 py-2.5 backdrop-blur-xl transition-[background-color,border-color,box-shadow] duration-150 supports-[backdrop-filter]:bg-background/60 sm:px-6 md:px-12 min-h-[52px]' + 'sticky top-0 z-50 border-b border-border/30 bg-background/70 backdrop-blur-xl transition-[background-color,border-color,box-shadow] duration-150 supports-[backdrop-filter]:bg-background/60' + +export const APP_HEADER_CONTENT_CLASS_NAME = `${APP_FRAME_CLASS_NAME} flex min-h-[56px] items-center justify-between py-2.5` export const APP_HEADER_ELEVATED_CLASS_NAME = 'border-b border-border/30 shadow-[0_1px_2px_0_rgb(0_0_0/0.04)]' diff --git a/web/src/app/layout-main-content.test.ts b/web/src/app/layout-main-content.test.ts index 842c9c93e..4a029effe 100644 --- a/web/src/app/layout-main-content.test.ts +++ b/web/src/app/layout-main-content.test.ts @@ -1,13 +1,10 @@ import { describe, expect, it } from 'vitest' +import { APP_FRAME_CLASS_NAME } from '@/shared/lib/layout-frame' import { - AUTH_MAIN_CLASS_NAME, - PUBLISH_CONTENT_CLASS_NAME, - CENTERED_MAIN_CLASS_NAME, - CENTERED_SEARCH_CONTENT_CLASS_NAME, DEFAULT_MAIN_CLASS_NAME, + DEFAULT_CONTENT_CLASS_NAME, CONSOLE_MAIN_CLASS_NAME, CONSOLE_CONTENT_CLASS_NAME, - SETTINGS_CONTENT_CLASS_NAME, CONSOLE_SIDEBAR_ROW_CLASS_NAME, CONSOLE_SIDEBAR_CONTENT_CLASS_NAME, SPLIT_AUTH_MAIN_CLASS_NAME, @@ -16,81 +13,50 @@ import { } from './layout-main-content' describe('getAppMainContentLayout', () => { - it('keeps the landing page full width without the app-shell padding wrapper', () => { + it('lets landing sections keep full-bleed backgrounds and frame their content internally', () => { expect(getAppMainContentLayout('/')).toEqual({ mainClassName: 'flex-1 relative z-10', contentClassName: '', }) }) - it('centers the search page content with roomier responsive gutters', () => { - const layout = getAppMainContentLayout('/search') - - expect(layout).toEqual({ - mainClassName: CENTERED_MAIN_CLASS_NAME, - contentClassName: CENTERED_SEARCH_CONTENT_CLASS_NAME, + it.each([ + '/search', '/github', '/suites', '/suites/team/example', '/space/acme/demo', + '/space/acme/demo/compare', '/namespaces/acme', '/notifications', '/privacy', + '/reset-password', '/device', '/dashboard/publish', + ])('gives %s the shared public frame without console navigation', (pathname) => { + expect(getAppMainContentLayout(pathname)).toEqual({ + mainClassName: DEFAULT_MAIN_CLASS_NAME, + contentClassName: DEFAULT_CONTENT_CLASS_NAME, }) - expect(layout.contentClassName).toContain('max-w-[1200px]') + expect(getAppMainContentLayout(pathname).contentClassName).toContain(APP_FRAME_CLASS_NAME) }) - it.each(['/dashboard', '/dashboard/skills', '/dashboard/tokens', '/dashboard/stars', '/dashboard/namespaces', '/dashboard/suites', '/dashboard/reviews', '/dashboard/governance'])('shares the console frame and sidebar gutters on %s', (pathname) => { + it.each([ + '/dashboard', '/dashboard/skills', '/dashboard/tokens', '/dashboard/stars', + '/dashboard/namespaces', '/dashboard/suites', '/dashboard/reviews', '/dashboard/governance', + '/settings/profile', '/settings/security', '/settings/notifications', '/settings/accounts', + '/dashboard/reviews/42', '/dashboard/namespaces/team/reviews/42', + ])('shares the same console frame and sidebar gutters on %s', (pathname) => { expect(getAppMainContentLayout(pathname)).toEqual({ mainClassName: CONSOLE_MAIN_CLASS_NAME, contentClassName: CONSOLE_CONTENT_CLASS_NAME, sidebarRowClassName: CONSOLE_SIDEBAR_ROW_CLASS_NAME, sidebarContentClassName: CONSOLE_SIDEBAR_CONTENT_CLASS_NAME, }) + expect(getAppMainContentLayout(pathname).contentClassName).toContain(APP_FRAME_CLASS_NAME) }) - it.each(['/settings/profile', '/settings/security', '/settings/notifications', '/settings/accounts'])('centers %s inside a compact sidebar-and-form frame', (pathname) => { + it('uses one responsive gutter instead of adding a second set around console content', () => { + expect(APP_FRAME_CLASS_NAME).toContain('max-w-[1440px]') + expect(APP_FRAME_CLASS_NAME).toContain('px-4 sm:px-6 lg:px-10') + expect(CONSOLE_SIDEBAR_CONTENT_CLASS_NAME).not.toMatch(/\b(?:lg:)?px-/) + expect(CONSOLE_SIDEBAR_CONTENT_CLASS_NAME).toContain('lg:pl-10') + }) + + it.each(['/login', '/register'])('preserves the separate split-auth composition on %s', (pathname) => { expect(getAppMainContentLayout(pathname)).toEqual({ - mainClassName: CONSOLE_MAIN_CLASS_NAME, - contentClassName: SETTINGS_CONTENT_CLASS_NAME, - sidebarRowClassName: CONSOLE_SIDEBAR_ROW_CLASS_NAME, - sidebarContentClassName: CONSOLE_SIDEBAR_CONTENT_CLASS_NAME, - pageClassName: 'w-full max-w-3xl', - }) - }) - - it('fits the settings sidebar, desktop gutters and readable form without trailing content space', () => { - expect(SETTINGS_CONTENT_CLASS_NAME).toContain('mx-auto') - expect(SETTINGS_CONTENT_CLASS_NAME).toContain('max-w-[1072px]') - expect(CONSOLE_CONTENT_CLASS_NAME).toContain('max-w-[1440px]') - }) - - it('keeps publishing a standalone flow without console navigation', () => { - expect(getAppMainContentLayout('/dashboard/publish')).toEqual({ - mainClassName: CENTERED_MAIN_CLASS_NAME, - contentClassName: PUBLISH_CONTENT_CLASS_NAME, - }) - }) - - it.each(['/dashboard/reviews/42', '/dashboard/namespaces/team/reviews/42'])('retains a wider console frame for %s', (pathname) => { - expect(getAppMainContentLayout(pathname).contentClassName).toContain('max-w-[1500px]') - expect(getAppMainContentLayout(pathname).sidebarRowClassName).toBe(CONSOLE_SIDEBAR_ROW_CLASS_NAME) - }) - - it('uses the full-bleed split layout for login and registration', () => { - for (const pathname of ['/login', '/register']) { - expect(getAppMainContentLayout(pathname)).toEqual({ - mainClassName: SPLIT_AUTH_MAIN_CLASS_NAME, - contentClassName: '', - }) - } - }) - - it('keeps the compact entry layout for password reset', () => { - for (const pathname of ['/reset-password']) { - expect(getAppMainContentLayout(pathname)).toEqual({ - mainClassName: AUTH_MAIN_CLASS_NAME, - contentClassName: '', - }) - } - }) - - it('leaves other non-landing routes on the default full-width app content layout', () => { - expect(getAppMainContentLayout('/space/acme/demo')).toEqual({ - mainClassName: DEFAULT_MAIN_CLASS_NAME, + mainClassName: SPLIT_AUTH_MAIN_CLASS_NAME, contentClassName: '', }) }) diff --git a/web/src/app/layout-main-content.ts b/web/src/app/layout-main-content.ts index ed632f6e9..9d2839287 100644 --- a/web/src/app/layout-main-content.ts +++ b/web/src/app/layout-main-content.ts @@ -1,17 +1,13 @@ +import { APP_FRAME_CLASS_NAME } from '@/shared/lib/layout-frame' + export const LANDING_MAIN_CLASS_NAME = 'flex-1 relative z-10' export const SPLIT_AUTH_MAIN_CLASS_NAME = 'flex-1 relative z-10' -export const AUTH_MAIN_CLASS_NAME = 'flex-1 relative z-10 px-4 pb-4 sm:px-6 md:px-8' -export const DEFAULT_MAIN_CLASS_NAME = 'flex-1 relative z-10 px-6 py-10 md:px-12' -export const CENTERED_MAIN_CLASS_NAME = 'flex-1 relative z-10 px-4 py-8 sm:px-6 md:px-12 md:py-10' -export const CENTERED_SEARCH_CONTENT_CLASS_NAME = 'mx-auto w-full max-w-[1200px]' -export const PUBLISH_CONTENT_CLASS_NAME = 'mx-auto min-h-[calc(100vh-11rem)] w-full max-w-[1100px]' +export const DEFAULT_MAIN_CLASS_NAME = 'flex-1 relative z-10' +export const DEFAULT_CONTENT_CLASS_NAME = `${APP_FRAME_CLASS_NAME} py-8 lg:py-10` export const CONSOLE_MAIN_CLASS_NAME = 'flex-1 relative z-10 bg-background' -export const CONSOLE_CONTENT_CLASS_NAME = 'mx-auto min-h-[calc(100vh-11rem)] w-full max-w-[1440px]' -// 224px sidebar + 80px desktop gutters + 768px readable settings form. -export const SETTINGS_CONTENT_CLASS_NAME = 'mx-auto min-h-[calc(100vh-11rem)] w-full max-w-[1072px]' -export const CONSOLE_SIDEBAR_ROW_CLASS_NAME = 'flex flex-col lg:flex-row gap-0 [&>aside]:p-4 lg:[&>aside]:px-5 lg:[&>aside]:pt-8 lg:[&>aside]:pb-6 lg:[&>aside]:border-r lg:[&>aside]:border-border/40' -export const CONSOLE_SIDEBAR_CONTENT_CLASS_NAME = 'flex-1 min-w-0 px-4 pb-7 pt-[18px] lg:px-10 lg:pt-9' -export const REVIEW_DETAIL_CONTENT_CLASS_NAME = 'mx-auto min-h-[calc(100vh-11rem)] w-full max-w-[1500px]' +export const CONSOLE_CONTENT_CLASS_NAME = `${APP_FRAME_CLASS_NAME} min-h-[calc(100vh-11rem)]` +export const CONSOLE_SIDEBAR_ROW_CLASS_NAME = 'flex flex-col lg:flex-row gap-0 [&>aside]:py-4 lg:[&>aside]:pr-5 lg:[&>aside]:pt-8 lg:[&>aside]:pb-6 lg:[&>aside]:border-r lg:[&>aside]:border-border/40' +export const CONSOLE_SIDEBAR_CONTENT_CLASS_NAME = 'flex-1 min-w-0 pb-7 pt-[18px] lg:pl-10 lg:pt-9' export const DASHBOARD_PATH_PREFIXES = ['/dashboard', '/settings/'] as const export const AUTH_ENTRY_PATHS = ['/login', '/register', '/reset-password'] as const @@ -22,7 +18,6 @@ interface AppMainContentLayout { contentClassName: string sidebarRowClassName?: string sidebarContentClassName?: string - pageClassName?: string } export function resolveAppMainContentPathname( @@ -33,56 +28,29 @@ export function resolveAppMainContentPathname( } export function getAppMainContentLayout(pathname: string): AppMainContentLayout { + // Landing sections own full-bleed backgrounds and use the shared frame internally. if (pathname === '/') { - return { - mainClassName: LANDING_MAIN_CLASS_NAME, - contentClassName: '', - } + return { mainClassName: LANDING_MAIN_CLASS_NAME, contentClassName: '' } } + // Preserve the separate split-auth composition and its compact form. if (SPLIT_AUTH_PATHS.includes(pathname as typeof SPLIT_AUTH_PATHS[number])) { - return { - mainClassName: SPLIT_AUTH_MAIN_CLASS_NAME, - contentClassName: '', - } + return { mainClassName: SPLIT_AUTH_MAIN_CLASS_NAME, contentClassName: '' } } - if (AUTH_ENTRY_PATHS.includes(pathname as typeof AUTH_ENTRY_PATHS[number])) { - return { - mainClassName: AUTH_MAIN_CLASS_NAME, - contentClassName: '', - } - } - - if (pathname === '/search') { - return { - mainClassName: CENTERED_MAIN_CLASS_NAME, - contentClassName: CENTERED_SEARCH_CONTENT_CLASS_NAME, - } - } - - // Publishing is a standalone flow and intentionally has no console sidebar. - if (pathname === '/dashboard/publish') { - return { - mainClassName: CENTERED_MAIN_CLASS_NAME, - contentClassName: PUBLISH_CONTENT_CLASS_NAME, - } - } - - if (pathname === '/dashboard' || pathname.startsWith('/dashboard/') || pathname.startsWith('/settings/')) { - const isSettings = pathname.startsWith('/settings/') - const isReviewDetail = /^\/dashboard\/(?:reviews\/[^/]+|namespaces\/[^/]+\/reviews\/[^/]+)$/.test(pathname) + if (pathname !== '/dashboard/publish' && ( + pathname === '/dashboard' || pathname.startsWith('/dashboard/') || pathname.startsWith('/settings/') + )) { return { mainClassName: CONSOLE_MAIN_CLASS_NAME, - contentClassName: isSettings ? SETTINGS_CONTENT_CLASS_NAME : isReviewDetail ? REVIEW_DETAIL_CONTENT_CLASS_NAME : CONSOLE_CONTENT_CLASS_NAME, + contentClassName: CONSOLE_CONTENT_CLASS_NAME, sidebarRowClassName: CONSOLE_SIDEBAR_ROW_CLASS_NAME, sidebarContentClassName: CONSOLE_SIDEBAR_CONTENT_CLASS_NAME, - ...(isSettings ? { pageClassName: 'w-full max-w-3xl' } : {}), } } return { mainClassName: DEFAULT_MAIN_CLASS_NAME, - contentClassName: '', + contentClassName: DEFAULT_CONTENT_CLASS_NAME, } } diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index 1d8464f2e..aae20df57 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -12,7 +12,8 @@ import { dismissOpenOverlays } from '@/shared/lib/dismiss-open-overlays' import { syncDocumentLanguage } from '@/shared/lib/document-language' import { DashboardSidebar, SIDEBAR_GROUPS } from '@/pages/dashboard' import { canViewGovernanceCenter } from '@/shared/lib/governance-access' -import { getAppHeaderClassName } from './layout-header-style' +import { APP_HEADER_CONTENT_CLASS_NAME, getAppHeaderClassName } from './layout-header-style' +import { APP_FRAME_CLASS_NAME } from '@/shared/lib/layout-frame' import { AUTH_ENTRY_PATHS, SPLIT_AUTH_PATHS, getAppMainContentLayout, resolveAppMainContentPathname } from './layout-main-content' const FOOTER_LINK_CLASS_NAME = 'group relative inline-flex py-0.5 transition-colors duration-150 hover:text-foreground focus-visible:outline-none focus-visible:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-secondary after:absolute after:inset-x-0 after:-bottom-0.5 after:h-px after:origin-left after:scale-x-0 after:bg-foreground/60 after:transition-transform after:duration-200 hover:after:scale-x-100 motion-reduce:after:transition-none' @@ -121,15 +122,16 @@ export function Layout() { className={isSplitAuthRoute ? 'absolute right-5 top-4 z-50 flex items-center sm:right-10' : getAppHeaderClassName(isHeaderElevated)} style={isSplitAuthRoute ? undefined : { borderColor: 'hsl(var(--border))' }} > +
{!isSplitAuthRoute ? ( SkillHub ) : null} - {/* Desktop nav — lg+ only */} + {/* Desktop nav — xl+ leaves room for localized labels and account controls. */} {!isAuthEntryRoute ? ( -
{/* Mobile nav dropdown */} {mobileMenuOpen && !isAuthEntryRoute ? ( -
-