fix(graph-ui): fix Windows folder navigation in the index picker#739
Open
rarepops wants to merge 5 commits into
Open
fix(graph-ui): fix Windows folder navigation in the index picker#739rarepops wants to merge 5 commits into
rarepops wants to merge 5 commits into
Conversation
The index file picker built breadcrumb targets as '/' + segments, so on a Windows drive path (C:/Users/rap) clicking a crumb browsed to '/C:/...', which the backend rejected as 'not a directory'. Only the '.. (up)' button worked. Build drive-aware crumb targets (C:/, C:/Users) and drop the bogus unified '/' root crumb on Windows drive paths; POSIX behavior is unchanged. Add a regression test for Windows breadcrumb navigation and cleanup() for test isolation. Signed-off-by: Zadak <rarepops@protonmail.com>
Typing a path into the Repository path field updated currentPath (and thus the breadcrumb) but never re-fetched the directory listing, so switching drives by typing (e.g. 'D:/') left the previous location's folders showing. This is the only way to change drives when the backend does not enumerate drive roots. Debounce a silent /api/browse refresh when the typed path changes (keeping the last good listing instead of flashing errors mid-typing), and navigate immediately on Enter. Add a regression test. Signed-off-by: Zadak <rarepops@protonmail.com>
The optional 'Project name' input was labelled 'Optional display name', but its value became the project's permanent identity (the <name>.db filename, projects.name primary key, and the project. prefix on every node's qualified_name) - not a cosmetic label. Since a project cannot be renamed after indexing and the name is always derivable from the folder path, the field was misleading. Remove the input, its state, and its submit payload; project names now always derive from the selected folder path. Drop the now-dead i18n strings and update the test. Signed-off-by: Zadak <rarepops@protonmail.com>
…stead On Windows the POSIX '/' quick-jump root is meaningless (browsing it returns an empty listing), yet the picker showed a '/' button whenever the backend did not enumerate drives (older builds return roots=['/']). Clicking it stranded the user on an empty view. Derive Windows-aware quick-jump roots: drop non-drive roots and always include the current drive (parsed from the browsed path), so the button lists the drive root. Other drives remain reachable by typing. Add a regression test. Signed-off-by: Zadak <rarepops@protonmail.com>
The debounced folder-list refresh (and Enter-to-navigate) on the Repository path field now only fires for Windows drive paths (e.g. 'D:/'), where typing is the mechanism for switching drives. POSIX path navigation is left exactly as before. Add a regression test asserting a typed POSIX path does not trigger a re-browse. Signed-off-by: Zadak <rarepops@protonmail.com>
89795df to
00ce349
Compare
Owner
|
Thanks for the Windows picker fix. Triage: this is a Windows graph UI indexing bug, priority high, because drive/root navigation can block indexing from the UI. For review, we will focus on drive-root breadcrumb targets, typed-path refresh, |
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.
Summary
Fixes several issues with the repository folder picker (the New Index modal) on Windows. All changes are frontend-only (
graph-ui) and Windows-scoped, so POSIX (Linux/macOS) navigation is left byte-for-byte unchanged, guarded by anisWinPathcheck.On Windows the picker was effectively unusable: clicking breadcrumb segments errored with "not a directory", switching drives didn't update the listing, and the
/quick-jump button led to an empty view.Changes
C:/Users/x) the breadcrumb built click targets as"/" + segments(/C:/Users), which the backend rejects as "not a directory". It now builds drive-aware targets (C:/,C:/Users) and drops the meaningless leading/crumb on Windows.D:/) updated the input and breadcrumb but never re-fetched the directory listing, so switching drives by typing showed the previous drive's folders. Added a debounced, silent/api/browserefresh (plus Enter-to-navigate), scoped to Windows drive paths. This matters because older backends don't enumerate drives, making typing the only way to switch drives./quick-jump root is meaningless (browsing it returns an empty listing). It now offers drive roots instead, always including the current drive (derived from the browsed path), so it works even when the backend returnsroots: ["/"].<name>.dbfilename, theprojects.nameprimary key, and theproject.prefix on every node'squalified_name), not a cosmetic label. Since a project can't be renamed after indexing, the field was misleading. It has been removed; project names now always derive from the selected folder path.Testing
graph-uiunit tests: 12/12 passing, including new regression tests for Windows breadcrumb navigation, typed-drive refresh,/to drive-root replacement, and a POSIX-negative test asserting a typed POSIX path does not trigger a re-browse.D:/, and the drive-root quick-jump all list the correct folders.Notes
src/ui/http_server.c) is unchanged; these fixes work against existing/older builds that returnroots: ["/"].