mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-11-03 22:32:27 +08:00
fix: scope inflight snapshots and compact mobile dashboard
This commit is contained in:
@@ -201,7 +201,7 @@ export default function MonitoringFilters({
|
||||
onPipelinesChange([...next]);
|
||||
};
|
||||
return (
|
||||
<div className="grid min-w-0 flex-1 grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-5">
|
||||
<div className="grid min-w-0 flex-1 grid-cols-2 gap-3 lg:grid-cols-5">
|
||||
{/* Bot Filter */}
|
||||
<div className="min-w-0 space-y-1.5">
|
||||
<Label
|
||||
|
||||
@@ -223,7 +223,7 @@ function MonitoringPageContent() {
|
||||
<div className="w-full h-full overflow-y-auto overflow-x-hidden">
|
||||
{/* Filters and Refresh Button - Sticky */}
|
||||
{!error && (
|
||||
<div className="sticky top-0 z-10 -mt-1 pb-5 pt-1 bg-background">
|
||||
<div className="relative z-10 -mt-1 pb-3 pt-1 bg-background lg:sticky lg:top-0 lg:pb-5">
|
||||
<div>
|
||||
<Card className="flex flex-col gap-4 p-4 xl:flex-row xl:items-end">
|
||||
<MonitoringFilters
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { installLangBotApiMocks } from './fixtures/langbot-api';
|
||||
|
||||
for (const width of [375, 430]) {
|
||||
test(`dashboard filters fit mobile ${width}`, async ({ page }) => {
|
||||
await page.setViewportSize({ width, height: 812 });
|
||||
await installLangBotApiMocks(page, { authenticated: true });
|
||||
await page.goto('/home/monitoring');
|
||||
const bot = page.getByRole('combobox', { name: 'Bot', exact: true });
|
||||
await expect(bot).toBeVisible();
|
||||
const grid = bot.locator('..').locator('..');
|
||||
expect(
|
||||
await grid.evaluate(
|
||||
(el) => getComputedStyle(el).gridTemplateColumns.split(' ').length,
|
||||
),
|
||||
).toBe(2);
|
||||
const box = await grid.boundingBox();
|
||||
expect(box!.x).toBeGreaterThanOrEqual(0);
|
||||
expect(box!.x + box!.width).toBeLessThanOrEqual(width);
|
||||
await expect(
|
||||
page.getByRole('button', { name: /Reset Filters/i }),
|
||||
).toBeVisible();
|
||||
await page.screenshot({
|
||||
path: `test-results/dashboard-${width}.png`,
|
||||
fullPage: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user