Add frozen: 'start' | 'end' for end-edge column pinning#4034
Add frozen: 'start' | 'end' for end-edge column pinning#4034PaloSP wants to merge 2 commits intoComcast:mainfrom
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4034 +/- ##
==========================================
+ Coverage 97.49% 97.54% +0.05%
==========================================
Files 38 38
Lines 1516 1548 +32
Branches 486 499 +13
==========================================
+ Hits 1478 1510 +32
Misses 38 38
🚀 New features to boost your workflow:
|
amanmahajan7
left a comment
There was a problem hiding this comment.
Thank you for the PR. A few quick comments. I can do a detailed review in 2 weeks (on a vacation)
| } | ||
|
|
||
| const frozen = rawColumn.frozen ?? false; | ||
| const frozen: boolean | 'start' | 'end' = rawColumn.frozen ?? false; |
There was a problem hiding this comment.
Let's add a type and reuse it
|
|
||
| export const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`; | ||
|
|
||
| export const cellFrozenEnd = css` |
There was a problem hiding this comment.
We can reuse the cellFrozen class
| `; | ||
|
|
||
| // Add shadow before the first end-frozen cell (mirror of the start shadow) | ||
| export const frozenColumnShadowEndClassname = css` |
There was a problem hiding this comment.
Let's extract the common styles in frozenColumnShadowClassname and we can add frozenColumnShadowStart/EndClassname
| import { css } from 'ecij'; | ||
|
|
||
| import { cellFrozen } from './cell'; | ||
| import { cellFrozen, cellFrozenEnd } from './cell'; |
There was a problem hiding this comment.
We should rename it to be consistent
| import { cellFrozen, cellFrozenEnd } from './cell'; | |
| import { cellFrozenStart, cellFrozenEnd } from './cell'; |
| border-inline-start: var(--rdg-selection-width) solid var(--rdg-selection-color); | ||
| } | ||
|
|
||
| & > .${cellFrozenEnd}:last-child::after { |
There was a problem hiding this comment.
same here, let's dedupe
& > .${cellFrozen}:first-child::before,
& > .${cellFrozenEnd}:last-child::after { }
& > .${cellFrozen}:first-child::before { }
& > .${cellFrozenEnd}:last-child::after { }
5943b18 to
5016075
Compare
|
@amanmahajan7 pushed a revision addressing all 5 comments. On comment 4: intentional divergence from the literal suggestion. Comment 2's dedup removed the separate Two open questions, both breaking — your call:
Both currently kept as-is (non-breaking). No rush — enjoy the vacation. |
Adds right-edge column pinning — long-standing ask (#2873, #3671).
Column.frozenwidens toboolean | 'start' | 'end'.truestays an alias for'start'(backwards compatible).'end'pins to the inline-end edge; symmetric infra:--rdg-frozen-end-${idx}CSS var,rdg-cell-frozen-endclass, end-shadow + top/bottom-summary variants, logical properties throughout.Credit to @robert-luoqing for #3671 which informed the approach. API per @amanmahajan7 and @nstepien's
'start' | 'end'refinement.One check: "we want to prevent the shadow logic" (#3671 2026-04-21) — I interpreted as "preserve" and mirrored the start-shadow symmetrically. If the intent was otherwise, happy to drop it.
Tests: new
test/browser/column/frozenEnd.test.ts+ additions tovirtualization.test.tsanddirection.test.ts. Demo updated inCommonFeatures.