fix: match proxy log model badge width to content
This commit is contained in:
@@ -193,6 +193,33 @@ describe('ProxyLogs server-driven page', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('keeps the model badge sized to the model name in desktop rows', async () => {
|
||||||
|
let root: ReturnType<typeof create> | null = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await act(async () => {
|
||||||
|
root = create(
|
||||||
|
<MemoryRouter initialEntries={['/logs']}>
|
||||||
|
<ToastProvider>
|
||||||
|
<ProxyLogs />
|
||||||
|
</ToastProvider>
|
||||||
|
</MemoryRouter>,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
await flushMicrotasks();
|
||||||
|
|
||||||
|
const modelBadge = root!.root.find((node) => (
|
||||||
|
node.type === 'span'
|
||||||
|
&& collectText(node) === 'gpt-4o'
|
||||||
|
&& node.props.style?.display === 'inline-flex'
|
||||||
|
));
|
||||||
|
|
||||||
|
expect(modelBadge.props.style?.alignSelf).toBe('flex-start');
|
||||||
|
} finally {
|
||||||
|
root?.unmount();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it('re-queries the server for status, client, and search changes instead of filtering locally', async () => {
|
it('re-queries the server for status, client, and search changes instead of filtering locally', async () => {
|
||||||
let root: ReturnType<typeof create> | null = null;
|
let root: ReturnType<typeof create> | null = null;
|
||||||
|
|
||||||
|
|||||||
@@ -823,7 +823,7 @@ export default function ProxyLogs() {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
||||||
<ModelBadge model={log.modelRequested} />
|
<ModelBadge model={log.modelRequested} style={{ alignSelf: 'flex-start' }} />
|
||||||
{downstreamKeySummary ? (
|
{downstreamKeySummary ? (
|
||||||
<div style={{ fontSize: 11, lineHeight: 1.45, color: 'var(--color-text-muted)' }}>
|
<div style={{ fontSize: 11, lineHeight: 1.45, color: 'var(--color-text-muted)' }}>
|
||||||
{downstreamKeySummary}
|
{downstreamKeySummary}
|
||||||
|
|||||||
Reference in New Issue
Block a user