Repository navigation
Commit 76ab52f
committed
unit 3a: view state machinery, registration, and the boolean webview post
Part of the split plan issued on upstream issue 1992 for PR 2226. Content authority is
PR 2226 head bc724b8, and every ported line is verbatim from that source at the same
path, selected by donor new-side line range against unit 2's head cbf1114.
Ranges here: ClineProvider.ts new-side 77 to 1149, 2419 to 2478 and 2537 to 2542; spec new-
side 15 to 5270 plus the two postMessageToWebview mock reversions at 9667 and 9771;
webviewMessageHandler.ts new-side 705 to 715 and its spec hunks at 131 to 132 and 2809 to
2826; src/__tests__/extension.spec.ts new-side 377; api-start-new-task.spec.ts new-side 22.
The 2419 to 2478 and 2537 to 2542 groups and the two mock reversions at 377, 22, 9667 and
9771 came out of units 4 and 5 and travel here because 3a is the unit that ships
Promise<boolean>: a mockResolvedValue(undefined) feeding that method, and the donor's
rewritten diagnosticsRequest callback that returns it into a Promise<void) parameter, both
fail typecheck at this head otherwise.
5 donor declarations moved to unit 3b, which owns their first use:
- core/webview/ClineProvider.ts new-side 77: PROVIDER_SETTINGS_KEYS
- core/webview/ClineProvider.ts new-side 177: PersistedViewStateValues
- core/webview/ClineProvider.ts new-side 293: ViewLocalStateField
- core/webview/__tests__/ClineProvider.spec.ts new-side 18: GlobalState
- core/webview/ClineProvider.ts new-side 170: ViewLocalStateValues
Each of those is an unused name at this head under @typescript-eslint/no-unused-vars, and
the rule is the same one the plan already applies to assertions: a declaration ships with
the unit whose code reads it. Unit 3b carries provider new-side 1150 onward and 6219 to
6398 and spec new-side 5723 to 6124, which is where every one of these is used.
No changeset, no CHANGELOG edit, no suppression count change, no new file.
The ViewStateRegistrationResult declaration and its doc comment (six lines, donor new-side 274 to 279) are not in this commit: their only reads are provider new-side 1153 and 1156, inside the 1150 to 1641 range unit 3b owns, so the declaration travels to the unit whose code reads it, the rule that also moved PROVIDER_SETTINGS_KEYS, ViewLocalStateValues, PersistedViewStateValues, ViewLocalStateField and GlobalState here. knip exits 0 at this head after the move.
Main tip 18861b2 is merged into this commit as content: the tree is the ort merge of the cbf1114-parented content and main, merged clean with zero conflicts, so the merge base of this branch is main tip and the diff against main is this unit alone. The pure merge commit that produced this tree was 2b7e22ffa26d3b6f956a2e72301a400a85e5eb46 with parents d475ef2512d0e981f9b1a39c10d36a8729cdee71 and 18861b2; it was squashed into this one commit because the adaptation below can only compile once main's content is an ancestor of it, which the probe proved: main's copy of Task.spec.ts on top of the unmerged unit tree gives seven type errors, among them the missing module test-utils/run-state and four reads of Task.pendingPartialMessageTimer.
One adapted line belongs to this commit's own signature change. src/core/task/__tests__/Task.spec.ts line 4526 adds return true inside the mockImplementation callback that main added at line 4521, because git show of ClineProvider.ts prints public async postMessageToWebview(message: ExtensionMessage) at line 1702 on main tip 18861b2 and the same line at 1702 on cbf1114, while this commit declares public async postMessageToWebview(message: ExtensionMessage): Promise<boolean> at line 2252. main brought the call site, this unit brought the boolean return, so the adaptation travels with the return type and not into the merge. It is a spec row, and the mutation gate charges executable paths, not spec rows.1 parent 18861b2 commit 76ab52f
20 files changed
Lines changed: 892 additions & 36 deletions
File tree
- packages/types/src
- __tests__
- src
- __tests__
- core
- config
- __tests__
- task/__tests__
- webview
- __tests__
- extension
- __tests__
- services/language-models
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
42 | 85 | | |
43 | 86 | | |
44 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
117 | 128 | | |
118 | 129 | | |
119 | 130 | | |
| |||
122 | 133 | | |
123 | 134 | | |
124 | 135 | | |
| 136 | + | |
125 | 137 | | |
126 | 138 | | |
127 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
174 | 182 | | |
175 | 183 | | |
176 | 184 | | |
| |||
712 | 720 | | |
713 | 721 | | |
714 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
715 | 726 | | |
716 | 727 | | |
717 | 728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
| |||
666 | 679 | | |
667 | 680 | | |
668 | 681 | | |
669 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
670 | 692 | | |
671 | 693 | | |
672 | 694 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
| |||
511 | 519 | | |
512 | 520 | | |
513 | 521 | | |
514 | | - | |
| 522 | + | |
515 | 523 | | |
516 | 524 | | |
517 | 525 | | |
| |||
522 | 530 | | |
523 | 531 | | |
524 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
525 | 538 | | |
526 | 539 | | |
527 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
840 | 859 | | |
841 | 860 | | |
842 | 861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
976 | 981 | | |
977 | 982 | | |
978 | 983 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
254 | 303 | | |
255 | 304 | | |
256 | 305 | | |
| |||
0 commit comments