Commit f2c2a90
committed
fix: refresh scroller layout when tool confirmation dialog is cancelled
When the user cancels a subagent tool confirmation dialog, the subagent
panel stays expanded at its pre-cancel height. This happens because
cancelConfirmation() only called parent.layout() (relaying the turn
widget's children), but never updated the ScrolledComposite's minimum
size via refreshScrollerLayout(). On the Continue path this goes
unnoticed because subsequent subagent messages trigger a layout refresh;
on the Cancel path no further messages arrive, so the panel is stuck.
Fix by adding a dispose listener on the dialog in BaseTurnWidget that
walks up to the nearest ChatContentViewer and calls
requestRefreshScrollerLayout(), a new coalesced async helper that
schedules a single refreshScrollerLayout() after pending SWT mutations
settle. InvokeToolConfirmationDialog remains self-contained: both the
accept and cancel paths use a private disposeAndRequestParentLayout()
helper, keeping scroller-specific behaviour out of the dialog.
Fixes #1691 parent 82643d2 commit f2c2a90
3 files changed
Lines changed: 24 additions & 18 deletions
File tree
- com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
659 | 661 | | |
660 | | - | |
661 | | - | |
662 | | - | |
| 662 | + | |
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
407 | 415 | | |
408 | 416 | | |
409 | 417 | | |
| |||
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
79 | | - | |
80 | 78 | | |
81 | 79 | | |
82 | | - | |
| 80 | + | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
86 | | - | |
87 | 84 | | |
88 | 85 | | |
89 | 86 | | |
| |||
122 | 119 | | |
123 | 120 | | |
124 | 121 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 122 | + | |
129 | 123 | | |
130 | 124 | | |
131 | 125 | | |
| |||
321 | 315 | | |
322 | 316 | | |
323 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
324 | 322 | | |
325 | 323 | | |
326 | 324 | | |
| |||
0 commit comments