Commit ac33136
committed
fix(gateway): wire approval publisher on auto-start + focus window on popup
Two bugs around meta-tool write approvals.
1. Approval publisher missing on auto-start
Only the manual `start_gateway` Tauri command attached the broker
publisher; the lib.rs auto-start path (which runs on every desktop
app launch when auto-start is enabled — i.e. virtually always) never
did. Result: even with the desktop app fully running, every write
meta tool (`mcpmux_create_feature_set`, `mcpmux_bind_current_workspace`,
…) returned `approval_required: no desktop attached to mcpmux gateway`.
Factored the publisher wiring into
`commands::gateway::attach_approval_publisher` and called it from both
paths. Also added the missing `state.approval_broker = Some(...)` in
the auto-start block so the desktop's grants-list / revoke commands
can reach the broker too.
2. Popups rendered behind other windows
When a meta-tool approval request fired or a session reported a root
that needs binding, the dialog/sheet rendered in whichever window the
user wasn't focused on. Added `focus_main_window(&app)` at two
chokepoints:
- In the approval publisher closure, before emitting the
`meta-tool-approval-request` event.
- In the domain-event bridge, when forwarding
`WorkspaceNeedsBinding` (which triggers the binding sheet).
`unminimize` + `show` + `set_focus` covers minimized, hidden behind
another app, and tray-hidden states.
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>1 parent c2f02f6 commit ac33136
2 files changed
Lines changed: 76 additions & 24 deletions
| 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 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
117 | 173 | | |
118 | 174 | | |
119 | 175 | | |
| |||
245 | 301 | | |
246 | 302 | | |
247 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
248 | 312 | | |
249 | 313 | | |
250 | 314 | | |
| |||
822 | 886 | | |
823 | 887 | | |
824 | 888 | | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
| 889 | + | |
849 | 890 | | |
850 | 891 | | |
851 | 892 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
476 | 486 | | |
477 | 487 | | |
478 | 488 | | |
| |||
510 | 520 | | |
511 | 521 | | |
512 | 522 | | |
| 523 | + | |
513 | 524 | | |
514 | 525 | | |
515 | 526 | | |
| |||
0 commit comments