fix(host): cancelling a superseded path edit falls back to the single-pane level
A draft edit can invalidate the selection's preview request; Escape then left selected set with no child and nothing loading — a half-empty two-pane view. Cancel now clears the selection when no preview exists (ds-review-bot round 7).
This commit is contained in:
@@ -328,6 +328,11 @@ export function DirectoryBrowser({ open, listDirectory, createDirectory, onOpen,
|
||||
event.stopPropagation()
|
||||
setPathDraft(null)
|
||||
setError(null)
|
||||
// Editing may have superseded the selection's preview
|
||||
// request; a selection with no preview and nothing in
|
||||
// flight would render a half-empty two-pane view, so
|
||||
// cancel falls back to the single-pane level.
|
||||
if (child === null && !loading) setSelected(null)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user