feat: full plan execution - CI/CD, critical fixes, UX polish, secondary/advanced features, E2E + docs

Phase 0 (CI/CD): fix root typecheck to cover api+worker+web; reconcile migration
story into idempotent db:migrate (db:sync + db:triggers); add Gitea Actions
quality/deploy/smoke workflow; rewrite README/AGENTS/DEPLOY docs; add
requireWorkspaceAccess + recordActivityForEntity conventions.

Phase 1 (critical fixes): calendar delete + drag/resize DnD; canvas card CRUD +
bulk save + debounced autosave; logout route; graph edge workspaceId derivation;
real analytics endpoints (drop Math.random); task board droppable columns +
reorder persistence; Tiptap notes editor with sanitized HTML rendering; remove
insecure passkey auth; domain/owner scoping (IDOR) on all by-ID routes + search/
export/realtime scoping; command palette routing + agent mention fetch; agent
activity SSE handler; graph fly-to with tracked positions.

Phase 2 (UX polish): login on design system; Sonner toasts app-wide; shared
Loading/Empty/Error state components; working density/sidebarPos/reduce-motion
settings; Inter typography; consolidated status-colors lib; unified detail
routes; dashboard sort/realtime/responsive fixes; mobile responsive; a11y
(radiogroups, sanitized snippets, badge labels).

Phase 3 (features): daily notes timezone fix + delete + autosave + mood/energy
create; active-domain store + topbar picker; graph domain picker + navigable
entity links; tag assign/remove UI + server-side tag filter; real CSV export +
import validation; custom fields on tasks.

Phase 4 (advanced): migrate job worker into apps/worker (webhook delivery with
HMAC, recurring spawn, ai_dispatch disabled); webhook queue helper + entity
event enqueuing + test endpoint fix; recurring scheduledJobs pipeline; agents
CRUD + permission editing + activity filters; real notifications feed; MCP
polish (validation, error codes, domain scoping, dead sql leftover).

Phase 5 (E2E + docs): rewrite Playwright suite for the Vite SPA (15 specs, new
auth helpers, chromium-only in CI); add ephemeral-Postgres e2e CI job; rewrite
docs/API.md for the real Hono API.
This commit is contained in:
2026-08-10 08:53:18 +00:00
parent 6cb4b9f1b5
commit a60b75f075
99 changed files with 6238 additions and 2954 deletions
+10 -75
View File
@@ -5,87 +5,22 @@ test.describe('Analytics', () => {
test.beforeEach(async ({ page }) => {
await login(page);
await page.goto('/analytics');
// Wait for the analytics page to load
await expect(page.getByRole('heading', { name: /analytics/i })).toBeVisible();
});
test.describe('Analytics page', () => {
test('should display analytics heading and tagline', async ({ page }) => {
await expect(page.getByRole('heading', { name: /analytics/i })).toBeVisible();
await expect(page.getByText(/patterns behind your progress/i)).toBeVisible();
});
test('renders the analytics cards', async ({ page }) => {
await expect(page.getByText(/tasks completed/i)).toBeVisible({ timeout: 10_000 });
await expect(page.getByText(/created vs completed/i)).toBeVisible();
await expect(page.getByText(/habit completion/i)).toBeVisible();
await expect(page.getByText(/productivity heatmap/i)).toBeVisible();
});
test.describe('Summary cards', () => {
test('should display summary stat cards', async ({ page }) => {
// Should show 4 stat cards: Task Completion, Habit Consistency, Time Tracked, Active Streaks
await expect(page.getByText(/task completion/i)).toBeVisible();
await expect(page.getByText(/habit consistency/i)).toBeVisible();
await expect(page.getByText(/time tracked/i)).toBeVisible();
await expect(page.getByText(/active streaks/i)).toBeVisible();
});
test('switches the reporting range', async ({ page }) => {
await page.getByRole('combobox', { name: /last 30 days/i }).click();
await page.getByRole('option', { name: /last 90 days/i }).click();
test('should display percentage values', async ({ page }) => {
// Task completion and habit consistency should show percentages
const percentElements = page.locator('text=/\\d+%/');
const count = await percentElements.count();
expect(count).toBeGreaterThanOrEqual(2);
});
});
test.describe('Analytics tabs', () => {
test('should show Trends, Habits, and Time tabs', async ({ page }) => {
await expect(page.getByRole('tab', { name: /trends/i })).toBeVisible();
await expect(page.getByRole('tab', { name: /habits/i })).toBeVisible();
await expect(page.getByRole('tab', { name: /time/i })).toBeVisible();
});
test('should default to Trends tab', async ({ page }) => {
await expect(page.getByRole('tab', { name: /trends/i })).toHaveAttribute('data-state', 'active');
});
test('should switch to Habits tab', async ({ page }) => {
await page.getByRole('tab', { name: /habits/i }).click();
await expect(page.getByRole('tab', { name: /habits/i })).toHaveAttribute('data-state', 'active');
// Wait for chart to load
await page.waitForTimeout(1_000);
});
test('should switch to Time tab', async ({ page }) => {
await page.getByRole('tab', { name: /time/i }).click();
await expect(page.getByRole('tab', { name: /time/i })).toHaveAttribute('data-state', 'active');
// Wait for chart to load
await page.waitForTimeout(1_000);
});
test('should switch between all tabs', async ({ page }) => {
// Start on Trends
await expect(page.getByRole('tab', { name: /trends/i })).toHaveAttribute('data-state', 'active');
// Switch to Habits
await page.getByRole('tab', { name: /habits/i }).click();
await expect(page.getByRole('tab', { name: /habits/i })).toHaveAttribute('data-state', 'active');
// Switch to Time
await page.getByRole('tab', { name: /time/i }).click();
await expect(page.getByRole('tab', { name: /time/i })).toHaveAttribute('data-state', 'active');
// Switch back to Trends
await page.getByRole('tab', { name: /trends/i }).click();
await expect(page.getByRole('tab', { name: /trends/i })).toHaveAttribute('data-state', 'active');
});
});
test.describe('Analytics charts', () => {
test('should load chart components for each tab', async ({ page }) => {
// Wait for charts to render (recharts is lazy loaded)
await page.waitForTimeout(3_000);
// Verify the page has rendered without errors
const mainContent = page.locator('main');
await expect(mainContent).toBeVisible();
await expect(page.getByRole('combobox', { name: /last 90 days/i })).toBeVisible({
timeout: 10_000,
});
});
});