Repository navigation
feat(client): 列内滚动时,把项目分组头钉在列的顶部 - #47
Merged
Merged
Conversation
cloader
added a commit
that referenced
this pull request
Oct 14, 2026
Add the bilingual 0.8.9 changelog section for the merged PR #47 (sticky project group headers with an opaque three-layer fill, credited to @MoruTeaven) and sync the board feature bullet plus the in-README upgrade logs in both locales.
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.
概述
列内滚动时,把项目分组头钉在列的顶部。
看板每一列的列头(待办 / 进行中 / 待验收 + 数量)位于滚动容器之外,本身不会滚走;但列内的项目分组头(
📁 项目名)会跟着卡片一起滚上去。列一长,正在看的项目名就先离开屏幕,剩下的卡片看不出属于哪个项目。本次改动让分组头在列内滚动时吸顶;下一组到达顶部时把它顶走(sticky 的标准表现),因此不会出现「头显示 A 组、下面是 B 组卡片」的误导。
实测数据
用 Edge 驱动真实 DOM 测量第一列各分组头相对滚动容器顶部的偏移(单位 px,
@2= 贴在容器顶部,负值 = 已滚出):改动
src/client/styles.ts(.dsh-atb-ws-group-head,14 行):position: sticky; top: 0; z-index: 2--dsw-alias-bg-base打底 + 列的 inset + hover 染色)精确复现该行背后的实际颜色,卡片从下方滑过时不会透出文字。原来的rgba(128,128,128,.08)半透明色在吸顶后会透字。tests/sticky-group-head.spec.ts(新增):断言两件容易静默回归的事——.dsh-atb-cards。若分组头被移到容器外,或中间插入带overflow: hidden/transform的祖先,sticky 会静默失效退化成普通行,而仅断言样式文本的测试抓不到这一点。position: sticky/top: 0存在,且底色带不透明基色。lib/client.js:仓库约定提交预构建产物(GitHub 源安装免构建),已npm run build重建。验证
npx tsc --noEmit通过npx vitest run全量 408 个测试通过(30 个文件)position: sticky改回static,测试如期失败;恢复后通过备注
未改动 changelog:当前 0.8.8 为已发布版本,按仓库惯例发版文案由维护者统一整理。若需要我在某个 dev 条目下补一条,告诉我即可。
Summary (English)
Pins the project group header (
📁 <project>) to the top of each column's card scroller.The column head itself (待办 / 进行中 / 待验收 + count) never scrolls — it sits outside the scroller. What did scroll away was the project row, so on a long column the project label left the screen first and the remaining cards lost their grouping context.
The header now sticks; the next group pushes it out (standard sticky behaviour), so it never mislabels the cards beneath it.
Change —
src/client/styles.ts:position: sticky; top: 0; z-index: 2plus an opaque fill. Three stacked layers (board base + column inset + hover tint) reproduce exactly what sits behind the row, so cards sliding underneath never bleed through; the previous semi-transparentrgba(128,128,128,.08)would show text through once pinned.Test —
tests/sticky-group-head.spec.tsasserts (1) the sticky element's ancestor chain actually contains the scroll container (a header moved outside it, or anoverflow: hidden/transformancestor in between, silently degrades sticky to a normal row — a stylesheet-text-only assertion would miss it) and (2) the rule carries sticky + an opaque base. Verified the test fails when sticky is reverted tostatic.Verified —
tsc --noEmitclean; full suite 408 passed / 30 files; measured before/after offsets in a real browser (table above); screenshots checked in both themes. No changelog edit (0.8.8 is already released; the repo's convention is for the maintainer to write release notes).