Skip to content

An open-source, faster Devin alternative

TypeScript

fix: clarify repository import review

Igor Zalutskid657c12671df
diff --git a/web/src/pages/AgentNew.tsx b/web/src/pages/AgentNew.tsx
index 18c4ad7b..96c533d4 100644
--- a/web/src/pages/AgentNew.tsx
+++ b/web/src/pages/AgentNew.tsx
@@ -122,6 +122,13 @@ function formatBytes(bytes: number): string {
return `${(bytes / 1024 / 1024).toFixed(1)} MiB`
}
+function agentReviewError(error: unknown): string {
+ if (error instanceof ApiError && error.type === 'builds_unavailable') {
+ return 'Repository import is temporarily unavailable. Try reviewing the agent again.'
+ }
+ return error instanceof Error ? error.message : 'Agent review failed.'
+}
+
function ModeButton({
active,
onClick,
@@ -142,18 +149,15 @@ function ModeButton({
onClick={onClick}
className={cn(
'focus-visible:ring-ring/50 flex min-w-0 flex-1 items-start gap-3 rounded-md px-3 py-2.5 text-left transition-colors outline-none focus-visible:ring-3',
- active ? 'bg-foreground text-background' : 'hover:bg-muted',
+ active
+ ? 'bg-background text-foreground ring-border shadow-sm ring-1'
+ : 'hover:bg-background/60',
)}
>
<Icon className="mt-0.5 size-4 shrink-0" aria-hidden />
<span className="min-w-0">
<span className="block text-sm font-medium">{title}</span>
- <span
- className={cn(
- 'mt-0.5 block text-xs',
- active ? 'text-background/80' : 'text-muted-foreground',
- )}
- >
+ <span className="text-muted-foreground mt-0.5 block text-xs">
{description}
</span>
</span>
@@ -487,11 +491,7 @@ function GithubImport({ app }: { app: DeployApp }) {
) : null}
{inspectMutation.isError ? (
- <FieldError>
- {inspectMutation.error instanceof Error
- ? inspectMutation.error.message
- : 'Repository inspection failed.'}
- </FieldError>
+ <FieldError>{agentReviewError(inspectMutation.error)}</FieldError>
) : null}
<div className="flex justify-end">
@@ -505,10 +505,12 @@ function GithubImport({ app }: { app: DeployApp }) {
<Loader2 className="size-4 animate-spin motion-reduce:animate-none" />
) : null}
{inspectMutation.isPending
- ? 'Inspecting repository…'
- : inspection
- ? 'Inspect again'
- : 'Inspect repository'}
+ ? 'Reviewing agent…'
+ : inspectMutation.isError
+ ? 'Review agent again'
+ : inspection
+ ? 'Review again'
+ : 'Review agent'}
</Button>
</div>
</PanelContent>