Commit 6074cd2
committed
Bugfix: don't re-anchor focus inside selectVolumeByIndex/navigateToPath
Reverts the focus-restoration calls added to those two methods in `d9212b83`. They were intended to fix MCP/test paths where DOM focus drifted, but post-Group-A the real fix turned out to be the null-vs-undefined sweep in `f2019aff` — those tests now pass without the focus polish.
Worse, the late-firing `.finally(() => containerElement?.focus())` inside `navigateToPath` raced with subsequent keystrokes in `mtp.spec.ts:414` ("deletes multiple selected files on MTP"): one of the Space presses in the multi-select sequence got dropped, the autoConfirmed delete then targeted only the first file, and the second backing file survived.
`moveCursor` keeps its `await paneRef.setCursorIndex(...)` (was fire-and-forget) — that's a real correctness fix for the MCP `move_cursor` round-trip, independent of focus.
If MCP/test paths genuinely need focus restoration after async nav, the right place is the `mcp-nav-to-path` event handler in `mcp-listeners.ts`, which already awaits the promise — re-anchor focus there, not via fire-and-forget `.finally()` here.1 parent 6a90560 commit 6074cd2
1 file changed
Lines changed: 10 additions & 15 deletions
Lines changed: 10 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1920 | 1920 | | |
1921 | 1921 | | |
1922 | 1922 | | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
1926 | | - | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
1927 | 1926 | | |
1928 | 1927 | | |
1929 | 1928 | | |
| |||
1990 | 1989 | | |
1991 | 1990 | | |
1992 | 1991 | | |
1993 | | - | |
1994 | | - | |
1995 | | - | |
1996 | | - | |
1997 | | - | |
1998 | | - | |
1999 | | - | |
2000 | | - | |
2001 | | - | |
2002 | | - | |
2003 | | - | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
2004 | 1999 | | |
2005 | 2000 | | |
2006 | 2001 | | |
| |||
0 commit comments