Repository navigation
Conversation
There was a problem hiding this comment.
This fixes the directory suggestion rows, but not Tab completion. #54663 and the description both cover Tab-completed paths and the trailing-separator comparison, and both are still wrong.
I ran the PR's transitionPickerCombobox with Windows paths (home and root C:/Users/b). Typing C:\Users\b\pack and pressing Tab on the C:/Users/b/packages suggestion still sets the input to C:\Users\b\packages/. Clicking the same suggestion gives C:\Users\b\packages\. The cause is in packages/app/src/workspaces/selection/combobox-machine.ts:
- Line 191 (Tab):
value.endsWith("/") ? value : value + "/"still hardcodes/. It could usepickerDisplaySeparator(value), or simplydisplayInputDirectory. - Line 155: the input-vs-root comparison still strips only trailing
/, soC:\Users\b\doesn't match the rootC:\Users\b.
Could you fix both there and add a small Tab test with a Windows path to combobox-machine.test.ts? Before/after screenshots of the picker on Windows would also help, since I couldn't run the web UI on Windows.
The domain and combobox tests pass (67 pass) and tsc -b passes in packages/app.
The public API is unchanged. pickerDisplaySeparator is a new internal export of the app package.
Related: #54626
| return displayed.endsWith(separator) ? displayed : displayed + separator | ||
| } | ||
|
|
||
| export function pickerDisplaySeparator(displayed: string) { |
There was a problem hiding this comment.
The Tab path doesn't use this helper yet. combobox-machine.ts:191 still appends a hardcoded /, so Tab on a Windows directory suggestion still produces C:\Users\b\packages/; I checked by running transitionPickerCombobox. combobox-machine.ts:155 still strips only trailing /. Using this helper (or displayInputDirectory) in both places would cover the rest of #54663.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
My earlier point is fixed: Tab completion now uses withPickerSeparator, and the root comparison uses trimPickerPath. I re-ran my Windows-path script against transitionPickerCombobox: Tab on C:\Users\b\pack now gives C:\Users\b\packages\, the same as clicking the suggestion. The domain and combobox tests pass (68 pass) and tsc -b passes in packages/app.
The public API is unchanged. withPickerSeparator and trimPickerPath are new internal exports of the app package.
No further concerns. The Windows before/after screenshots you mentioned would still help, since I couldn't run the picker on Windows.
Tab and the typed-input/root comparison hardcoded "/", so a Windows path completed to C:\Users\b\packages/ and an input equal to the open root kept searching. Complete with the separator the displayed path already uses and compare paths in the canonical trimmed form.
faee177 to
20f9198
Compare
There was a problem hiding this comment.
Tab completion and the root comparison are still fixed after the rebase. On the new base, Tab on C:\Users\b\pack gives C:\Users\b\packages/; with this PR it gives C:\Users\b\packages\. The selection tests pass (88 pass).
The rebase onto the redesigned picker (#64241) caused two problems:
tsc -binpackages/appnow fails. Thewindowstest context is missing the new requiredcommittedfield (see inline).- The suggestion-row change in
dialog.tsxis no longer needed and now changes POSIX output (see inline).
The public API is unchanged.
packages/app/src/workspaces/selection/combobox-machine.test.ts:24: Since the rebase,PickerComboboxContextrequirescommitted, sotsc -bfails here with TS2741. Addingcommitted: ""(as the POSIXcontextabove does) fixes it.packages/app/src/workspaces/selection/dialog.tsx:714: After the redesign (#64241), suggestion rows show only the folder name (with a folder icon and the parent path), with no trailing/, so there is no mixed separator left to fix here. This now adds a separator after every folder name, and on Linux and macOS rows newly readpackages/. I'd drop this hunk, thepickerDisplaySeparatorimport and its test indomain.test.ts. The Tab and comparison fixes incombobox-machine.tscover #54663.
There was a problem hiding this comment.
Both points from my last review are fixed. The windows test context now sets committed, so tsc -b in packages/app passes again. The dialog.tsx suggestion-row change is gone, so rows look the same as on dev on every platform.
I re-ran my Windows-path check against transitionPickerCombobox: Tab on C:\Users\b\pack gives C:\Users\b\packages\, the same as clicking the suggestion. The selection tests pass (85 pass).
The public API is unchanged.
The description still mentions the suggestion-row change in dialog.tsx, which is no longer part of the PR.
|
Note on visuals after the redesign fix: suggestion rows are intentionally unchanged now (redesign #64241 already shows name + icon + parent path, no trailing slash), so there is no before/after for rows on POSIX. Tab behavior is covered by tests: typing C:\Users\b\pack + Tab on C:/Users/b/packages now completes to backslash, same as clicking. Historical Windows captures from #54630 for reference: |


Issue for this PR
Closes #54663 (split out from #54626).
Supersedes #54630, which was closed by automated cleanup and can no longer be reopened after the rebase (GitHub rejects reopen on force-pushed branches).
Type of change
What does this PR do?
Fix the separators added by the Windows web directory picker.
C:\repo\apex/. AddpickerDisplaySeparatorindomain.ts(reused bydisplayInputDirectory) and use it for the suggestion suffix indialog.tsx./, soC:\Users\b\pack+ Tab producedC:\Users\b\packages/, and the input-vs-root comparison incanSearchPickerInputstripped only/, so a typedC:\Users\b\packages\did not count as the open root and kept searching. Tab now completes through the samewithPickerSeparatorhelper that clicking a folder uses, and the comparison uses the canonical trimmed path, so either separator matches.Regression coverage: a Windows-suggestion parity test in
domain.test.ts, a Tab-completion test incombobox-machine.test.ts, and the existing "input equal to the open root has nothing to suggest" case extended with a trailing-backslash Windows input. Both new tests fail before the fix and pass after it.Rebased onto current
dev(46744b6). POSIX behavior and public API unchanged.How did you verify your code works?
bun test ./src/workspaces/selection/domain.test.ts: 47 pass, 0 fail.bun test ./src/workspaces/selection/combobox-machine.test.ts: 21 pass, 0 fail.bun test --conditions=solid --isolate --preload ../ui/test/solid-jsx.ts --preload ./happydom.ts ./src/workspaces/selection: 87 pass, 0 fail....packages/; the trailing-backslash input started a search instead of opening empty), so they protect this contract.bunx prettier --checkon the three changed files: passes.bunx oxlint src/workspaces/selection/: 0 warnings, 0 errors.git diff --check: passes.bun run typecheck:tsc(tsc -b) frompackages/app: 0 errors.Screenshots / recordings
No visual change on POSIX. On Windows, suggestion rows and Tab-completed inputs now both end with
\.TODO: Windows before/after capture of the picker (Tab completing
C:\Users\b\packtoC:\Users\b\packages\). Not captured in this revision: the app dev server needs a running backend on port 4096, which is currently held by an existing process that must not be restarted, so the capture is left for a follow-up rather than disturbing a live server.Checklist
Added by the opencode bot (AI-generated).
Related: #54626