fix(staged): make Add Repo dropdown open reliably and key excludes by subpath#754
Open
matt2e wants to merge 1 commit into
Open
fix(staged): make Add Repo dropdown open reliably and key excludes by subpath#754matt2e wants to merge 1 commit into
matt2e wants to merge 1 commit into
Conversation
… subpath The Add Repo dialog had two bugs. First, the click that opened the modal also reached the freshly-attached window-level click-outside listener and closed the dropdown the autofocused input had just opened. Defer the autofocus call so that initial click finishes bubbling first, and also reopen the dropdown defensively on input. Second, the project's existing repos were being excluded by `nameWithOwner` alone, which dropped the same repo at other subpaths from recents/chips and filtered GitHub search results that have no subpath at all. Key excludes by `(repo, subpath)` instead, drop the exclusion from search results entirely, and surface a duplicate error at submit time in AddRepoModal. Signed-off-by: Matt Toohey <contact@matttoohey.com>
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
RepoSearchInputso the click that opens the Add Repo modal finishes bubbling before the dropdown opens, preventing the window-level outside-click handler from immediately closing it.excludeReposset bygithubRepo + subpath(separated by\x00) instead of just the repo name, so the same GitHub repo can be added at different subpaths. The exclusion still applies when the repo + subpath combo is already in the project, with a clear error message in the modal.excludeReposin the repo/search result lists inRepoSearchInputsince exclusion is now scoped to subpath and enforced at submit time.Test plan