Skip to content

Use indexed Files and Artifacts views and share bounded previews - #1663

Draft
kyle-compute wants to merge 2 commits into
perf/prepared-file-index-stackfrom
perf/prepared-file-browser-stack
Draft

kyle-compute wants to merge 2 commits into
perf/prepared-file-index-stackfrom
perf/prepared-file-browser-stack

Conversation

@kyle-compute

@kyle-compute kyle-compute commented Sep 15, 2026

Copy link
Copy Markdown
Member

TL;DR

  • Scope: Switch Files/Artifacts to indexed reads and shared bounded previews, then remove retired listing paths. Changes span 33 files: 20 app, 10 tests, 3 docs.
  • Size: app +553/-1142; tests +609/-329; docs +98/-71 lines.

Stack 3/3 replacing #1635. Dashboard #1661File index #1662File browser #1663. Base: perf/prepared-file-index-stack. Merge in that order; after a squash merge, rebase and retarget the next PR onto staging before merging it. Draft status is preserved from #1635.

Files and Artifacts now request the prepared metadata published by the preceding PR, using 100-entry directory pages and artifact-only listings. The browser retries preparation and uses one shared inventory owner for pagination, activation refresh, and revision-conflict recovery. Reopening a view revalidates even an empty inventory while keeping cached data visible. Matching revisions retain loaded pages; replacement revisions discard old pages and old full-file contents.

Both views share preview requests scoped to account, trial, attempt, revision, and path. A cold trial deep link waits for the inventory revision before downloading one preview. Previews are bounded to 100 KiB; full-file loading remains an explicit action. Binary and full-file URLs carry the same attempt/revision identity. Nested filename encoding preserves path separators and escapes literal filename characters consistently across readers and proxies.

Visited panes retain selection, file/line links keep their existing URL ownership, and hover or keyboard focus preloads drawer modules. Once these callers use indexed reads, this PR removes the old directory-batch storage reader, streamed listings and proxies, inline-preview mode, and duplicated artifact fetch state. Task directory batches now always read the prepared index. The backend additions and backfill from the preceding PR must be deployed first.

Local testing

29 Chromium tests passed with real React components and controlled API responses. Coverage includes account/organization isolation, pagination, delayed version changes, file/line links, reopening empty inventories, shared previews, stale-revision recovery, replacement after full downloads, and a single preview on cold trial deep links. TypeScript, ESLint for the changed file components/helpers, and all 13 selected Node tests passed.

129 combined core tests passed on disposable PostgreSQL 17; both migration stacks upgraded from an empty database. 38 hosted file/authorization tests passed. The authorization fixture that assigns an uncreated another-org row still fails with the same foreign-key error reproduced on unchanged staging e0708f79.

The final Git tree is exactly 1cb0d62244dbfdea04b48a21bcd2b430e166a81b, matching source PR #1635 at 57e06d7f merged with staging 0203a819. Before updating the stack to that staging commit, its final tree also matched #1635 byte-for-byte. No implementation, tests, or documentation from the source PR were dropped.

Core files changed

  • frontend/src/lib/use-task-file-tree.ts / file-resources.ts — Own inventory freshness, pagination, and shared bounded preview requests.
  • frontend/src/components/task-files-panel.tsx / artifacts-viewer.tsx / trial-detail-panel.tsx — Consume indexed reads, retain selection, and replace stale pages and file contents.
  • frontend/src/lib/file-path.ts / file proxy routes — Encode nested filenames and forward attempt, revision, and byte bounds consistently.
  • oddish/src/oddish/core/sharing/helpers.py / oddish/src/oddish/db/storage.py — Remove legacy listing paths after their browser callers switch.

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
oddish-app Ready Ready Preview Sep 15, 2026 7:58pm UTC

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Oddish preview

Commit: 3a774e6607cc7deef55551f6a77d69f89eb63474

Surface Link Target
Frontend https://pr-1663.oddish.app Vercel preview for 3a774e6
Backend oddish-pr-1663 oddish-pr-1663
Database project qwvupgxmegmvsktztevu project qwvupgxmegmvsktztevu

Vercel deployment URL: https://oddish-2k4tr4170.oddish.app

Plan:

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

This comment is updated by the PR Preview workflow.

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