-
Notifications
You must be signed in to change notification settings - Fork 515
fix(dashboard): repair and polish the GitHub link-existing project flow #1441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
BilalG1
wants to merge
19
commits into
dev
Choose a base branch
from
fix/github-config-link-flow
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d0e6ad1
fix(dashboard): repair GitHub config link-existing flow
BilalG1 65789a1
fix(dashboard): use npx instead of pnpx in config sync workflow
BilalG1 ed25eab
feat(dashboard): improve local CLI step in link-existing flow
BilalG1 ebb090e
chore(dashboard): trim helper text on local CLI link step
BilalG1 55ff7e3
feat(stack-cli): fall back to STACK_PROJECT_ID env var for project id
BilalG1 de9ec19
fix(dashboard): avoid flashing GitHub providerAccountId in account drβ¦
BilalG1 7550eaa
feat(dashboard): searchable combobox for repo + branch in link flow
BilalG1 2faffb6
refactor(dashboard): drop unused useTransition around onboarding statβ¦
BilalG1 5ce1b6b
refactor(dashboard): race-safe loadRepositories and simpler combobox API
BilalG1 34db0d5
Merge branch 'dev' into fix/github-config-link-flow
BilalG1 03e8a5e
feat(dashboard): scope repo search, surface rate limits, branch refresh
BilalG1 08c8356
chore(dashboard): bump generated workflow to actions/{checkout,setup-β¦
BilalG1 08bbba5
Merge remote-tracking branch 'origin/dev' into fix/github-config-linkβ¦
BilalG1 cdf4c68
fix(dashboard): throw if config path normalizes to empty in workflow β¦
BilalG1 b6783b2
fix(dashboard): escape project.id via JSON.stringify in copy-paste CLβ¦
BilalG1 815560c
Merge branch 'dev' into fix/github-config-link-flow
BilalG1 c80c89f
fix(dashboard): throw on invalid matching-refs response
BilalG1 22e9f63
Merge branch 'dev' into fix/github-config-link-flow
BilalG1 4d415a5
Merge branch 'dev' into fix/github-config-link-flow
BilalG1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
105 changes: 105 additions & 0 deletions
105
.../(protected)/(outside-dashboard)/new-project/page-client-parts/link-existing-combobox.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| "use client"; | ||
|
|
||
| import { Spinner, Typography, cn } from "@/components/ui"; | ||
| import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command"; | ||
| import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; | ||
| import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons"; | ||
| import { useState } from "react"; | ||
|
|
||
| export type ComboboxItem = { | ||
| value: string, | ||
| label: string, | ||
| description?: string, | ||
| }; | ||
|
|
||
| type Props = { | ||
| value: string, | ||
| items: ComboboxItem[], | ||
| onSelect: (value: string) => void, | ||
| query: string, | ||
| onQueryChange: (query: string) => void, | ||
| triggerPlaceholder?: string, | ||
| inputPlaceholder?: string, | ||
| emptyMessage?: string, | ||
| loading?: boolean, | ||
| disabled?: boolean, | ||
| }; | ||
|
|
||
| export function RemoteSearchCombobox(props: Props) { | ||
| const [open, setOpen] = useState(false); | ||
| const selectedLabel = props.items.find((item) => item.value === props.value)?.label ?? props.value; | ||
|
|
||
| return ( | ||
| <Popover open={open} onOpenChange={setOpen}> | ||
| <PopoverTrigger asChild> | ||
| <button | ||
| type="button" | ||
| disabled={props.disabled} | ||
| className={cn( | ||
| "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-xl", | ||
| "border border-black/[0.08] bg-white/80 px-3 py-2 text-sm shadow-sm ring-1 ring-black/[0.08]", | ||
| "transition-all duration-150 hover:transition-none hover:ring-black/[0.12]", | ||
| "focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500/30", | ||
| "disabled:cursor-not-allowed disabled:opacity-50", | ||
| "dark:border-white/[0.06] dark:bg-background/60 dark:ring-white/[0.06] dark:hover:ring-white/[0.1]", | ||
| )} | ||
| > | ||
| <span className={cn("truncate text-left", selectedLabel.length === 0 && "text-muted-foreground")}> | ||
| {selectedLabel.length > 0 ? selectedLabel : (props.triggerPlaceholder ?? "Select")} | ||
| </span> | ||
| <CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-60" /> | ||
| </button> | ||
| </PopoverTrigger> | ||
| <PopoverContent | ||
| className="w-[--radix-popover-trigger-width] p-0" | ||
| align="start" | ||
| > | ||
| <Command shouldFilter={false}> | ||
| <CommandInput | ||
| placeholder={props.inputPlaceholder ?? "Search..."} | ||
| value={props.query} | ||
| onValueChange={props.onQueryChange} | ||
| /> | ||
| <CommandList> | ||
| {props.loading && ( | ||
| <div className="flex items-center gap-2 px-3 py-3"> | ||
| <Spinner size={14} /> | ||
| <Typography variant="secondary" className="text-sm">Searching...</Typography> | ||
| </div> | ||
| )} | ||
| {!props.loading && props.items.length === 0 && ( | ||
| <CommandEmpty>{props.emptyMessage ?? "No results."}</CommandEmpty> | ||
| )} | ||
| {props.items.length > 0 && ( | ||
| <CommandGroup> | ||
| {props.items.map((item) => ( | ||
| <CommandItem | ||
| key={item.value} | ||
| value={item.value} | ||
| onSelect={() => { | ||
| props.onSelect(item.value); | ||
| setOpen(false); | ||
| }} | ||
| > | ||
| <CheckIcon | ||
| className={cn( | ||
| "mr-2 h-4 w-4 shrink-0", | ||
| props.value === item.value ? "opacity-100" : "opacity-0", | ||
| )} | ||
| /> | ||
| <div className="min-w-0 flex-1"> | ||
| <div className="truncate text-sm">{item.label}</div> | ||
| {item.description != null && ( | ||
| <div className="truncate text-xs text-muted-foreground">{item.description}</div> | ||
| )} | ||
| </div> | ||
| </CommandItem> | ||
| ))} | ||
| </CommandGroup> | ||
| )} | ||
| </CommandList> | ||
| </Command> | ||
| </PopoverContent> | ||
| </Popover> | ||
| ); | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.