Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,36 @@
}

.model-option-label {
display: grid;
grid-template-columns: 24px minmax(0, 1fr);
display: inline-flex;
align-items: center;
gap: 9px;
width: 100%;
min-width: 0;
max-width: 100%;
overflow: hidden;
}

.model-option-label.no-avatar {
grid-template-columns: minmax(0, 1fr);
gap: 0;
}

.model-option-label.single-line .model-option-copy {
display: block;
}

.csg-select-trigger .csg-select-value > .model-option-label.single-line {
display: flex;
flex-direction: row;
align-items: center;
}

.csg-select-trigger .csg-select-value > .model-option-label.single-line .model-option-copy {
display: block;
min-width: 0;
}

.model-option-avatar {
flex: 0 0 24px;
width: 24px;
height: 24px;
display: block;
Expand All @@ -205,14 +217,19 @@
}

.model-option-copy {
flex: 1 1 auto;
min-width: 0;
max-width: 100%;
display: grid;
gap: 1px;
overflow: hidden;
}

.model-option-model,
.model-option-provider {
display: block;
min-width: 0;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand Down
6 changes: 5 additions & 1 deletion web/app/src/components/ui/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export type SelectProps = Omit<SelectRootProps, "children"> & {
placeholder?: ReactNode;
searchable?: boolean;
searchPlaceholder?: string;
selectedLabel?: ReactNode;
size?: SelectSize;
triggerClassName?: string;
triggerProps?: Omit<SelectTriggerProps, "children" | "className" | "placeholder" | "size">;
Expand Down Expand Up @@ -197,6 +198,7 @@ export function Select({
placeholder,
searchable = false,
searchPlaceholder = "Search",
selectedLabel,
size = "md",
triggerClassName,
triggerProps,
Expand Down Expand Up @@ -259,7 +261,9 @@ export function Select({
}}
{...props}
>
<SelectTrigger className={triggerClassName} placeholder={placeholder} size={size} {...triggerProps} />
<SelectTrigger className={triggerClassName} placeholder={placeholder} size={size} {...triggerProps}>
{selectedLabel}
</SelectTrigger>
<SelectContent ref={contentRef} className={contentClassName} {...resolvedContentProps}>
{children ??
(options ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@
overflow-y: auto;
overscroll-behavior: contain;
scrollbar-gutter: stable;
scrollbar-width: thin;
scrollbar-color: transparent transparent;
}

.agent-profile-scroll-region::-webkit-scrollbar {
width: 8px;
}

.agent-profile-scroll-region::-webkit-scrollbar-track {
background: transparent;
}

.agent-profile-scroll-region::-webkit-scrollbar-thumb {
background-color: transparent;
border-radius: 6px;
}

.agent-profile-scroll-region.is-scrolling {
scrollbar-color: var(--gray-400) transparent;
}

.agent-profile-scroll-region.is-scrolling::-webkit-scrollbar-thumb {
background-color: var(--gray-400);
}

.agent-profile-scroll-region .profile-editor-shell.agent-page-editor {
Expand Down Expand Up @@ -1636,20 +1659,22 @@
}

.agent-detail-pane .agent-model-config-grid {
grid-template-columns: minmax(220px, 1.05fr) minmax(320px, 1.5fr) minmax(190px, 0.9fr) minmax(220px, 0.85fr);
grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
align-items: start;
}

.agent-detail-pane .agent-model-config-grid > .field {
display: grid;
grid-template-rows: 24px 64px;
gap: 8px;
min-width: 0;
}

.agent-detail-pane .agent-model-config-grid .csg-select-trigger,
.agent-detail-pane .agent-model-config-grid .agent-fast-mode-toggle {
height: 64px;
min-height: 64px;
width: 100%;
min-width: 0;
max-width: 100%;
box-sizing: border-box;
}

.agent-detail-pane .agent-model-config-grid .csg-select-trigger {
Expand All @@ -1662,6 +1687,13 @@
align-items: center;
}

.agent-detail-pane .agent-model-config-grid .csg-select-value,
.agent-detail-pane .agent-model-config-grid .csg-select-value > span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.agent-detail-pane .field input,
.agent-detail-pane .field textarea,
.agent-detail-pane .csg-select-trigger {
Expand Down Expand Up @@ -1720,6 +1752,11 @@
padding: 10px 14px;
}

.agent-detail-pane .agent-model-config-grid .agent-fast-mode-field .compact-toggle-row {
padding: 10px 14px;
box-shadow: var(--input-shadow);
}

.agent-detail-pane .agent-fast-mode-toggle input[type="checkbox"] {
appearance: none;
display: grid;
Expand Down Expand Up @@ -1763,11 +1800,13 @@
}

.agent-detail-pane .agent-fast-mode-help {
display: block;
min-width: 0;
color: var(--muted);
font-size: 14px;
font-weight: 620;
line-height: 20px;
overflow: hidden;
color: var(--input-text);
font: var(--text-md-normal);
text-overflow: ellipsis;
white-space: nowrap;
}

.agent-detail-pane .profile-section .field textarea.compact-textarea {
Expand Down Expand Up @@ -1932,6 +1971,32 @@
color: var(--input-text);
}

:root[data-theme="dark"]
.agent-detail-pane
.profile-section
.agent-model-config-grid
.selection-item.compact-toggle-row.agent-fast-mode-toggle,
:root[data-theme="dark"]
.agent-detail-pane
.profile-section
.agent-model-config-grid
.selection-item.compact-toggle-row.agent-fast-mode-toggle:hover,
:root[data-theme="dark"]
.agent-detail-pane
.profile-section
.agent-model-config-grid
.selection-item.compact-toggle-row.agent-fast-mode-toggle:focus-within,
:root[data-theme="dark"]
.agent-detail-pane
.profile-section
.agent-model-config-grid
.selection-item.compact-toggle-row.agent-fast-mode-toggle:has(input:checked) {
border-color: var(--input-border);
background: var(--input-background);
color: var(--input-text);
box-shadow: var(--input-shadow);
}

:root[data-theme="dark"] .agent-detail-pane .agent-fast-mode-help {
color: var(--input-text);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ export function AgentDetailPane({
const [selectedMCPServerNames, setSelectedMCPServerNames] = useState<string[]>([]);
const [deleteMCPDialogOpen, setDeleteMCPDialogOpen] = useState(false);
const [mcpPendingDelete, setMCPPendingDelete] = useState<MCPServer | null>(null);
const [isProfileScrolling, setIsProfileScrolling] = useState(false);
const descriptionInputRef = useRef<HTMLTextAreaElement | null>(null);
const nameInputRef = useRef<HTMLInputElement | null>(null);
const profileScrollTimerRef = useRef<number | null>(null);
const isManager = isManagerAgent(item);
const canEditAgentName = Boolean(draft && !isManager);
const running = isAgentRunning(item);
Expand Down Expand Up @@ -351,6 +353,26 @@ export function AgentDetailPane({
}
}, [showMCPServers]);

useEffect(
() => () => {
if (profileScrollTimerRef.current) {
window.clearTimeout(profileScrollTimerRef.current);
}
},
[],
);

function onProfileScroll() {
setIsProfileScrolling(true);
if (profileScrollTimerRef.current) {
window.clearTimeout(profileScrollTimerRef.current);
}
profileScrollTimerRef.current = window.setTimeout(() => {
setIsProfileScrolling(false);
profileScrollTimerRef.current = null;
}, 700);
}

async function handleAddSkillsConfirm(): Promise<void> {
if (!selectedSkillNames.length) {
return;
Expand Down Expand Up @@ -599,7 +621,10 @@ export function AgentDetailPane({
</nav>
) : null}
</div>
<div className="agent-profile-scroll-region">
<div
className={`agent-profile-scroll-region${isProfileScrolling ? " is-scrolling" : ""}`}
onScroll={onProfileScroll}
>
{!draft ? (
<>
<div className="entity-grid">
Expand Down Expand Up @@ -1168,6 +1193,7 @@ function AgentModelPanel({
t,
updateDraft,
}: AgentModelPanelProps) {
const selectedProviderOption = providerOptions.find((option) => option.id === selectedProviderID);
return (
<section id="agent-profile-model" className="profile-section agent-profile-scroll-target">
<div className="profile-section-heading">
Expand All @@ -1182,6 +1208,14 @@ function AgentModelPanel({
<Select
value={selectedProviderID}
required
selectedLabel={
selectedProviderOption ? (
<ModelOptionLabel
avatar={selectedProviderOption.avatar}
model={selectedProviderOption.displayName}
/>
) : undefined
}
onValueChange={(value) => {
const nextProvider = providerOptions.find((option) => option.id === value);
if (!nextProvider) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,11 @@ export function AgentProfileModal({
<Select
value={selectedProviderID}
required
selectedLabel={
selectedProvider ? (
<ModelOptionLabel avatar={selectedProvider.avatar} model={selectedProvider.displayName} />
) : undefined
}
onValueChange={(value) => {
const nextProvider = providerOptions.find((option) => option.id === value);
if (!nextProvider) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1210,19 +1210,21 @@
}

.profile-runtime-grid.agent-model-config-grid {
grid-template-columns: minmax(180px, 1.05fr) minmax(240px, 1.4fr) minmax(150px, 0.9fr) minmax(190px, 0.9fr);
grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}

.profile-runtime-grid.agent-model-config-grid > .field {
display: grid;
grid-template-rows: 22px 60px;
gap: 7px;
min-width: 0;
}

.profile-runtime-grid.agent-model-config-grid .csg-select-trigger,
.profile-runtime-grid.agent-model-config-grid .agent-fast-mode-toggle {
height: 60px;
min-height: 60px;
width: 100%;
min-width: 0;
max-width: 100%;
box-sizing: border-box;
}

.profile-runtime-grid.agent-model-config-grid .csg-select-trigger {
Expand Down Expand Up @@ -1647,8 +1649,8 @@

.profile-modal.agent-modal .agent-model-config-grid .agent-fast-mode-field .compact-toggle-row {
align-items: center;
height: 60px;
min-height: 60px;
padding-block: 10px;
box-shadow: var(--input-shadow);
}

.profile-modal.agent-modal .agent-fast-mode-field input[type="checkbox"] {
Expand Down Expand Up @@ -1700,10 +1702,8 @@
.profile-modal.agent-modal .agent-fast-mode-help {
flex: 1 1 auto;
min-width: 0;
color: var(--gray-600);
font-size: 14px;
font-weight: 400;
line-height: 20px;
color: var(--input-text);
font: var(--text-md-normal);
overflow-wrap: anywhere;
white-space: normal;
}
Expand Down Expand Up @@ -2214,6 +2214,32 @@
color: var(--input-text);
}

:root[data-theme="dark"]
.profile-modal.agent-modal
.profile-section
.agent-model-config-grid
.selection-item.compact-toggle-row.agent-fast-mode-toggle,
:root[data-theme="dark"]
.profile-modal.agent-modal
.profile-section
.agent-model-config-grid
.selection-item.compact-toggle-row.agent-fast-mode-toggle:hover,
:root[data-theme="dark"]
.profile-modal.agent-modal
.profile-section
.agent-model-config-grid
.selection-item.compact-toggle-row.agent-fast-mode-toggle:focus-within,
:root[data-theme="dark"]
.profile-modal.agent-modal
.profile-section
.agent-model-config-grid
.selection-item.compact-toggle-row.agent-fast-mode-toggle:has(input:checked) {
border-color: var(--input-border);
background: var(--input-background);
color: var(--input-text);
box-shadow: var(--input-shadow);
}

:root[data-theme="dark"] .profile-modal.agent-modal .agent-sandbox-toggle.readonly,
:root[data-theme="dark"] .profile-modal.agent-modal .agent-sandbox-toggle.readonly:hover,
:root[data-theme="dark"] .profile-modal.agent-modal .agent-sandbox-toggle.readonly:focus-within,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@
color: var(--white);
}

:global(:root[data-theme="dark"]) .active {
background: var(--gray-800);
}

:global(:root[data-theme="dark"]) .alertDot {
box-shadow: 0 0 0 3px var(--surface);
}
Expand Down
Loading
Loading