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 @@ -88,4 +88,21 @@ describe('ModelSettingsPage presentation', () => {
/@container config-panel \(max-width: 360px\)\s*\{\s*&__cli-account\.openbitfun-config-page-row\s*\{[\s\S]*?grid-template-columns: minmax\(0, 1fr\);[\s\S]*?gap: var\(--openbitfun-space-2\);[\s\S]*?justify-content: flex-start;/,
);
});

it('lays out fallback channels across the full row width below a standard-measure add picker', () => {
const start = source.indexOf('function renderChannelRoutingRows(');
const end = source.indexOf('const renderSelectedModelRows = () =>', start);
const channelRouting = source.slice(start, end);

expect(start).toBeGreaterThan(-1);
expect(channelRouting).not.toContain('<FieldGroup');
expect(channelRouting).not.toContain('account-pool-item');
expect(channelRouting).toContain('openbitfun-model-settings__channel-route-row');
expect(channelRouting).toContain('<ol className="openbitfun-model-settings__channel-route-list">');
expect(styles).toMatch(
/&__channel-route-row\.openbitfun-config-page-row\s*\{[\s\S]*?grid-template-columns: minmax\(0, 1fr\) minmax\(0, var\(--openbitfun-overlay-menu-inline-size\)\);/,
);
expect(styles).toMatch(/&__channel-route-list\s*\{[\s\S]*?grid-column: 1 \/ -1;/);
expect(styles).not.toMatch(/&__channel-route-item\s*\{[^}]*flex-wrap:\s*wrap/);
});
});
165 changes: 162 additions & 3 deletions src/web-ui/src/app/scenes/settings/pages/ai/ModelSettingsPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,7 @@
gap: var(--openbitfun-space-2);
}

&__account-pool,
&__channel-route {
&__account-pool {
display: flex;
flex-direction: column;
gap: var(--openbitfun-space-3);
Expand Down Expand Up @@ -1442,13 +1441,153 @@
min-inline-size: 0;
}

&__channel-route-row.openbitfun-config-page-row {
grid-template-columns: minmax(0, 1fr) minmax(0, var(--openbitfun-overlay-menu-inline-size));
row-gap: var(--openbitfun-space-3);

&:has(.openbitfun-model-settings__channel-route-empty) {
grid-template-columns: minmax(0, 1fr) auto;
}

&[data-has-fallbacks='true']:hover {
background: transparent;
}

> .openbitfun-config-page-row__meta {
grid-column: 1;
grid-row: 1;
}

> .openbitfun-config-page-row__control {
display: contents;
}
}

&__channel-route {
display: contents;
}

&__channel-route-picker {
grid-column: 2;
grid-row: 1;
align-self: center;
display: flex;
align-items: center;
justify-content: flex-end;
inline-size: 100%;
min-inline-size: 0;

> [data-openbitfun-component='select'] {
inline-size: 100%;
min-inline-size: 0;
}
}

&__channel-route-empty {
color: var(--openbitfun-color-content-muted);
font-size: var(--openbitfun-type-body-sm-font-size);
line-height: var(--openbitfun-type-body-sm-line-height);
text-align: end;
}

&__channel-route-list {
grid-column: 1 / -1;
grid-row: 2;
display: flex;
flex-direction: column;
margin: 0;
padding: 0;
list-style: none;
min-inline-size: 0;
border: var(--openbitfun-border-width-default) solid var(--openbitfun-color-border-subtle);
border-radius: var(--openbitfun-radius-base);
background: var(--openbitfun-color-surface-subtle);
overflow: clip;
}

&__channel-route-item {
display: flex;
align-items: center;
gap: var(--openbitfun-space-2);
min-inline-size: 0;
min-block-size: calc(var(--openbitfun-control-height-sm) + var(--openbitfun-space-1));
padding: var(--openbitfun-space-1) var(--openbitfun-space-2) var(--openbitfun-space-1) var(--openbitfun-space-3);

& + & {
border-block-start: var(--openbitfun-border-width-default) solid var(--openbitfun-color-border-subtle);
}

&:focus-within {
background: var(--openbitfun-color-action-quiet-hover);
}

@media (hover: hover) and (pointer: fine) {
&:hover {
background: var(--openbitfun-color-action-quiet-hover);
}
}
}

&__channel-route-index {
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
inline-size: var(--openbitfun-space-5);
block-size: var(--openbitfun-space-5);
border-radius: var(--openbitfun-radius-pill);
background: var(--openbitfun-color-action-neutral-surface);
color: var(--openbitfun-color-content-secondary);
font-size: var(--openbitfun-type-body-sm-font-size);
font-family: var(--openbitfun-type-meta-font-family);
font-size: var(--openbitfun-type-meta-font-size);
font-weight: var(--openbitfun-type-meta-font-weight);
line-height: var(--openbitfun-type-meta-line-height);
font-variant-numeric: tabular-nums;
}

&__channel-route-summary {
flex: 1 1 0;
display: flex;
align-items: center;
gap: var(--openbitfun-space-2);
min-inline-size: 0;

> [data-openbitfun-component='status-pill'] {
flex: none;
}
}

&__channel-route-name {
flex: 0 1 auto;
min-inline-size: 0;
color: var(--openbitfun-color-content-primary);
font-size: var(--openbitfun-type-body-sm-font-size);
line-height: var(--openbitfun-type-body-sm-line-height);

&.is-missing {
color: var(--openbitfun-color-content-muted);
}
}

&__channel-route-provider {
color: var(--openbitfun-color-content-secondary);
}

&__channel-route-separator {
margin-inline: var(--openbitfun-space-1);
color: var(--openbitfun-color-content-muted);
}

&__channel-route-model {
color: var(--openbitfun-color-content-primary);
font-weight: var(--openbitfun-type-label-sm-font-weight);
}

&__channel-route-actions {
flex: none;
margin-inline-start: auto;
}

&__endpoint-row {
> .openbitfun-config-page-row__meta {
display: flex;
Expand Down Expand Up @@ -2702,6 +2841,26 @@
&__subscription-login-actions {
justify-content: flex-start;
}

&__channel-route-row.openbitfun-config-page-row {
grid-template-columns: minmax(0, 1fr);
row-gap: var(--openbitfun-space-2);

.openbitfun-model-settings__channel-route-picker {
grid-column: 1;
grid-row: 2;
justify-content: flex-start;
}

.openbitfun-model-settings__channel-route-list {
grid-column: 1;
grid-row: 3;
}

.openbitfun-model-settings__channel-route-empty {
text-align: start;
}
}
}

@container config-panel (max-width: 360px) {
Expand Down
Loading
Loading