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 @@ -273,6 +273,10 @@
padding: var(--bf-space-1);
}

.searchField {
inline-size: 100%;
}

.listbox {
flex: 1 1 auto;
min-block-size: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ const CollectionPicker = forwardRef<HTMLDivElement, PickerProps>(function Collec
aria-expanded={resolvedOpen}
aria-label={designSystem.messages.searchOptions}
autoComplete="off"
className={styles.searchField}
clearLabel={designSystem.messages.clearSelection}
onClear={() => {
setQuery("");
Expand Down
6 changes: 6 additions & 0 deletions design-system/packages/ui/tests/combobox.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ test("Combobox owns keyboard selection, IME safety, filtering, and custom values
});

test("Combobox styling uses public field, overlay, action, and motion tokens", async () => {
const source = await readFile(
new URL("../src/components/Combobox/Combobox.tsx", import.meta.url),
"utf8",
);
const styles = await readFile(
new URL("../src/components/Combobox/Combobox.module.css", import.meta.url),
"utf8",
Expand All @@ -74,6 +78,8 @@ test("Combobox styling uses public field, overlay, action, and motion tokens", a
assert.match(styles, /--bf-shadow-menu/);
assert.match(styles, /position:\s*fixed/);
assert.match(styles, /z-index:\s*var\(--bf-layer-popover\)/);
assert.match(source, /className=\{styles\.searchField\}/);
assert.match(styles, /\.searchField\s*\{[^}]*inline-size:\s*100%/);
assert.doesNotMatch(styles, /data-popover-mode/);
assert.doesNotMatch(styles, /#[0-9a-f]{3,8}/i);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { describe, expect, it } from 'vitest';

const source = readFileSync(
fileURLToPath(new URL('./ModelSettingsPage.tsx', import.meta.url)),
'utf8',
);

describe('ModelSettingsPage presentation', () => {
it('uses intentional separators instead of Unicode replacement characters', () => {
expect(source).not.toContain('\uFFFD');
expect(source.match(/\{' · '\}/g)).toHaveLength(2);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function dedupeSelectedModelDraftsByModelName(drafts: SelectedModelDraft[]): Sel

/**
* Compute the stored request URL from a base URL and provider format.
* For gemini, stores the bare base (no /v1beta/models/... suffix) �
* For Gemini, stores the bare base without the /v1beta/models/... suffix;
* the backend dynamically appends /v1beta/models/{model}:streamGenerateContent?alt=sse.
*/
function resolveRequestUrl(baseUrl: string, provider: string, _modelName = ''): string {
Expand Down Expand Up @@ -2276,9 +2276,9 @@ const ModelSettingsPage: React.FC = () => {
<div className="bitfun-model-settings__selected-model-head-bottom">
<span className="bitfun-model-settings__selected-model-summary">
{categoryLabel}
{' '}
{' · '}
{formatTokenCountShort(draft.contextWindow)} ctx
{' '}
{' · '}
{formatReasoningSummary(draft, reasoningProjection)}
</span>
</div>
Expand Down Expand Up @@ -2496,7 +2496,7 @@ const ModelSettingsPage: React.FC = () => {
}));
}}
placeholder={t('form.baseUrl')}
options={currentTemplate.baseUrlOptions.map(opt => ({ label: opt.url, value: opt.url, description: `${opt.format.toUpperCase()} ${opt.note}` }))}
options={currentTemplate.baseUrlOptions.map(opt => ({ label: opt.url, value: opt.url, description: `${opt.format.toUpperCase()} · ${opt.note}` }))}
size="sm"
/>
)}
Expand Down Expand Up @@ -3609,7 +3609,7 @@ const ModelSettingsPage: React.FC = () => {
</ConfigPageRow>
<ConfigPageRow label={t('modelsDevCatalog.cachePath')} align="center" wide>
<div className="bitfun-model-settings__catalog-path">
<code title={modelsDevStatus?.cache_path}>{modelsDevStatus?.cache_path || ''}</code>
<code title={modelsDevStatus?.cache_path}>{modelsDevStatus?.cache_path || ''}</code>
<Tooltip content={t('modelsDevCatalog.reveal')}>
<IconButton
aria-label={t('modelsDevCatalog.reveal')}
Expand All @@ -3627,7 +3627,7 @@ const ModelSettingsPage: React.FC = () => {
</ConfigPageRow>
<ConfigPageRow label={t('modelsDevCatalog.revision')} align="center">
<code className="bitfun-model-settings__catalog-revision" title={modelsDevStatus?.revision}>
{modelsDevStatus?.revision ? `${modelsDevStatus.revision.slice(0, 12)}` : ''}
{modelsDevStatus?.revision ? `${modelsDevStatus.revision.slice(0, 12)}` : ''}
</code>
</ConfigPageRow>
<div className="bitfun-model-settings__catalog-offline-help" role="note">
Expand Down Expand Up @@ -3691,7 +3691,7 @@ const ModelSettingsPage: React.FC = () => {
<ScrollArea className="bitfun-model-settings__subscription-logout-list">
<ul>
{subscriptionLogoutRequest.affectedModels.map((model) => (
<li key={model.id}>{model.name} {model.model_name}</li>
<li key={model.id}>{model.name} · {model.model_name}</li>
))}
</ul>
</ScrollArea>
Expand Down
Loading