-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Polish advanced agent setup and Welcome composer #4926
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
base: main
Are you sure you want to change the base?
Changes from all commits
1367ef1
32ca907
1889bc0
189e218
d1fc923
198666a
eb8308c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import { useBackendProvidersQuery } from "@/features/agents/hooks"; | |
| import { probeBackendProvider } from "@/shared/api/tauri"; | ||
|
|
||
| import { ProviderConfigFields } from "./ProviderConfigFields"; | ||
| import { PersonaDropdownField } from "./PersonaDropdownField"; | ||
| import { | ||
| applyProbeResult, | ||
| emptyWhereToRunDraft, | ||
|
|
@@ -23,6 +24,16 @@ export function WhereToRunSection({ | |
| }) { | ||
| const backendProviders = useBackendProvidersQuery().data ?? []; | ||
| const [probeError, setProbeError] = React.useState<string | null>(null); | ||
| const runOnOptions = React.useMemo( | ||
| () => [ | ||
| { label: "This computer", value: "local" }, | ||
| ...backendProviders.map((provider) => ({ | ||
| label: provider.id, | ||
| value: provider.id, | ||
| })), | ||
| ], | ||
| [backendProviders], | ||
| ); | ||
| const isProviderMode = draft.runOn !== "local"; | ||
| const selectedBackendProvider = React.useMemo( | ||
| () => | ||
|
|
@@ -51,7 +62,7 @@ export function WhereToRunSection({ | |
| ? (selectedBackendProvider?.binaryPath ?? null) | ||
| : null; | ||
| React.useEffect(() => { | ||
| if (!selectedBinaryPath) { | ||
| if (!selectedBinaryPath || draft.probedProvider) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a user collapses Advanced before the provider probe resolves and immediately reopens it, unmount cleanup only marks the local callback cancelled; it cannot cancel the Tauri Useful? React with 👍 / 👎. |
||
| setProbeError(null); | ||
| return; | ||
| } | ||
|
|
@@ -70,7 +81,7 @@ export function WhereToRunSection({ | |
| return () => { | ||
| cancelled = true; | ||
| }; | ||
| }, [selectedBinaryPath]); | ||
| }, [selectedBinaryPath, draft.probedProvider]); | ||
|
|
||
| if (backendProviders.length === 0) return null; | ||
|
|
||
|
|
@@ -80,25 +91,19 @@ export function WhereToRunSection({ | |
| <label className="text-sm font-medium" htmlFor="agent-run-on"> | ||
| Run on | ||
| </label> | ||
| <select | ||
| className="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs" | ||
| <PersonaDropdownField | ||
| disabled={isPending} | ||
| id="agent-run-on" | ||
| onChange={(event) => | ||
| onValueChange={(runOn) => | ||
| onDraftChange({ | ||
| ...emptyWhereToRunDraft, | ||
| runOn: event.target.value, | ||
| runOn, | ||
| }) | ||
| } | ||
| options={runOnOptions} | ||
| placeholder="Choose where to run" | ||
| value={draft.runOn} | ||
| > | ||
| <option value="local">This computer</option> | ||
| {backendProviders.map((provider) => ( | ||
| <option key={provider.id} value={provider.id}> | ||
| {provider.id} | ||
| </option> | ||
| ))} | ||
| </select> | ||
| /> | ||
| </div> | ||
|
|
||
| {isProviderMode && selectedBackendProvider ? ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ import * as React from "react"; | |
| import { AnimatePresence, motion, useReducedMotion } from "motion/react"; | ||
| import { Bot, Check } from "lucide-react"; | ||
|
|
||
| import { ComposerDockGlassBackdrop } from "@/features/messages/ui/ComposerDockBackdrop"; | ||
| import { cn } from "@/shared/lib/cn"; | ||
|
|
||
| const WELCOME_PERSONA_NAMES = ["Fizz"] as const; | ||
|
|
@@ -414,3 +415,29 @@ export function WelcomeComposerBanner({ | |
| </AnimatePresence> | ||
| ); | ||
| } | ||
|
|
||
| type WelcomeComposerGuidanceLayerProps = WelcomeComposerBannerProps & { | ||
| children: React.ReactNode; | ||
| }; | ||
|
|
||
| export function WelcomeComposerGuidanceLayer({ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
AGENTS.md reference: AGENTS.md:L113-L116 Useful? React with 👍 / 👎. |
||
| children, | ||
| settingUp, | ||
| state, | ||
| }: WelcomeComposerGuidanceLayerProps) { | ||
| return ( | ||
| <div | ||
| className="absolute inset-x-0 bottom-full z-[-1]" | ||
|
klopez4212 marked this conversation as resolved.
|
||
| data-testid="welcome-composer-guidance-layer" | ||
| > | ||
| <div className="relative"> | ||
| <ComposerDockGlassBackdrop | ||
| className="absolute inset-x-5 top-0 bottom-3 z-0 rounded-t-2xl" | ||
| testId="welcome-composer-guidance-backdrop" | ||
| /> | ||
| {children} | ||
| <WelcomeComposerBanner settingUp={settingUp} state={state} /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.