Repository navigation
classic 居中模型更正:整块居中 + 末行左对齐(#35 口径更正) - #50
Merged
todosdev[bot] merged 2 commits intoNov 8, 2026
Merged
Conversation
added 2 commits
November 8, 2026 22:44
classic 容器从 justify-center 改为 justify-start:满行仍由 mx-auto + 内联 maxWidth 整块居中,不满的末行从行组左端起排、与满行同列;columns 语义 由「每行上限」更正为「成块列数」,相关注释、后台字段文案与测试同步。
自测截图与证据页不进仓库,按纪律 §1 从提交中删除;功能改动不变。
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
justify-center换成justify-start,满行仍由mx-auto+ 内联maxWidth居中,不满列数的末行砖从行组左端起排、与满行同列对齐。columns语义随之由「每行上限」更正为「成块列数」(桌面按该数成块、整块居中;窄屏放不下整块时一行自然少放几块),代码注释、后台字段文案与测试断言同步更正。classicGridMetrics的 maxWidth/columnGap 算法、编辑模式、dnd-kit 策略、compact/wide 两档、后端接口全部不变。Changes
web/src/components/link-grid.tsx—LINK_GRID_CLASS.classic改为mx-auto flex w-full flex-wrap content-start justify-start gap-y-3;容器与排布模型注释改写为「整块居中 + 末行左对齐」的说明。web/src/lib/grid-columns.ts— 仅注释:columns改述为成块列数、补充窄屏降每行个数与末行左对齐的归属(由 flex 容器负责,此文件只算数字);DEFAULT_COLUMNS/CLASSIC_TILE_SIZE/classicGridMetrics/resolveColumns逻辑一行未动。web/src/components/admin/settings-panels.tsx— classic 专属字段文案:label 改为「每行卡片数(1–12)」,说明改为「卡片是固定方砖,桌面按这个数排成一块并整体居中;屏幕变窄时一行会少于这个数。」;隐藏/回显逻辑不变。web/src/components/home-edit-board.tsx、web/src/components/public-page.tsx— 注释同步(成块列数、整块居中 + 末行左对齐),无行为改动。link-grid.test.tsx断言justify-start且显式断言不含justify-center,描述与用例名改为成块列数口径;settings-panels.test.tsx跟随新 label 与说明文案;public-page.test.tsx、grid-columns.test.ts仅描述文字更正。Testing
pnpm lint(退出码 0,33 条 warning 与主干一致、无新增)、pnpm format:check、pnpm typecheck、pnpm build、pnpm test(worker 214 项 + web 343 项)全部通过。build:web后由 worker 托管,本地 workerd + 真实 D1 种子(1 个分类 10 条链接),Chrome 158 用 CDP 量getBoundingClientRect()/getComputedStyle():columns=4、1440 视口下容器justify-content: flex-start、行组 710px 在内容区 112–1328 内居中(中心偏移 0px),三行 4/4/2 块且三段都从 x=365 起排(末行与满行同列)、砖 141.5px、间距 47.98px;columns=8回归:行组 1216px 占满内容区、首行 8 块间距 12、末行从 x=112 起排。scrollWidth = clientWidth = 390(不溢出)。workflow_dispatch补跑,Lint / Format check / Type check / Build / Test 全绿。