Commit ab44a72
committed
Navigation: migrate every bare-path caller to
Each edge that fed a bare path into navigation now resolves it to a `Location` (volume id + path) FIRST, so navigation always lands on the right volume — the fix for the search-result-over-SMB bug. Failures surface a friendly toast (or a typed MCP `ok: false`) instead of a wrong-volume listing.
Migrated callers:
- Search "Go to file" (`handleSearchNavigate`): now delegates to a shared, testable `revealSearchResultInPane` (resolve the parent dir's volume → navigate → move cursor onto the file). A result can live on any volume, so it can't assume the pane's.
- MCP `nav_to_path`: resolves the path first, then routes `{ location }`; unresolvable → typed refusal. The on-network refusal NARROWS — a local target from a network pane now switches and navigates; only an `smb://` target still refuses.
- ⌘G "Go to path" and ⌘J "Go to latest download": resolve the per-variant dir on the FE at jump/reveal time (`resolve_go_to_path` stays pure, no per-keystroke statfs).
- `mirrorLocalStateToPane`: the cross-volume/in-place split folds into `{ location }`; the same-volume same-path no-op is preserved (routing it through `{ location }` would reload the listing).
- Search-results row activation (`FilePane`): resolving a real entry now bubbles a `Location` via a new `onGoToLocation` callback (the go-to-a-location intent, distinct from `onVolumeChange`'s volume-(re)select), gated on the existing `isSearchResultsView` A6 classifier. Unresolvable now shows the shared toast (was a silent `log.warn`). Drops `FilePane.switchVolumeForRealPath` and its `isCrossVolumeNavigation` use.
Single-sources the resolve-or-toast as `resolveLocationOrToast` in `navigate-and-select.ts`, reused by the ⌘G, ⌘J, search, and snapshot-row edges. New shared string `fileExplorer.navigation.locationUnreachableToast`.
Tests: the search edge (resolve + reveal, failure → toast), MCP `nav_to_path` (resolve → navigate, unresolvable → ok:false, refusal verbatim), and updated ⌘G / ⌘J edge tests. The bare `{ path }` arm still exists; its removal is the final step.{ location } (staging step 2)1 parent b029c43 commit ab44a72
13 files changed
Lines changed: 417 additions & 129 deletions
File tree
- apps/desktop/src
- lib
- downloads
- file-explorer
- pane
- go-to-path
- intl
- messages/en
- routes/(main)
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
71 | 84 | | |
72 | 85 | | |
73 | 86 | | |
| |||
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
105 | 121 | | |
106 | 122 | | |
107 | 123 | | |
| |||
122 | 138 | | |
123 | 139 | | |
124 | 140 | | |
125 | | - | |
| 141 | + | |
126 | 142 | | |
127 | 143 | | |
128 | 144 | | |
| |||
167 | 183 | | |
168 | 184 | | |
169 | 185 | | |
170 | | - | |
| 186 | + | |
171 | 187 | | |
172 | 188 | | |
173 | 189 | | |
| |||
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
192 | | - | |
| 208 | + | |
193 | 209 | | |
194 | 210 | | |
195 | 211 | | |
| |||
210 | 226 | | |
211 | 227 | | |
212 | 228 | | |
213 | | - | |
| 229 | + | |
214 | 230 | | |
215 | 231 | | |
216 | 232 | | |
| |||
239 | 255 | | |
240 | 256 | | |
241 | 257 | | |
242 | | - | |
| 258 | + | |
| 259 | + | |
243 | 260 | | |
244 | | - | |
| 261 | + | |
| 262 | + | |
245 | 263 | | |
246 | 264 | | |
247 | 265 | | |
| |||
260 | 278 | | |
261 | 279 | | |
262 | 280 | | |
| 281 | + | |
263 | 282 | | |
264 | 283 | | |
265 | 284 | | |
| |||
335 | 354 | | |
336 | 355 | | |
337 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
338 | 360 | | |
339 | 361 | | |
340 | 362 | | |
| |||
345 | 367 | | |
346 | 368 | | |
347 | 369 | | |
348 | | - | |
| 370 | + | |
349 | 371 | | |
350 | 372 | | |
351 | 373 | | |
| |||
375 | 397 | | |
376 | 398 | | |
377 | 399 | | |
378 | | - | |
| 400 | + | |
379 | 401 | | |
380 | 402 | | |
381 | 403 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | | - | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| |||
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
91 | 107 | | |
92 | 108 | | |
93 | 109 | | |
| |||
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
107 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
108 | 130 | | |
109 | 131 | | |
110 | 132 | | |
| |||
Lines changed: 62 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
3 | 11 | | |
4 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
5 | 19 | | |
6 | 20 | | |
7 | 21 | | |
| |||
21 | 35 | | |
22 | 36 | | |
23 | 37 | | |
24 | | - | |
| 38 | + | |
25 | 39 | | |
26 | | - | |
27 | | - | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
31 | 45 | | |
32 | 46 | | |
33 | | - | |
| 47 | + | |
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
| |||
42 | 56 | | |
43 | 57 | | |
44 | 58 | | |
45 | | - | |
| 59 | + | |
46 | 60 | | |
47 | | - | |
48 | | - | |
| 61 | + | |
| 62 | + | |
49 | 63 | | |
50 | 64 | | |
51 | 65 | | |
| |||
61 | 75 | | |
62 | 76 | | |
63 | 77 | | |
64 | | - | |
| 78 | + | |
65 | 79 | | |
66 | 80 | | |
67 | 81 | | |
| |||
71 | 85 | | |
72 | 86 | | |
73 | 87 | | |
74 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
75 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
76 | 128 | | |
77 | 129 | | |
0 commit comments