| ... | @@ -426,18 +426,26 @@ export function ProviderInstanceCard({ | ... | @@ -426,18 +426,26 @@ export function ProviderInstanceCard({ |
| 426 | onRunUpdate, | 426 | onRunUpdate, |
| 427 | isUpdating = false, | 427 | isUpdating = false, |
| 428 | }: ProviderInstanceCardProps) { | 428 | }: ProviderInstanceCardProps) { |
| 429 | const [activeTab, setActiveTab] = useState<"models" | "configuration">("configuration"); | 429 | const [activeTab, setActiveTab] = useState<"configuration" | "models">("configuration"); |
| 430 | const enabled = resolveProviderInstanceEnabled(instance); | 430 | const enabled = resolveProviderInstanceEnabled(instance); |
| 431 | // A locally disabled provider stays neutral even if its last server status | 431 | // A locally disabled provider reads "Disabled" with a muted dot even if its |
| 432 | // is stale. Enabled providers use the server status when one is available. | 432 | // last server status is stale. Enabled providers use the server status. |
| 433 | const statusKey: ProviderStatusKey = enabled | 433 | const statusKey: ProviderStatusKey = enabled |
| 434 | ? ((liveProvider?.status as ProviderStatusKey | undefined) ?? "warning") | 434 | ? ((liveProvider?.status as ProviderStatusKey | undefined) ?? "warning") |
| 435 | : "disabled"; | 435 | : "disabled"; |
| 436 | const statusStyle = PROVIDER_STATUS_STYLES[statusKey]; | 436 | const statusStyle = PROVIDER_STATUS_STYLES[statusKey]; |
| 437 | const rawSummary = getProviderSummary(liveProvider); | 437 | const summary = enabled |
| 438 | const summary = enabled ? rawSummary : { headline: "Disabled", detail: null }; | 438 | ? getProviderSummary(liveProvider) |
| 439 | const authEmail = liveProvider?.auth.email; | 439 | : { headline: "Disabled", detail: null }; |
| 440 | const showEditorStatus = enabled && (statusKey === "warning" || statusKey === "error"); | 440 | const authEmail = liveProvider?.auth.email?.trim(); |
| | 441 | // The editor header folds the account email into the status line — |
| | 442 | // "Authenticated as <email> · <plan>" — with the email redacted until its |
| | 443 | // reveal toggle is clicked. |
| | 444 | const isAuthenticated = enabled && liveProvider?.auth.status === "authenticated"; |
| | 445 | const authLabel = |
| | 446 | enabled && liveProvider?.auth.status === "authenticated" |
| | 447 | ? (liveProvider.auth.label ?? liveProvider.auth.type ?? null) |
| | 448 | : null; |
| 441 | const versionLabel = getProviderVersionLabel(liveProvider?.version); | 449 | const versionLabel = getProviderVersionLabel(liveProvider?.version); |
| 442 | const versionAdvisory = getProviderVersionAdvisoryPresentation(liveProvider?.versionAdvisory); | 450 | const versionAdvisory = getProviderVersionAdvisoryPresentation(liveProvider?.versionAdvisory); |
| 443 | const updateCommand = versionAdvisory?.updateCommand ?? null; | 451 | const updateCommand = versionAdvisory?.updateCommand ?? null; |
| ... | @@ -607,19 +615,34 @@ export function ProviderInstanceCard({ | ... | @@ -607,19 +615,34 @@ export function ProviderInstanceCard({ |
| 607 | <code className="text-xs text-muted-foreground">{versionLabel}</code> | 615 | <code className="text-xs text-muted-foreground">{versionLabel}</code> |
| 608 | ) : null; | 616 | ) : null; |
| 609 | | 617 | |
| | 618 | // Healthy and disabled rows read fine from their text; only trouble gets a dot. |
| | 619 | const statusDotNode = |
| | 620 | statusKey === "warning" || statusKey === "error" ? ( |
| | 621 | <span className={cn("size-1.5 shrink-0 rounded-full", statusStyle.dot)} aria-hidden /> |
| | 622 | ) : null; |
| | 623 | const statusHeadlineNode = <span>{summary.headline}</span>; |
| | 624 | // Trouble states carry the server's explanation (a failed probe, a shadow |
| | 625 | // home entry that is not a symlink, a missing binary). Show it wherever the |
| | 626 | // headline shows so the user can act without opening the editor. |
| | 627 | const needsAttention = statusKey === "warning" || statusKey === "error"; |
| | 628 | const statusLineClassName = |
| | 629 | "flex min-w-0 flex-wrap items-center gap-x-1.5 text-[13px] leading-[1.45] text-muted-foreground/80"; |
| | 630 | |
| 610 | if (mode === "list") { | 631 | if (mode === "list") { |
| 611 | return ( | 632 | return ( |
| 612 | <div | 633 | <div |
| 613 | className={cn( | 634 | className={cn( |
| 614 | "group relative flex min-h-16 items-center gap-3 border-b border-border/60 px-3 py-2.5 transition-colors last:border-b-0", | 635 | // Sidebar-style selection with a fixed row height so the list stays |
| 615 | selected ? "bg-muted/50" : "hover:bg-muted/25", | 636 | // even; the status line clamps to two lines instead of growing. |
| | 637 | "group flex h-19 items-start gap-3 rounded-md px-3 py-2 transition-colors", |
| | 638 | // Foreground-alpha tint so the fill reads the same in light and dark themes. |
| | 639 | selected ? "bg-foreground/8" : "hover:bg-foreground/4", |
| 616 | )} | 640 | )} |
| 617 | > | 641 | > |
| 618 | {selected ? <span className="absolute inset-y-0 left-0 w-0.5 bg-primary" /> : null} | | |
| 619 | <button | 642 | <button |
| 620 | type="button" | 643 | type="button" |
| 621 | className={cn( | 644 | className={cn( |
| 622 | "flex min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-sm text-left outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-ring", | 645 | "flex min-w-0 flex-1 cursor-pointer items-start gap-3 rounded-sm text-left outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-ring", |
| 623 | !enabled && !selected && "opacity-60 group-hover:opacity-100", | 646 | !enabled && !selected && "opacity-60 group-hover:opacity-100", |
| 624 | )} | 647 | )} |
| 625 | onClick={onSelect} | 648 | onClick={onSelect} |
| ... | @@ -629,150 +652,185 @@ export function ProviderInstanceCard({ | ... | @@ -629,150 +652,185 @@ export function ProviderInstanceCard({ |
| 629 | <span className="min-w-0 flex-1"> | 652 | <span className="min-w-0 flex-1"> |
| 630 | <span className="flex min-w-0 items-center gap-2"> | 653 | <span className="flex min-w-0 items-center gap-2"> |
| 631 | <span className="truncate text-sm font-medium text-foreground">{displayName}</span> | 654 | <span className="truncate text-sm font-medium text-foreground">{displayName}</span> |
| | 655 | {String(instanceId) !== String(instance.driver) ? ( |
| | 656 | <code className="min-w-0 truncate rounded bg-muted/60 px-1 py-0.5 text-[10px] text-muted-foreground"> |
| | 657 | {instanceId} |
| | 658 | </code> |
| | 659 | ) : null} |
| 632 | {versionCodeNode} | 660 | {versionCodeNode} |
| | 661 | {versionAdvisory ? ( |
| | 662 | <span role="img" aria-label="Update available" className="inline-flex shrink-0"> |
| | 663 | <ArrowUpCircleIcon className="size-3.5 text-update-foreground" /> |
| | 664 | </span> |
| | 665 | ) : null} |
| 633 | </span> | 666 | </span> |
| 634 | <span className="mt-0.5 flex items-center gap-1.5 text-[11px] text-muted-foreground"> | 667 | <span className="mt-0.5 flex items-start gap-1.5 text-[13px] leading-[1.45] text-muted-foreground/80"> |
| 635 | <span className={cn("size-1.5 shrink-0 rounded-full", statusStyle.dot)} /> | 668 | {statusDotNode ? ( |
| 636 | <span className="truncate">{summary.headline}</span> | 669 | <span className="flex h-[1.45em] shrink-0 items-center">{statusDotNode}</span> |
| | 670 | ) : null} |
| | 671 | <span className="line-clamp-2 [overflow-wrap:anywhere]"> |
| | 672 | {summary.headline} |
| | 673 | {needsAttention && summary.detail ? ` · ${summary.detail}` : null} |
| | 674 | </span> |
| 637 | </span> | 675 | </span> |
| 638 | {String(instanceId) !== String(instance.driver) ? ( | | |
| 639 | <code className="mt-0.5 block truncate text-[10px] text-muted-foreground/70"> | | |
| 640 | {instanceId} | | |
| 641 | </code> | | |
| 642 | ) : null} | | |
| 643 | </span> | 676 | </span> |
| 644 | </button> | 677 | </button> |
| 645 | <Switch | 678 | <span className="flex h-5 shrink-0 items-center"> |
| 646 | checked={enabled} | 679 | <Switch |
| 647 | disabled={readOnly} | 680 | checked={enabled} |
| 648 | onCheckedChange={(checked) => updateEnabled(Boolean(checked))} | 681 | disabled={readOnly} |
| 649 | aria-label={`Enable ${displayName}`} | 682 | onCheckedChange={(checked) => updateEnabled(Boolean(checked))} |
| 650 | /> | 683 | aria-label={`Enable ${displayName}`} |
| | 684 | /> |
| | 685 | </span> |
| 651 | </div> | 686 | </div> |
| 652 | ); | 687 | ); |
| 653 | } | 688 | } |
| 654 | | 689 | |
| 655 | return ( | 690 | return ( |
| 656 | <div className="min-w-0 lg:flex lg:h-full lg:min-h-0 lg:flex-col"> | 691 | <div className="min-w-0 lg:flex lg:h-full lg:min-h-0 lg:flex-col"> |
| 657 | <div | 692 | <div className="flex min-h-16 shrink-0 items-start justify-between gap-3 border-b border-border/70 px-4 py-3"> |
| 658 | inert={readOnly} | | |
| 659 | aria-disabled={readOnly || undefined} | | |
| 660 | className={cn( | | |
| 661 | "flex min-h-16 shrink-0 items-center justify-between gap-3 border-b border-border/70 px-4 py-3", | | |
| 662 | readOnly && "opacity-50 select-none", | | |
| 663 | )} | | |
| 664 | > | | |
| 665 | <div className="min-w-0 flex-1 space-y-1"> | 693 | <div className="min-w-0 flex-1 space-y-1"> |
| 666 | <div className="flex min-w-0 flex-wrap items-center gap-2"> | 694 | <div className="flex min-w-0 flex-wrap items-center gap-2"> |
| 667 | {titleHeadNode} | 695 | {titleHeadNode} |
| 668 | {versionCodeNode} | 696 | {versionCodeNode} |
| 669 | {versionAdvisory ? ( | 697 | {/* |
| 670 | <Popover> | 698 | Only the write actions go inert on read-only sessions; the |
| 671 | <PopoverTrigger | 699 | status line below keeps its email reveal clickable. |
| 672 | render={ | 700 | */} |
| 673 | <Button | 701 | <span |
| 674 | type="button" | 702 | inert={readOnly} |
| 675 | size="icon-xs" | 703 | aria-disabled={readOnly || undefined} |
| 676 | variant="ghost" | 704 | className={cn("inline-flex items-center gap-2", readOnly && "opacity-50")} |
| 677 | className={cn( | 705 | > |
| 678 | "size-5 rounded-sm p-0", | 706 | {versionAdvisory ? ( |
| 679 | versionAdvisory.emphasis === "strong" | 707 | <Popover> |
| 680 | ? "text-warning hover:text-warning" | 708 | <PopoverTrigger |
| 681 | : "text-update-foreground hover:text-update-foreground", | 709 | render={ |
| 682 | )} | 710 | <Button |
| 683 | aria-label="Update available — view details" | 711 | type="button" |
| 684 | > | 712 | size="icon-xs" |
| 685 | <ArrowUpCircleIcon className="size-3.5" /> | 713 | variant="ghost" |
| 686 | </Button> | | |
| 687 | } | | |
| 688 | /> | | |
| 689 | <PopoverPopup | | |
| 690 | side="bottom" | | |
| 691 | align="start" | | |
| 692 | className="w-[min(21rem,calc(100vw-1.5rem))] [--popup-width:min(21rem,calc(100vw-1.5rem))]" | | |
| 693 | > | | |
| 694 | <div className="grid min-w-0 gap-3"> | | |
| 695 | <div className="grid gap-0.5"> | | |
| 696 | <p className="text-[13px] font-semibold leading-tight text-foreground"> | | |
| 697 | Update available | | |
| 698 | </p> | | |
| 699 | <p | | |
| 700 | className={cn( | 714 | className={cn( |
| 701 | "text-xs leading-snug", | 715 | "size-5 rounded-sm p-0", |
| 702 | versionAdvisory.emphasis === "strong" | 716 | versionAdvisory.emphasis === "strong" |
| 703 | ? "text-warning" | 717 | ? "text-warning hover:text-warning" |
| 704 | : "text-muted-foreground", | 718 | : "text-update-foreground hover:text-update-foreground", |
| 705 | )} | 719 | )} |
| | 720 | aria-label="Update available — view details" |
| 706 | > | 721 | > |
| 707 | {versionAdvisory.detail} | 722 | <ArrowUpCircleIcon className="size-3.5" /> |
| 708 | </p> | | |
| 709 | </div> | | |
| 710 | {onRunUpdate ? ( | | |
| 711 | <Button | | |
| 712 | type="button" | | |
| 713 | size="xs" | | |
| 714 | variant="default" | | |
| 715 | className="w-full" | | |
| 716 | disabled={isUpdating} | | |
| 717 | onClick={onRunUpdate} | | |
| 718 | > | | |
| 719 | {isUpdating ? <LoaderIcon className="animate-spin" /> : <DownloadIcon />} | | |
| 720 | {isUpdating ? "Updating" : "Update now"} | | |
| 721 | </Button> | 723 | </Button> |
| 722 | ) : null} | 724 | } |
| 723 | {onRunUpdate && updateCommand ? ( | 725 | /> |
| 724 | <div className="flex items-center gap-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground"> | 726 | <PopoverPopup |
| 725 | <span aria-hidden className="h-px flex-1 bg-border" /> | 727 | side="bottom" |
| 726 | or, update manually using | 728 | align="start" |
| 727 | <span aria-hidden className="h-px flex-1 bg-border" /> | 729 | className="w-[min(21rem,calc(100vw-1.5rem))] [--popup-width:min(21rem,calc(100vw-1.5rem))]" |
| 728 | </div> | 730 | > |
| 729 | ) : null} | 731 | <div className="grid min-w-0 gap-3"> |
| 730 | {updateCommand ? ( | 732 | <div className="grid gap-0.5"> |
| 731 | <div className="flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2"> | 733 | <p className="text-[13px] font-semibold leading-tight text-foreground"> |
| 732 | <ScrollArea scrollFade className="h-8 min-w-0 flex-1 rounded-none"> | 734 | Update available |
| 733 | <code className="flex h-full w-max items-center whitespace-nowrap pr-3 font-mono text-[11px] text-foreground"> | 735 | </p> |
| 734 | {updateCommand} | 736 | <p |
| 735 | </code> | 737 | className={cn( |
| 736 | </ScrollArea> | 738 | "text-xs leading-snug", |
| 737 | <Tooltip> | 739 | versionAdvisory.emphasis === "strong" |
| 738 | <TooltipTrigger | 740 | ? "text-warning" |
| 739 | render={ | 741 | : "text-muted-foreground", |
| 740 | <Button | 742 | )} |
| 741 | type="button" | 743 | > |
| 742 | size="icon-xs" | 744 | {versionAdvisory.detail} |
| 743 | variant="ghost" | 745 | </p> |
| 744 | className="size-6 shrink-0 rounded-sm p-0 text-muted-foreground hover:text-foreground" | | |
| 745 | onClick={() => | | |
| 746 | copyToClipboard(updateCommand, { | | |
| 747 | providerName: displayName, | | |
| 748 | }) | | |
| 749 | } | | |
| 750 | aria-label="Copy update command" | | |
| 751 | > | | |
| 752 | <CopyIcon className="size-3" /> | | |
| 753 | </Button> | | |
| 754 | } | | |
| 755 | /> | | |
| 756 | <TooltipPopup side="top">Copy command</TooltipPopup> | | |
| 757 | </Tooltip> | | |
| 758 | </div> | 746 | </div> |
| 759 | ) : null} | 747 | {onRunUpdate ? ( |
| 760 | </div> | 748 | <Button |
| 761 | </PopoverPopup> | 749 | type="button" |
| 762 | </Popover> | 750 | size="xs" |
| 763 | ) : null} | 751 | variant="default" |
| 764 | {titleTailNode} | 752 | className="w-full" |
| | 753 | disabled={isUpdating} |
| | 754 | onClick={onRunUpdate} |
| | 755 | > |
| | 756 | {isUpdating ? <LoaderIcon className="animate-spin" /> : <DownloadIcon />} |
| | 757 | {isUpdating ? "Updating" : "Update now"} |
| | 758 | </Button> |
| | 759 | ) : null} |
| | 760 | {onRunUpdate && updateCommand ? ( |
| | 761 | <div className="flex items-center gap-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground"> |
| | 762 | <span aria-hidden className="h-px flex-1 bg-border" /> |
| | 763 | or, update manually using |
| | 764 | <span aria-hidden className="h-px flex-1 bg-border" /> |
| | 765 | </div> |
| | 766 | ) : null} |
| | 767 | {updateCommand ? ( |
| | 768 | <div className="flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2"> |
| | 769 | <ScrollArea scrollFade className="h-8 min-w-0 flex-1 rounded-none"> |
| | 770 | <code className="flex h-full w-max items-center whitespace-nowrap pr-3 font-mono text-[11px] text-foreground"> |
| | 771 | {updateCommand} |
| | 772 | </code> |
| | 773 | </ScrollArea> |
| | 774 | <Tooltip> |
| | 775 | <TooltipTrigger |
| | 776 | render={ |
| | 777 | <Button |
| | 778 | type="button" |
| | 779 | size="icon-xs" |
| | 780 | variant="ghost" |
| | 781 | className="size-6 shrink-0 rounded-sm p-0 text-muted-foreground hover:text-foreground" |
| | 782 | onClick={() => |
| | 783 | copyToClipboard(updateCommand, { |
| | 784 | providerName: displayName, |
| | 785 | }) |
| | 786 | } |
| | 787 | aria-label="Copy update command" |
| | 788 | > |
| | 789 | <CopyIcon className="size-3" /> |
| | 790 | </Button> |
| | 791 | } |
| | 792 | /> |
| | 793 | <TooltipPopup side="top">Copy command</TooltipPopup> |
| | 794 | </Tooltip> |
| | 795 | </div> |
| | 796 | ) : null} |
| | 797 | </div> |
| | 798 | </PopoverPopup> |
| | 799 | </Popover> |
| | 800 | ) : null} |
| | 801 | {titleTailNode} |
| | 802 | </span> |
| 765 | </div> | 803 | </div> |
| 766 | {showEditorStatus ? ( | 804 | <p className={statusLineClassName}> |
| 767 | <p className="flex min-w-0 flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground"> | 805 | {statusDotNode} |
| 768 | <span>{summary.headline}</span> | 806 | {isAuthenticated && authEmail ? ( |
| 769 | {summary.detail ? <span>· {summary.detail}</span> : null} | 807 | <> |
| | 808 | <span>Authenticated as</span> |
| | 809 | <ProviderAuthEmail email={authEmail} /> |
| | 810 | {authLabel ? <span>· {authLabel}</span> : null} |
| | 811 | </> |
| | 812 | ) : ( |
| | 813 | statusHeadlineNode |
| | 814 | )} |
| | 815 | {summary.detail && !needsAttention ? <span>· {summary.detail}</span> : null} |
| | 816 | </p> |
| | 817 | {summary.detail && needsAttention ? ( |
| | 818 | <p className="text-[13px] leading-[1.45] text-muted-foreground/80 [overflow-wrap:anywhere]"> |
| | 819 | {summary.detail} |
| 770 | </p> | 820 | </p> |
| 771 | ) : null} | 821 | ) : null} |
| 772 | </div> | 822 | </div> |
| 773 | </div> | 823 | </div> |
| 774 | | 824 | |
| 775 | <div className="flex h-11 shrink-0 border-b border-border/70 px-1"> | 825 | <div className="flex h-11 shrink-0 border-b border-border/70 px-1"> |
| | 826 | <button |
| | 827 | type="button" |
| | 828 | aria-pressed={visibleTab === "configuration"} |
| | 829 | className={providerSettingsTabClassName(visibleTab === "configuration")} |
| | 830 | onClick={() => setActiveTab("configuration")} |
| | 831 | > |
| | 832 | Configuration |
| | 833 | </button> |
| 776 | {driverOption !== undefined ? ( | 834 | {driverOption !== undefined ? ( |
| 777 | <button | 835 | <button |
| 778 | type="button" | 836 | type="button" |
| ... | @@ -783,91 +841,83 @@ export function ProviderInstanceCard({ | ... | @@ -783,91 +841,83 @@ export function ProviderInstanceCard({ |
| 783 | Models | 841 | Models |
| 784 | </button> | 842 | </button> |
| 785 | ) : null} | 843 | ) : null} |
| 786 | <button | | |
| 787 | type="button" | | |
| 788 | aria-pressed={visibleTab === "configuration"} | | |
| 789 | className={providerSettingsTabClassName(visibleTab === "configuration")} | | |
| 790 | onClick={() => setActiveTab("configuration")} | | |
| 791 | > | | |
| 792 | Configuration | | |
| 793 | </button> | | |
| 794 | </div> | 844 | </div> |
| 795 | | 845 | |
| 796 | <div | 846 | <div className="lg:min-h-0 lg:flex-1"> |
| 797 | inert={readOnly} | 847 | <ScrollArea |
| 798 | aria-disabled={readOnly || undefined} | 848 | scrollFade |
| 799 | className={cn("lg:min-h-0 lg:flex-1", readOnly && "opacity-50 select-none")} | 849 | chainVerticalScroll |
| 800 | > | 850 | className="lg:h-full" |
| 801 | <div | | |
| 802 | className="space-y-5 px-4 py-5 lg:h-full lg:overflow-y-auto" | | |
| 803 | hidden={visibleTab !== "configuration"} | 851 | hidden={visibleTab !== "configuration"} |
| 804 | > | 852 | > |
| 805 | {authEmail?.trim() ? ( | 853 | <div |
| 806 | <div className="min-w-0"> | 854 | inert={readOnly} |
| 807 | <div className="text-xs font-medium text-foreground">Account email</div> | 855 | aria-disabled={readOnly || undefined} |
| 808 | <div className="mt-1.5 flex min-h-8 min-w-0 items-center"> | 856 | className={cn("space-y-5 px-4 py-5", readOnly && "opacity-50 select-none")} |
| 809 | <ProviderAuthEmail email={authEmail} /> | 857 | > |
| 810 | </div> | 858 | <div> |
| | 859 | <label htmlFor={`provider-instance-${instanceId}-display-name`} className="block"> |
| | 860 | <span className="text-xs font-medium text-foreground">Display name</span> |
| | 861 | <DraftInput |
| | 862 | id={`provider-instance-${instanceId}-display-name`} |
| | 863 | className="mt-1.5" |
| | 864 | value={instance.displayName ?? ""} |
| | 865 | onCommit={updateDisplayName} |
| | 866 | placeholder={driverOption?.label ?? "Instance label"} |
| | 867 | spellCheck={false} |
| | 868 | /> |
| | 869 | <span className="mt-1 block text-xs text-muted-foreground"> |
| | 870 | Optional label shown in the provider list. |
| | 871 | </span> |
| | 872 | </label> |
| 811 | </div> | 873 | </div> |
| 812 | ) : null} | | |
| 813 | | 874 | |
| 814 | <div> | 875 | <div> |
| 815 | <label htmlFor={`provider-instance-${instanceId}-display-name`} className="block"> | 876 | <ProviderAccentColorPicker |
| 816 | <span className="text-xs font-medium text-foreground">Display name</span> | 877 | displayName={displayName} |
| 817 | <DraftInput | 878 | value={accentColor} |
| 818 | id={`provider-instance-${instanceId}-display-name`} | 879 | onCommit={updateAccentColor} |
| 819 | className="mt-1.5" | 880 | commitDelayMs={120} |
| 820 | value={instance.displayName ?? ""} | 881 | description="Used to distinguish this instance in picker rails and model lists." |
| 821 | onCommit={updateDisplayName} | | |
| 822 | placeholder={driverOption?.label ?? "Instance label"} | | |
| 823 | spellCheck={false} | | |
| 824 | /> | 882 | /> |
| 825 | <span className="mt-1 block text-xs text-muted-foreground"> | 883 | </div> |
| 826 | Optional label shown in the provider list. | | |
| 827 | </span> | | |
| 828 | </label> | | |
| 829 | </div> | | |
| 830 | | | |
| 831 | <div> | | |
| 832 | <ProviderAccentColorPicker | | |
| 833 | displayName={displayName} | | |
| 834 | value={accentColor} | | |
| 835 | onCommit={updateAccentColor} | | |
| 836 | commitDelayMs={120} | | |
| 837 | description="Used to distinguish this instance in picker rails and model lists." | | |
| 838 | /> | | |
| 839 | </div> | | |
| 840 | | | |
| 841 | <div> | | |
| 842 | <ProviderEnvironmentSection | | |
| 843 | environment={instance.environment ?? []} | | |
| 844 | onChange={updateEnvironment} | | |
| 845 | /> | | |
| 846 | </div> | | |
| 847 | | | |
| 848 | {driverOption ? ( | | |
| 849 | <ProviderSettingsForm | | |
| 850 | definition={driverOption} | | |
| 851 | value={instance.config} | | |
| 852 | idPrefix={`provider-instance-${instanceId}`} | | |
| 853 | variant="card" | | |
| 854 | onChange={updateConfig} | | |
| 855 | /> | | |
| 856 | ) : null} | | |
| 857 | | 884 | |
| 858 | {driverOption === undefined ? ( | | |
| 859 | <div> | 885 | <div> |
| 860 | <p className="text-xs text-muted-foreground"> | 886 | <ProviderEnvironmentSection |
| 861 | This instance uses a driver ( | 887 | environment={instance.environment ?? []} |
| 862 | <code className="text-foreground">{String(instance.driver)}</code>) that is not | 888 | onChange={updateEnvironment} |
| 863 | shipped with the current build. Configuration values are preserved but cannot be | 889 | /> |
| 864 | edited from this surface. | | |
| 865 | </p> | | |
| 866 | </div> | 890 | </div> |
| 867 | ) : null} | 891 | |
| 868 | </div> | 892 | {driverOption ? ( |
| | 893 | <ProviderSettingsForm |
| | 894 | definition={driverOption} |
| | 895 | value={instance.config} |
| | 896 | idPrefix={`provider-instance-${instanceId}`} |
| | 897 | variant="card" |
| | 898 | onChange={updateConfig} |
| | 899 | /> |
| | 900 | ) : null} |
| | 901 | |
| | 902 | {driverOption === undefined ? ( |
| | 903 | <div> |
| | 904 | <p className="text-xs text-muted-foreground"> |
| | 905 | This instance uses a driver ( |
| | 906 | <code className="text-foreground">{String(instance.driver)}</code>) that is not |
| | 907 | shipped with the current build. Configuration values are preserved but cannot be |
| | 908 | edited from this surface. |
| | 909 | </p> |
| | 910 | </div> |
| | 911 | ) : null} |
| | 912 | </div> |
| | 913 | </ScrollArea> |
| 869 | {driverOption !== undefined ? ( | 914 | {driverOption !== undefined ? ( |
| 870 | <div className="px-4 py-5 lg:h-full lg:min-h-0" hidden={visibleTab !== "models"}> | 915 | <div |
| | 916 | inert={readOnly} |
| | 917 | aria-disabled={readOnly || undefined} |
| | 918 | className={cn("px-4 py-5 lg:h-full lg:min-h-0", readOnly && "opacity-50 select-none")} |
| | 919 | hidden={visibleTab !== "models"} |
| | 920 | > |
| 871 | <ProviderModelsSection | 921 | <ProviderModelsSection |
| 872 | instanceId={instanceId} | 922 | instanceId={instanceId} |
| 873 | driverKind={driverKind} | 923 | driverKind={driverKind} |