Repository navigation
feat(bounties): sort by upvotes, link existing repositories, organization select - #36
Conversation
… from a list The Start building form gains a "Link an existing one" mode backed by Tabularium's POST /api/requests/:id/repo, with the claimer's maintained repositories as suggestions. The organization field becomes a select fed by GET /api/submit/owners, falling back to free text (without autofill).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| }, [canScaffold]); | ||
|
|
||
| // Suggestions for the link field, loaded the first time it is shown. | ||
| useEffect(() => { |
There was a problem hiding this comment.
SUGGESTION: useEffect caches failed fetches permanently
The effect only runs when repos === null. If the first fetch fails, repos becomes [] (line 297 in requests.ts) and the effect never runs again when re-entering 'link' mode. User can still paste a URL manually, but suggestions won't refresh.
Consider using a separate reposLoaded boolean flag or allowing retry on mode change.
| return ( | ||
| <div className={styles.wrapper}> | ||
| {canScaffold && ( | ||
| <div className={styles.modes} role="tablist" aria-label="Repository"> |
There was a problem hiding this comment.
SUGGESTION: ARIA tabs pattern incomplete for segmented control
The mode toggle uses role="tablist" and role="tab" but lacks aria-controls/id attributes linking tabs to their panels. For a simple two-button toggle, role="group" with aria-pressed on each button is more semantically appropriate and accessible.
| try { | ||
| const res = await fetch(`${TABULARIUM_URL}/api/submit/repos?page=1`, {credentials: 'include'}); | ||
| if (!res.ok) return []; | ||
| const body = (await res.json()) as {groups: Array<{repos: MaintainedRepo[]}>}; |
There was a problem hiding this comment.
SUGGESTION: Fragile API response assumption
fetchMaintainedRepos assumes {groups: Array<{repos: MaintainedRepo[]}>} structure. If the API changes, this silently returns [] via the catch block. Consider validating the response structure or logging a warning in development to detect API drift early.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summary (commit f735767)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit f735767)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (5 files)
Reviewed by free · Input: 37.2K · Output: 1.5K · Cached: 106K |
…a toggle group for the mode switch
What
POST /api/requests/:id/repoand suggests the repositories the visitor maintains. Kinds without a scaffold get the link form only.GET /api/submit/owners(account first, then orgs); falls back to the old text field with autofill disabled.Merge order
Needs TabularisDB/tabularium#33 deployed first. Before that, the organization field stays free text and linking returns the registry's 404 as an error.
Checks
next buildpasses (the fetch-app-data step was rate-limited by GitHub locally, so it was run separately).