fix(host): review round 18 — draft dirs fully normalized; JSDoc reattached; third parking target documented

This commit is contained in:
creatixchu
2026-07-30 01:28:55 +08:00
parent 12d302ea59
commit 9545914c10
5 changed files with 53 additions and 34 deletions
@@ -541,6 +541,9 @@ describe('DirectoryBrowser', () => {
// them); the filter folds them instead of going silent.
fireEvent.change(input, { target: { value: 'C:/Users/a' } })
expect(within(columns()[1]!).getByText('Alpha')).toBeTruthy()
// Dot segments normalize on win32 too.
fireEvent.change(input, { target: { value: 'C:\\Users\\.\\a' } })
expect(within(columns()[1]!).getByText('Alpha')).toBeTruthy()
})
it('re-parks focus on the edit zone when a failed pick unmounts a dot-revealed row', async () => {
@@ -673,6 +676,12 @@ describe('DirectoryBrowser', () => {
// A draft naming some other directory (or none) leaves the level whole.
fireEvent.change(input, { target: { value: 'no-separator' } })
expect(screen.getByRole('listitem').textContent).toBe('Documents')
// Dot segments and repeated separators are legal for Enter, so the
// filter's directory comparison normalizes them the same way.
fireEvent.change(input, { target: { value: `${HOME}/./do` } })
expect(screen.getByRole('listitem').textContent).toBe('Documents')
fireEvent.change(input, { target: { value: `${HOME}//do` } })
expect(screen.getByRole('listitem').textContent).toBe('Documents')
})
it('filters the child pane in two-pane mode and follows the draft back up a level', async () => {