fix(host): opening the path editor supersedes a pending listing

A navigation settling between the Edit-Path click and the first keystroke
executed navigate's draft reset and closed the editor underneath the user;
the click now bumps the request sequence like draft edits do
(ds-review-bot).
This commit is contained in:
creatixchu
2026-07-29 02:08:33 +08:00
parent 459128dfb6
commit b5a809d38e
2 changed files with 23 additions and 1 deletions

View File

@@ -307,7 +307,14 @@ export function DirectoryBrowser({ open, listDirectory, createDirectory, onOpen,
// listing itself fails, typing an absolute path is the one
// remaining way forward.
disabled={parentInert}
onClick={() => { setPathDraft(selected?.path ?? parent?.path ?? '') }}
onClick={() => {
// Opening the editor supersedes any pending listing: a
// settlement landing before the first keystroke would
// otherwise close the editor via navigate's draft reset.
requestSeq.current += 1
setLoading(false)
setPathDraft(selected?.path ?? parent?.path ?? '')
}}
/>
</>
)