Repository navigation
普通模式图标统一 contain 缩放(视觉尺寸一致) - #46
Merged
todosdev[bot] merged 2 commits intoNov 8, 2026
Merged
Conversation
三档图标盒边长收敛到 LINK_ICON_BOX(classic 44 / wide 36 / compact 20), 图标用 fill 撑满盒子并 object-contain,圆角与透明底不变;编辑模式复用同一内容组件自动受益。 补 4 条测试钉住「同档盒子尺寸一致、图标撑满盒子」。 Checkpoint: _9SfrP8NSu_6cCN377Ekf
…3-7c8a-ae1a-451f2220b3d1 # Conflicts: # web/src/components/link-grid.tsx
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
LINK_ICON_BOX单一出处(classic 44 / wide 36 / compact 20),同档内每个链接的盒子完全一致,图标在盒内object-contain等比缩放完整显示,不拉伸、不裁切。rounded-md,8px)与透明底沿用原样式,首字圆回退同样填满盒子;后台列表、搜索框等处的小图标尺寸不变。首页编辑模式复用同一内容组件,自动受益。object-contain+ 固定盒子在线上打包产物里本就生效(已用线上 bundle 与真实浏览器核对),所以这次是把「图标元素自带宽高」改成「盒子定尺寸、图标填满盒子」的结构化收敛,页面视觉不变——同一排图标的外接尺寸继续保持一致,剩余观感差异来自各站图标文件本身(横版 logo),按用户决定保持完整显示、不裁切。Changes
web/src/components/link-grid.tsx:新增LINK_ICON_BOX(三档边长的单一出处)与LinkIcon图标盒(data-icon-box标记、固定宽高、居中),classic / compact / wide 三档的图标统一走它;与主干已有的singleLine截断、showUrl显示网址开关并存,行为不变。web/src/components/site-icon.tsx:新增fill用法——盒子定尺寸时图标用size-full撑满盒子、不再写内联宽高,仍保留object-contain、rounded-md与首字圆回退;缺省的size用法行为完全不变。web/test/link-grid.test.tsx、web/test/site-icon.test.tsx:新增 4 条用例钉住「三档盒子尺寸等于LINK_ICON_BOX、同档每条一致」「fill不写内联宽高且保留 contain / 圆角」「首字圆也填满盒子」。Testing
pnpm lint(0 错误;34 条 warning 全在既有components/ui/*,非本次文件)、pnpm format:check、pnpm typecheck、pnpm test(worker 214 条、web 322 条全过)、pnpm build全绿。44x44、36x36、20x20,object-fit均为contain,圆角 8px;改动前后页面总高均 982px(零布局位移),逐像素比较 PSNR 45.5dB(差异仅来自抗锯齿)。