Skip to content

perf(frontend): load only the selected trial on drawer open - #1283

Merged
kyle-compute merged 3 commits into
stagingfrom
codex/fix-trial-drawer-performance
Aug 18, 2026
Merged

perf(frontend): load only the selected trial on drawer open#1283
kyle-compute merged 3 commits into
stagingfrom
codex/fix-trial-drawer-performance

Conversation

@kyle-compute

Copy link
Copy Markdown
Collaborator

What changed

  • Removed the task page parent subscription to /api/tasks/{task_id}/detail and the duplicate canonical task/trial state derived from it.
  • Made the bounded /api/tasks/{task_id}/open response the task page source for drawer trial navigation.
  • Opened trial drawers with the task pane hidden; the existing Show task control mounts the task pane on explicit intent.
  • Kept task-pane deep links working when taskPane or taskFile is present.
  • Made TaskFilesPanel adopt /detail internally for unscoped task pages while preserving parent-owned experiment scope.
  • Deferred task file listing until the File pane is selected.
  • Reworked the existing focused Playwright test instead of adding another suite.

The change removes 42 net lines.

Why

The captured production HAR showed a trial drawer click starting four requests:

  • /api/tasks/{task_id}/detail: 4.705 seconds, including 3.810 seconds of database handling
  • /api/trials/{trial_id}: 2.352 seconds
  • /api/tasks/{task_id}/trials: 638 milliseconds
  • /api/tasks/{task_id}/files: 4.376 seconds before being aborted

The first three task resources duplicated task and trial information already available from /open or belonged to the hidden task/file panes. The initial trial drawer now owns only the selected-trial resource.

Request shape

Before Show task or another tab is selected:

  • /api/trials/{trial_id}: 1
  • /api/tasks/{task_id}/detail: 0
  • /api/tasks/{task_id}/trials: 0
  • /api/tasks/{task_id}/files: 0
  • /api/trials/{trial_id}/analysis-log: 0
  • /api/trials/{trial_id}/files: 0
  • /api/trials/{trial_id}/trajectory: 0

Selecting Show task permits task detail and task-trial requests. Task files remain deferred until the File pane is selected.

Verification

  • Application TypeScript check: passed
  • Playwright TypeScript check: passed
  • ESLint on all changed files: passed
  • Prettier check: passed
  • Frontend unit tests: 5 passed, 0 failed
  • Focused Playwright runtime: 1 skipped locally because E2E_CLERK_EMAIL, CLERK_SECRET_KEY, and NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY are absent

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oddish-app Ready Ready Preview Aug 18, 2026 12:58am

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Oddish preview

Commit: edfe5e24baf40c9c10bc952b0d4ffa011a88d377

Surface Link Target
Frontend https://pr-1283.oddish.app Vercel preview for edfe5e2
Backend staging staging
Database staging branch staging branch

Vercel deployment URL: https://oddish-htm4911vn.oddish.app

Plan:

  • Frontend deploy: true
  • Backend deploy: false
  • Migrations: false

This comment is updated by the PR Preview workflow.

@kyle-compute
kyle-compute merged commit b9b2582 into staging Aug 18, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant