Skip to content
Open
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 @@ -91,6 +91,56 @@ test('stack effects stay bounded through background, paging, and navigation chao
await expect(page.getByRole('heading', { name: 'Stacks' })).toBeVisible();
});

await measureAction(diagnostics, 'stack timeline drag', async () => {
await page.locator('tbody tr:visible').first().click();
const dialog = page.getByRole('dialog');
await expect(dialog).toBeVisible();
const timeline = dialog.locator('[data-slot="chart"]');
await expect(timeline).toBeVisible();

const bounds = await timeline.boundingBox();
expect(bounds).not.toBeNull();
if (bounds) {
const y = bounds.y + bounds.height / 2;
await page.mouse.move(bounds.x + bounds.width * 0.2, y);
await page.waitForTimeout(250);
await page.mouse.move(bounds.x + bounds.width * 0.3, y);
await expect(page.locator('.lc-tooltip-root')).toHaveCSS('pointer-events', 'none');
await page.mouse.down();
await page.mouse.move(bounds.x + bounds.width * 0.8, y, { steps: 20 });
await page.mouse.up();
}

await page.waitForTimeout(500);
await page.getByRole('button', { name: 'Close' }).click();
});
expect(actionSample(diagnostics, 'stack timeline drag').runtimeErrors).toBe(0);

await measureAction(diagnostics, 'saved view navigation with stack detail open', async () => {
await page.locator('tbody tr:visible').first().click();
await expect(page.getByRole('dialog')).toBeVisible();

const savedViewHrefs = ['/next/stack/all', '/next/stack/most-frequent-errors'];
for (const href of savedViewHrefs) {
await expect(page.locator(`a[href="${href}"]`).first()).toBeAttached();
}

await page.evaluate((hrefs) => {
for (let index = 0; index < 20; index++) {
const href = hrefs[index % hrefs.length]!;
document.querySelector<HTMLAnchorElement>(`a[href="${href}"]`)?.click();
}
}, savedViewHrefs);

await expect(page).toHaveURL(/\/next\/stack\/most-frequent-errors(?:[?#]|$)/);
await expect(page.getByRole('dialog')).not.toBeVisible();
await expect(page.getByRole('heading', { exact: true, name: 'Most Frequent Errors' })).toBeVisible();

await page.goto('/next/stack?limit=5');
await expect(page.getByRole('button', { name: 'Go to next page' })).toBeEnabled();
});
expect(actionSample(diagnostics, 'saved view navigation with stack detail open').runtimeErrors).toBe(0);

await measureAction(diagnostics, 'selected stack refresh', async () => {
const rowSelection = page.getByRole('checkbox', { name: 'Select row' }).first();
await rowSelection.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@
if (start instanceof Date && end instanceof Date) {
onRangeSelect?.(start, end);
}

e.brush.reset();
}
}}
props={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@
if (start instanceof Date && end instanceof Date) {
onRangeSelect?.(start, end);
}

e.brush.reset();
}
}}
props={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
{/if}
{/snippet}

<TooltipPrimitive.Root variant="none">
<TooltipPrimitive.Root pointerEvents={false} variant="none">
<div
bind:this={ref}
class={cn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { EventSummaryModel, SummaryTemplateKeys } from '$features/events/components/summary/index';
import type { ProblemDetails } from '@foundatiofx/fetchclient';

import { beforeNavigate } from '$app/navigation';
import { resolve } from '$app/paths';
import { page } from '$app/state';
import * as DataTable from '$comp/data-table';
Expand Down Expand Up @@ -94,6 +95,12 @@
return resolve('/(app)/stack/[stackId=objectid]', { stackId: row.id });
}

beforeNavigate(({ to }) => {
if (selectedStackId && to?.url.pathname !== page.url.pathname) {
selectedStackId = undefined;
}
});

const DEFAULT_TIME_RANGE = '[now-7d TO now]';
const DEFAULT_FILTERS = [
new DateFilter('date', DEFAULT_TIME_RANGE),
Expand Down
Loading