Conversation
MVP 1st cut - search GitHub repositories from inside the app, see them sorted by stars, copy clone URL, then switch to git install tab to paste. Backend (Rust) - New module src-tauri/src/github_search.rs as a self-contained submodule with no coupling to github_api.rs's crate-private helpers, so merging upstream stays conflict-free. - 13 unit tests covering query composition, URL construction, response mapping, and validation. - New Tauri command search_github_repositories (commands.rs: line ~9024) registered in lib.rs invoke_handler. Token is optional - falls back to unauthenticated GitHub Search (60 req/h). Frontend (React) - skill-client.ts: GithubSearchRepository / GithubSearchResponse / searchGithubRepositories invoke wrapper. - New component GithubSearchPanel.tsx (~300 lines): form with keyword + topic presets + language, results list, copy-to-clipboard, hint to switch to git tab for install. - market.tsx: git tab gets an 'URL | GitHub Search' mode switcher above the existing RepoInstallPanel; state is internal. - i18n: 25 new keys in zh-CN and en, leveraging existing keyof typeof translations['zh-CN'] union. Validation - cargo test --lib search: 13 passed - npm run build: tsc --noEmit + vite build both clean - npm run test: 550 tests passed (54 files)
Eliminate the copy/paste round-trip. After searching GitHub, a 'Use this repository' button sends the selected cloneUrl straight into RepoInstallPanel, which now accepts an optional prefilledRepoUrl prop and triggers its existing discovery flow (branch fetch + skill detection). market.tsx holds a single source of truth (prefilledRepoUrl state) and flips gitInstallMode from 'search' to 'url' atomically, so the user lands in the install UI with everything already loaded. Touch points: RepoInstallPanel +14/-3, market.tsx +8/-4, panel +29/-11, i18n +2. All 550 vitest tests still pass.
search_github_repositories now falls back to github_credentials::active_token() when the caller passes None or empty string. Effect: if the user has already completed GitHub device flow (Settings → GitHub), search queries silently upgrade from 60 req/h (anonymous) to 5000 req/h (authenticated). No frontend changes required; the existing UI contract is unchanged. This unblocks real-world search usage without forcing users to invent a PAT only for this panel.
Each search result now displays a probe badge so users can tell at a glance whether the repo is actually installable. Probe runs in the background per item when the result list renders; uses the same auto-injected GitHub token from the credentials cache, so 30 concurrent probes are well under the 5000 req/h authed budget. Backend (Rust) - github_search.rs: new RepositoryInstallability struct, PROBE_PATHS table (7 marker file locations: SKILL.md, .codex-plugin/plugin.json, .claude-plugin/plugin.json, plugin.json, mcp.json, .mcp.json), and probe_repository_installability() walking them serially. 6 new unit tests cover URL construction, classification, and serialization. - commands.rs: probe_repository_installability command (also auto-falls back to github_credentials::active_token), registered in lib.rs. Frontend (React) - skill-client.ts: RepositoryInstallability type + probeRepositoryInstallability invoke wrapper. - GithubSearchPanel.tsx: result items extracted into ResultItem subcomponent with internal probe state (loading/error/ok) and badge rendering for the three install kinds. - i18n: 7 new keys (probe.loading, probe.failed, probe.unknown, probe.skill, probe.plugin, probe.mcp) in zh-CN and en. Touch points: github_search.rs +99, commands.rs +18, lib.rs +1, skill-client.ts +29, panel +97, i18n +14. 19 Rust unit tests pass; 550 vitest tests still pass; npm run build clean.
Search results used to fire 30 concurrent probe_repository_installability calls the moment the list rendered. Anonymous GitHub users (60 req/h) hit the limit instantly; even authenticated users wasted API calls for cards they never scrolled to. ResultItem now mounts into an IntersectionObserver (rootMargin 120px). The probe fires only when the card becomes visible (or is about to be), then the observer disconnects so each card is probed exactly once. No IntersectionObserver is provided (older jsdom) → falls back to immediate probe to preserve current behavior. Touch points: - NEW src/features/install/hooks/useLazyProbe.ts (109 lines) - NEW src/tests/install/use-lazy-probe.test.ts (6 unit tests) - src/features/install/components/GithubSearchPanel.tsx: ResultItem now calls useLazyProbe; renderProbeBadges handles the new idle state. Verification: cargo test --lib search 19 passed, npm run build clean, vitest 556 passed (54 files + 1 new file).
…stence After every successful search query, the (query, topics, language) triple is pushed to a 10-entry ring buffer in localStorage. The panel renders that list right under the form so a returning user can replay a previous query with one click — topics get a stable order-aware fingerprint so reordering tags dedupes rather than creating an extra slot. Touch points: - NEW src/features/install/utils/searchHistoryStorage.ts (109 lines) - NEW src/tests/install/search-history-storage.test.ts (15 unit tests) - src/features/install/components/GithubSearchPanel.tsx: historyStorage state, replay callback, history list UI under the form. - src/app/i18n.tsx: 4 new bilingual keys (history.aria, history.title, history.clear, history.emptyQuery). Verification: cargo test --lib search still 19 passed, npm run build clean, vitest 571 passed (56 files).
Contributor
|
Thanks for the search MVP — the backend works, but I can't merge this yet. The new GitHub Search panel has no styles. Classes like If you want to continue: reuse the existing install UI ( Happy to re-review after that. |
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.


No description provided.