Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Fixes #44960
Fixes #60294
Fixes #54663
Type of change
What does this PR do?
three small bugs in the directory picker selection logic (
packages/app/src/workspaces/selection):nextSuggestionIndexdidn't special-case "nothing active" (-1). so the first ArrowUp did(-1 - 1 + n) % nand landed onn - 2. it now goes to the last item (ArrowDown still goes to 0)resolvePickerTargetran every path throughcleanPickerInput, whose.trim()stripped the trailing space from already absolute paths (suggestions, recent projects). sofoobecamefoo, a missing or different folder. typed input is already cleaned once oninput.changed, so I dropped the extra clean here/afterdisplayPickerPath, which returns backslashes for drive paths, so you gotC:\...\packages/. it now uses the existingdisplayInputDirectory, which already picks the native separator.canSearchPickerInputalso strips a trailing\now, not just/, soC:\root\matches the open root like/root/doesthe suggestion rows mentioned in #54663 don't append a separator anymore on dev, so only Tab and the root comparison needed fixing
no flag, it's a fix
How did you verify your code works?
added tests that failed before the fix:
domain.test.ts: ArrowUp from no selection picks the last item,resolvePickerTargetkeeps a trailing spacecombobox-machine.test.ts: ArrowUp from~/highlights the last suggestion, Tab on a Windows folder ends in\, a Windows input equal to the root with a trailing\doesn't search, clicking afoosuggestion keeps the spaceran from
packages/app:bun test --conditions=browser --isolate --preload ../ui/test/solid-jsx.ts --preload ./happydom.ts ./src/workspaces: 211 pass, 0 failbun typecheck: cleandidn't run it on real Windows, the Windows cases are covered by the machine tests
Screenshots / recordings
n/a, logic only
Checklist