Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

PERF: Paginate design dashboard sessions - #276

Merged
mikeangstadt merged 6 commits into
mainfrom
perf-design-dashboard-pagination
Jun 7, 2026
Merged

PERF: Paginate design dashboard sessions#276
mikeangstadt merged 6 commits into
mainfrom
perf-design-dashboard-pagination

Conversation

@mikeangstadt

@mikeangstadt mikeangstadt commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a bounded in-process session page API plus single-session detail lookup for the design-system dashboard.
  • Move Sessions, Kanban, and direct session detail views off unbounded all-session detail loads.
  • Add a waiting-session index migration, desktop version bump, and focused pagination regression coverage.

Testing

  • just desktop-lint
  • just desktop-typecheck
  • ./apps/desktop/node_modules/.bin/tsx --test apps/desktop/test/agent-session-pagination.test.ts
  • just desktop-test

Notes

  • Local DB observed at ~7.15 GB; previous all-session detail path scanned/aggregated millions of events before rendering.

- Add bounded session page and single-session detail database reads

- Move sessions list, Kanban, and detail views off all-session detail loads

- Add pagination regression coverage and bump desktop version

Testing: desktop lint, desktop typecheck, and focused session pagination test passed

Risks: Full desktop test suite was rerun after regenerating legacy agent-monitor output but was still in progress when requested to push
@mikeangstadt
mikeangstadt requested a review from a team June 6, 2026 13:31
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Compatibility Smoke Test Results ⚠️

Status: skipped
Electron SHA: 2774b5487fb68b05db477cba47fecd29c816108b
Symphony Alpha SHA (last-known-good): 24741ed9be45cc761195d7a7b6613bd30cdfce84
Note: Skipped because the stage GitHub App credentials are not configured for this workflow run.

View Actions run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1565215eef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/components/kanban/KanbanView.tsx Outdated
- Add a server-side running filter that excludes sessions awaiting input

- Point the Kanban running column at the non-waiting filter

- Cover running versus waiting pagination semantics

Testing: desktop lint, desktop typecheck, and focused session pagination test passed

Risks: Low; filter change is scoped to the new paginated session API
Comment thread apps/desktop/src/main/database/sessions.ts
Comment thread apps/desktop/src/main/database/sessions.ts Outdated
Comment thread apps/desktop/src/main/database/sessions.ts Outdated
Comment thread apps/desktop/src/main/database/sessions.ts
Comment thread apps/desktop/src/renderer/components/sessions/SessionsView.tsx
@shafty023

Copy link
Copy Markdown
Contributor

I do not see the four claimed fixes on the current PR head yet. The remote PR ref is still 9ce0a442, and that head still has ORDER BY s.started_at DESC, raw LIKE pattern construction, no idx_sessions_running_started_at, and useQueryCache still leaves loading unchanged before an uncached fetch. Can you push the follow-up commit or update the threads if those fixes are still pending?

…al index, loading reset

- Add s.id DESC tiebreaker to active sessions query for deterministic ordering
- Escape underscore in model LIKE pattern with ESCAPE backslash
- Add idx_sessions_running_started_at partial index for active sessions filter
- Reset loading=true on query key change before fetch

Testing: typecheck and lint pass
Comment thread apps/desktop/src/main/database/schema.ts
Comment thread apps/desktop/src/main/database/sessions.ts
Comment thread apps/desktop/src/main/database/sessions.ts
Comment thread apps/desktop/src/renderer/components/kanban/KanbanView.tsx
Comment thread apps/desktop/src/renderer/components/sessions/SessionsView.tsx
Comment thread apps/desktop/package.json Outdated
Comment thread apps/desktop/test/agent-session-pagination.test.ts
…g, debounce

- Renumber schema migration to v7 (v6 claimed by PR #274 FEA-1548)
- Restore CTE-based joins for unbounded active/historical detail queries;
  keep correlated subqueries only for bounded getPage/getDetailsById
- Cache prepared statements for dynamic page queries via getOrPrepare()
- Add getKanbanPages() single-IPC batch method replacing 5 parallel calls
- Add 300ms debounce on SessionsView search input
- Bump version 0.15.115 → 0.15.116
- Add tests: LIKE wildcard escape, tied-timestamp pagination, kanban batch

Testing: 6/6 pagination tests pass, typecheck clean.

Risks: CTE restoration changes the query plan for active/historical paths
back to the pre-PR pattern — same behavior, proven safe on the 7 GB DB.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mikeangstadt

Copy link
Copy Markdown
Contributor Author

The 1st pass of review resolutions didn't push it's fixes properly; this is adjusted now.

@mikeangstadt
mikeangstadt requested a review from shafty023 June 7, 2026 15:47
- Align identity-column migration tests with the current schema version so PR merge commits do not fail when later migrations exist.

Testing: Focused session identity migration test and desktop typecheck passed.

Risks: Low; test-only assertion update.
@mikeangstadt
mikeangstadt merged commit 34a3830 into main Jun 7, 2026
5 checks passed
@mikeangstadt
mikeangstadt deleted the perf-design-dashboard-pagination branch June 7, 2026 21:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants