Repository navigation
feat(web): 站点标题左侧加菱形环单色标 - #43
Merged
Merged
Conversation
新建 SiteLogo 内联 SVG 组件(evenodd 挖空菱形环,fill 走 currentColor, 亮/暗共用一份,aria-hidden 不进可访问名)。桌面侧栏与移动抽屉页头两处 NavLink 前插标,className 加 gap-2 并改为 inline-flex 对齐。App.test.tsx 补两处断言:品牌链接内含装饰性 svg、抽屉内同名链接同样带标。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/workbench的链接内,因此点击 Logo 和点击标题一样会回到主页。currentColor,因此亮/暗共用一份,不加dark:变体,也没有引入任何新依赖。Changes
web/src/components/site-logo.tsx(新建)SiteLogo组件:viewBox="0 0 24 24";fillRule="evenodd"让外菱形挖掉内菱形,形成环;fill="currentColor"放在 svg 根上,path 不写fill。aria-hidden="true"+focusable="false",可访问名仍只来自旁边的站名;默认size-5 shrink-0,需要时由调用方通过cn覆盖。web/src/components/app-shell.tsxSidebarHeader的NavLink:在{name}前插入<SiteLogo />,className 增加gap-2。原有group-data-[collapsible=icon]:hidden保留:收起成图标栏时,Logo 随标题一起消失(图标栏顶部独立 logo 属于第 2 项,不在本 PR 范围内)。SheetHeader > SheetTitle的NavLink:同样插入 Logo,并新增inline-flex items-center gap-2;不加的话 svg 与文字在 RadixSheetTitle里会基线错位。web/src/App.test.tsxsvg[aria-hidden=true],href仍是/workbench。菜单打开抽屉,在 dialog 内断言同名链接同样带 Logo。Testing
pnpm test:121 passed / 18 files。两处新断言做过反向验证:分别移除桌面、抽屉的<SiteLogo />,对应用例各失败一次。pnpm typecheck、pnpm lint、pnpm format:check、pnpm check:identity、pnpm build、pnpm check:deploy --dry-run全部通过(chunk >500kB 的体积警告在本 PR 之前就已存在)。1b1b548上通过。web/dist+ 桩 API,Chrome CDP 真实点击/真实悬停),逐项实测:viewBox="0 0 24 24"、aria-hidden=true、focusable=false、fill与链接color完全一致(currentColor生效)、gap: 8px(gap-2)、与文字在左侧同一条中线上(Logo 右缘 36 / 文字左缘 44)。fill-rule=evenodd、path 上没有fill、d包含 2 个子路径;实测包围盒为 19×19,确认确实成环,不是实心块。oklch(0.145 0 0),在浅色背景上清晰;暗色:root.dark下 Logo 为oklch(0.985 0 0),落在oklch(0.145 0 0)深色背景上,同样清楚。oklch(0.97 0 0)、文字转为oklch(0.205 0 0),Logo 随之同步变色(svgFill === linkColor)。/about点击 svg 本体 →/workbench。inline-flex与文字同中线、aria-hidden保持。与既有告警的关系
biome check在web/src/App.test.tsx:3:1、web/src/components/app-shell.tsx:1:1报两条assist/source/organizeImports;经核对,这两个文件在origin/main(144f9d4)上同样会报,且行号一致,因此不是本 PR 引入的。pnpm lint跑的是biome lint,不包含该 assist,CI 不会因此拦截;清理工作另开待办 #12,不混进本 PR。