Repository navigation
Commit b377b21
authored
fix(Resizable): the Grab zone stays on the Handle whatever pillPlacement says, and a short item keeps its own drag (#9529)
* test(Resizable): the Grab zone stays on the Handle whatever pillPlacement says, and a short item keeps half of itself for its own drag (component:Resizable FR1)
A browser fixture story draws a calendar column at 48px an hour with a
30-minute and a 15-minute event, each moved by a drag on its body and
resized by the ResizeHandle on its bottom edge. Red before the fix:
- with pillPlacement auto, start or end, the Grab zone's centre sits
5.5 to 8.5px off the Handle's, because it follows the pill;
- the zone covers 13.5px of the 24px event with the pill on the event's
side, and 8px of the 15-minute event's 12px even when centred, so the
events' own drag misses points of their upper half;
- the same holds for position="overlay".
A drag on the 30-minute event's body moves it, and a drag on its
Handle's line resizes it.
* fix(Resizable): the Grab zone stays on the Handle whatever pillPlacement says, and takes at most half of a short pane (component:Resizable FR1)
FR1 puts the Grab zone, a --spacing-4 strip on the resize axis, on the
Handle; pillPlacement only places the pill. The zone followed the pill
instead, shifting up to a strip's width toward it, so on a short item
(a 30-minute calendar event resized from its edge) it took most of the
item and stole its own drag.
The zone now sits centred on the Handle for every pillPlacement. On a
pane shorter than the zone, it takes at most half the pane, as
spec:AST-094 FR42's grown targets stop at half the gap: an inline
Handle's zone is at most the pane's length, so half of it reaches into
the pane, and an overlay Handle takes at most half of the pane it sits
in, with the zone kept inside it. A collapsed pane keeps the whole zone,
which reopens it.
The unit tests that pinned the zone to the pill now pin it to the
Handle, with one for the short-pane limit and the collapsed pane; the
docs say pillPlacement moves only the pill, and a [fix] changeset
records it.
* test(Resizable): a pane at 0px that is not collapsed keeps the whole Grab zone
A region at 0px that is not collapsed gets a zero-length inline zone
(min(var(--spacing-4), 0px)) and an overlay Handle clamped to half of
nothing, so no drag can reopen it. Both cases fail here.
* fix(Resizable): a pane at 0px that is not collapsed keeps the whole Grab zone
A pane with no length has nothing to protect, so it is treated like a
collapsed one: the inline zone and the overlay Handle keep their full
length, and a drag can reopen the pane. The duplicate comment at the
zone's call site goes.
* test(Resizable): a drag on the Grip pill resizes wherever the pill sits
With the Grab zone centred on the Handle, a pill that pillPlacement
draws outside the zone takes no pointer: on an overlay Handle the start
pill sits before the Handle's box, so a drag on it moves a 30-minute
event instead of resizing it, and an inline end pill on a short pane
hangs past the zone's end. The browser spec drags the pill's centre for
every pillPlacement and both positions, and the unit test starts a drag
from the pill. The upper-half check now skips the pill's own box.
* fix(Resizable): the Grip pill takes the pointer wherever it sits
The pill is the Grip, so it stays grabbable wherever pillPlacement
paints it: while it is painted, it takes the same pointer handlers as
the Grab zone, with the resize cursor, and a hidden or disabled pill
takes none. The Grab zone keeps its short-pane limit, and pillPlacement
still moves only the pill. The docs and the [fix] changeset say so, and
the changeset now says that an overlay Handle takes at most half of the
pane it sits in.
* docs(Resizable): Grab zone comments in short sentences
Each comment sentence the Grab zone change adds has at most 20 words,
and the test comment cites no record. ResizeHandle's header drops the
paragraph on the pill's dynamic offset, which now sits on that style.
No code change.
* docs(Resizable): component:Resizable FR1 says where the grab zone sits and how it shrinks on a short pane
FR1 named the Grab zone only as a --spacing-4 strip. It now adds the
owner's ruling, word for word: the grab zone is centred on the Handle for
every pillPlacement, and the painted pill is its own grab target; on a
pane too short for the full strip, the zone shrinks so the pane keeps at
least half of itself. FR1's basis names the owner ruling, and its
verification row names the browser spec that checks the zone's place and
its short-pane limit.
* docs(Resizable): ResizeHandle's header says a drag takes capture where it starts, and a restating comment goes
A drag that starts on the Grip pill takes capture on the pill, not on the
grab zone, so the header names the element the drag starts on. The
comment over the overlay zone's width restated its min(…, 100%).
* test(Resizable): a pill shown on hover beside an overlay Handle stays reachable from the Grab zone
An overlay Handle can draw its pill outside the Grab zone: at start in
left-to-right, and at end in right-to-left. A pill that shows only on
hover then hides as the pointer leaves the zone to reach it, and a drag
from where it showed does nothing. A story puts a hover-revealed pill
beside an overlay Handle, and the browser spec crosses from the zone to
the pill and drags it, in both directions.
They fail here: the size stays 250 after the drag.
* fix(Resizable): a pill shown on hover stays reachable from the Grab zone
An overlay Handle can draw its pill outside the Grab zone, so the
pointer leaves the zone to reach it. The hover now stays for 150 ms
after the pointer leaves the zone or the pill, and entering either one
keeps it. So a hover-revealed pill stays shown and takes the pointer
while the pointer crosses to it. The pill's offset functions take
-1 | 1.
* test(Resizable): a hover-revealed pill stays shown while the pointer rests between the Grab zone and the pill
The browser case now rests 300 ms in the gap between the zone and the
pill before it reaches the pill and drags. A pointer that pauses on the
way must not lose the pill, so the pill has to stay reachable by its
geometry, not by a grace time.
It fails here: the 150 ms hover grace runs out during the rest, and the
pill hides (opacity 0).
* fix(Resizable): a hover-revealed pill reaches across the gap to the Grab zone, with no hover timer
The 150 ms hover grace was a second hover-timing implementation, which
architecture:interaction-modality INV11 keeps in the shared hover
recognizer. A pointer that rested in the gap also lost the pill. The
pill shown on hover now carries an invisible extension along the resize
axis that spans the --spacing-1 gap to the zone. It takes the pointer
only while the pill does. The timer and its unmount Effect go. The
header keeps its tags and the capture sentence, and the short-pane rule
is stated once, where the pane length is read.
* test(Resizable): a hover-revealed pill takes no pointer past its far side
The hover-pill browser case now checks the point 3 px past the pill's
side away from the zone: it must find the pane, not the pill. So the
pill's hit area cannot cover more of a short item than the pill does.
It fails here: the pill's bridge reaches out on both sides, so the
point past the far side finds the pill.
* fix(Resizable): a hover-revealed pill's bridge reaches only toward the Handle
The pill's invisible extension reached out on both sides along the
resize axis. On a short item, its far side covered the item's own drag
at the pill's column, past what FR1 lets the pill take. It now spans
only the gap toward the Handle, so it reaches no further than the pill.
The pill's offset is a physical translate, so the bridge picks its
physical side, with logical insets that swap under RTL.
* docs(Resizable): FR1 says a hover-revealed pill takes the pointer across the gap to the Grab zone
An owner ruling adds the sentence verbatim: a pill shown only on hover
also takes the pointer across the gap between it and the Grab zone,
never past the pill's far side.1 parent c19ca12 commit b377b21
9 files changed
Lines changed: 737 additions & 172 deletions
File tree
- .changeset
- apps/storybook
- rtl-audit
- stories
- docs/specs/components/Resizable
- packages/core/src/Resizable
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | | - | |
| 195 | + | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
| 228 | + | |
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
| |||
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
320 | | - | |
| 321 | + | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1107 | 1107 | | |
1108 | 1108 | | |
1109 | 1109 | | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1128 | 1129 | | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1137 | 1144 | | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1147 | 1150 | | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
| 1151 | + | |
| 1152 | + | |
1155 | 1153 | | |
1156 | 1154 | | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1168 | 1192 | | |
1169 | 1193 | | |
1170 | 1194 | | |
| |||
0 commit comments