Repository navigation
Commit 9a600f5
committed
fix(webview): keep a view's mode pin when a different mode is deleted
The routed default-mode reset fired for every view. provider.setValue writes the
shared store and this view's durable pin together, so deleting mode A moved a view
pinned to mode B onto the default as well. Measured on 9347e16: a view pinned to
keep-mode served keep-mode before the deletion and code after it, and code was
persisted into viewStates for that view.
The reset now keys off the mode this view actually resolves to - its pin, or the
shared selection when it has no pin of its own - and only that write goes through
the provider. When the shared selection is the deleted slug but this view pins
another mode, only the shared layer moves, so the views that follow the shared
selection stop resolving to a slug that no longer exists while this view keeps its
own. pinnedModeName exposes the view-local slug the way pinnedProfileName already
exposes the profile name.
Tests: "keeps a view pinned to another mode on that mode when a different mode is
deleted" and "resets the shared selection without moving a view pinned to another
mode"; the unpinned case now seeds the shared selection with the deleted slug,
which is the selection this reset exists for. Control with only the production
change reverted: both new tests fail with "expected code to be keep-mode". With
the fix: ClineProvider.spec.ts 484 passed, webviewMessageHandler 180, sticky-mode
46, parallelMode 55, the core/webview folder 35 files / 1178 passed, tsc 0 and
eslint 0 on the touched files.1 parent 9347e16 commit 9a600f5
3 files changed
Lines changed: 78 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
533 | 541 | | |
534 | 542 | | |
535 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10547 | 10547 | | |
10548 | 10548 | | |
10549 | 10549 | | |
| 10550 | + | |
| 10551 | + | |
| 10552 | + | |
| 10553 | + | |
| 10554 | + | |
| 10555 | + | |
| 10556 | + | |
| 10557 | + | |
| 10558 | + | |
| 10559 | + | |
| 10560 | + | |
| 10561 | + | |
| 10562 | + | |
| 10563 | + | |
| 10564 | + | |
| 10565 | + | |
| 10566 | + | |
| 10567 | + | |
| 10568 | + | |
| 10569 | + | |
10550 | 10570 | | |
10551 | 10571 | | |
10552 | 10572 | | |
| |||
10567 | 10587 | | |
10568 | 10588 | | |
10569 | 10589 | | |
| 10590 | + | |
| 10591 | + | |
| 10592 | + | |
10570 | 10593 | | |
10571 | 10594 | | |
10572 | 10595 | | |
| |||
10580 | 10603 | | |
10581 | 10604 | | |
10582 | 10605 | | |
| 10606 | + | |
| 10607 | + | |
| 10608 | + | |
| 10609 | + | |
| 10610 | + | |
| 10611 | + | |
| 10612 | + | |
| 10613 | + | |
| 10614 | + | |
| 10615 | + | |
| 10616 | + | |
| 10617 | + | |
| 10618 | + | |
| 10619 | + | |
| 10620 | + | |
| 10621 | + | |
| 10622 | + | |
| 10623 | + | |
| 10624 | + | |
| 10625 | + | |
| 10626 | + | |
| 10627 | + | |
| 10628 | + | |
| 10629 | + | |
| 10630 | + | |
| 10631 | + | |
| 10632 | + | |
| 10633 | + | |
| 10634 | + | |
| 10635 | + | |
| 10636 | + | |
| 10637 | + | |
10583 | 10638 | | |
10584 | 10639 | | |
10585 | 10640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2907 | 2907 | | |
2908 | 2908 | | |
2909 | 2909 | | |
2910 | | - | |
2911 | | - | |
2912 | | - | |
2913 | | - | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
2914 | 2925 | | |
2915 | 2926 | | |
2916 | 2927 | | |
| |||
0 commit comments