fix(directory-picker-browse): land the draft-following walk two-pane
The draft-following scan replaced the panes with one wide level, so typing a
path collapsed the dialog's Miller view — the thing the dialog is. It now
lands through the same selection-anchored landing every navigation uses:
target and parent legs as one frame, the target re-selected in its parent
level, its children on the right. Typing a path moves the Miller view exactly
as a crumb jump does.
One landing shape, two callers: `land(path, {closeEditor, announce})` is what
`navigate` and the draft-following scan share. A submitted path closes the
editor and announces failures; the speculative scan keeps both to itself and
re-parks the focus its swap dropped.
A level a pane already lists still needs no scan at all — the filter alone
answers the draft — so erasing back into the parent's own path keeps both
panes and only moves the filter.
This commit is contained in:
@@ -416,17 +416,18 @@ describe('web e2e: workspace management (create / rename / flat view / hover aff
|
||||
await expect.poll(() => dialog.getByText('alpha', { exact: true }).count(), { timeout: 10_000 }).toBe(1)
|
||||
await dialog.getByRole('button', { name: 'Edit path' }).click()
|
||||
const path = dialog.getByLabel('Edit path')
|
||||
// A directory part no pane lists: the panes follow it and keep the editor.
|
||||
// A directory part no pane lists: the panes walk to it, landing the
|
||||
// ordinary two-pane Miller view (level | its children) with the editor
|
||||
// still up and the draft intact.
|
||||
await path.fill(`${join(staged, 'alpha')}${sep}`)
|
||||
await expect.poll(() => dialog.getByText('only-under-alpha', { exact: true }).count(), { timeout: 10_000 }).toBe(1)
|
||||
// The editor is still up with the draft intact: the panes moved under it.
|
||||
expect(await dialog.getByRole('list').count()).toBe(2)
|
||||
expect(await path.inputValue()).toBe(`${join(staged, 'alpha')}${sep}`)
|
||||
// Erasing back past the separator steps the panes up, the tail filtering
|
||||
// the level it returns to.
|
||||
// Erasing back past the separator returns to a level already on screen:
|
||||
// the tail filters it, no scan needed, both panes stay.
|
||||
await path.fill(`${staged}${sep}al`)
|
||||
await expect.poll(() => dialog.getByText('alpha', { exact: true }).count(), { timeout: 10_000 }).toBe(1)
|
||||
expect(await dialog.getByText('beta', { exact: true }).count()).toBe(0)
|
||||
expect(await dialog.getByText('only-under-alpha', { exact: true }).count()).toBe(0)
|
||||
await expect.poll(() => dialog.getByText('beta', { exact: true }).count(), { timeout: 10_000 }).toBe(0)
|
||||
expect(await dialog.getByText('alpha', { exact: true }).count()).toBe(1)
|
||||
// A tail nobody matches is a name still being spelled: the level shows
|
||||
// whole instead of emptying under it.
|
||||
await path.fill(`${staged}${sep}zzz`)
|
||||
|
||||
Reference in New Issue
Block a user