Commit 9e6e455
authored
Recover compact sidebar swipes after interrupted drags (#4112)
## Human comments
## What was wrong
A compact sidebar opening swipe sets `openMobile=true` at drag intent.
If its terminal event is lost, the page can remain only partly
translated while the drawer is logically open. Both touch and pointer
start handlers then reject every later opening swipe until reload.
Text-selection cancellation could clear an active drag without resetting
that state. The end handlers also ignored the release coordinate, so
sparse move events could settle a sufficient swipe closed. Fixes #4110.
## What changed
- Reset an interrupted active drag when the next eligible touch or
primary pointer gesture starts. Keep normally opened drawers unaffected.
- Reset an active drag when native text selection takes over.
- Include the release position in the final swipe decision and match
touch endings using `changedTouches`, so another finger's end does not
terminate the tracked gesture.
- Add regressions for lost terminal events on touch, pointer, and the
iOS pointer-then-touch sequence; selection cleanup; sparse release
coordinates; and another finger ending.
This changes only `apps/app/src/components/ui/sidebar.tsx` and its test.
There are no server/daemon wire, CLI, SDK, configuration, or protocol
changes.
## How you verified
- New interrupted-drag and release-position cases failed before the fix
and pass after it.
- `pnpm exec turbo run test --filter=@bb/app --
src/components/ui/sidebar.test.tsx`: 40 passed on the rebased head.
- `pnpm exec turbo run typecheck --filter=@bb/app`: passed.
- `pnpm start:worktree --dryrun` twice, then a persistent source server
at [the review app](https://ymichael--19220.getbb.app); server and
daemon health passed.
- A deterministic 390 × 844 Chromium touch procedure against that build
omitted a `touchend`, observed `data-state="open"` with
`translate="20px"`, then confirmed the next swipe opened fully with no
inline translation. It also passed text-selection cleanup, a tap without
a swipe, normal opening and closing swipes, a trigger tap, and the
desktop trigger. The procedure and output are in the originating BB
thread's storage, outside this commit.
- The intermittent phone report is a strong match for the reproduced
stuck state; I did not reproduce it on a physical device.
Related PR #3544 recovered interrupted sessions before drag intent. This
PR covers interruption after the drawer has become logically open.
BB-Thread-ID: thr_e2bgmgxf8g
> AGENT GENERATED1 parent cfc8d68 commit 9e6e455
2 files changed
Lines changed: 193 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
782 | 881 | | |
783 | 882 | | |
784 | 883 | | |
| |||
925 | 1024 | | |
926 | 1025 | | |
927 | 1026 | | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
928 | 1064 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1046 | 1061 | | |
1047 | 1062 | | |
1048 | 1063 | | |
| |||
1241 | 1256 | | |
1242 | 1257 | | |
1243 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1244 | 1262 | | |
1245 | 1263 | | |
1246 | | - | |
| 1264 | + | |
1247 | 1265 | | |
1248 | 1266 | | |
1249 | 1267 | | |
| |||
1270 | 1288 | | |
1271 | 1289 | | |
1272 | 1290 | | |
1273 | | - | |
| 1291 | + | |
| 1292 | + | |
1274 | 1293 | | |
1275 | 1294 | | |
1276 | 1295 | | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1277 | 1299 | | |
1278 | 1300 | | |
1279 | | - | |
| 1301 | + | |
1280 | 1302 | | |
1281 | 1303 | | |
1282 | 1304 | | |
1283 | 1305 | | |
1284 | 1306 | | |
1285 | 1307 | | |
1286 | 1308 | | |
1287 | | - | |
1288 | 1309 | | |
1289 | 1310 | | |
1290 | 1311 | | |
| |||
1300 | 1321 | | |
1301 | 1322 | | |
1302 | 1323 | | |
1303 | | - | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
1304 | 1332 | | |
1305 | 1333 | | |
1306 | 1334 | | |
| |||
1331 | 1359 | | |
1332 | 1360 | | |
1333 | 1361 | | |
| 1362 | + | |
1334 | 1363 | | |
1335 | 1364 | | |
1336 | 1365 | | |
| |||
1339 | 1368 | | |
1340 | 1369 | | |
1341 | 1370 | | |
1342 | | - | |
1343 | 1371 | | |
1344 | 1372 | | |
1345 | 1373 | | |
| |||
1350 | 1378 | | |
1351 | 1379 | | |
1352 | 1380 | | |
1353 | | - | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1354 | 1389 | | |
1355 | 1390 | | |
1356 | 1391 | | |
| |||
1379 | 1414 | | |
1380 | 1415 | | |
1381 | 1416 | | |
| 1417 | + | |
1382 | 1418 | | |
1383 | 1419 | | |
1384 | 1420 | | |
1385 | 1421 | | |
1386 | 1422 | | |
1387 | | - | |
| 1423 | + | |
| 1424 | + | |
1388 | 1425 | | |
| 1426 | + | |
1389 | 1427 | | |
1390 | 1428 | | |
1391 | 1429 | | |
1392 | 1430 | | |
1393 | | - | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1394 | 1436 | | |
1395 | 1437 | | |
1396 | 1438 | | |
| |||
1415 | 1457 | | |
1416 | 1458 | | |
1417 | 1459 | | |
1418 | | - | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
1419 | 1466 | | |
1420 | 1467 | | |
1421 | 1468 | | |
| |||
0 commit comments