Skip to content

fix(frontend): drive loading skeletons, non-blocking resolve, retry#5430

Merged
ashrafchowdury merged 4 commits into
release/v0.105.8from
fe-fix/drive-files-skeleton
Jul 21, 2026
Merged

fix(frontend): drive loading skeletons, non-blocking resolve, retry#5430
ashrafchowdury merged 4 commits into
release/v0.105.8from
fe-fix/drive-files-skeleton

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

The drive "recent files" surfaces (config Files section, chat context rail, runtime lens) and the Files drawer had a few loading and error gaps:

  • Loading showed a generic skeleton block that then swapped for the list, so the panel visibly jumped.
  • A session drive reads two mounts (the session cwd and the per-artifact agent mount), but they were treated as one. A slow mount could block a fast one, and the moment one mount resolved empty could flash "No files" before the other arrived.
  • A failed mount was invisible. An agent-mount failure fell through to "No files" with no signal and no way to retry, so the failure was silently swallowed.

Changes

Loading is now the same list. The placeholder rows are real DriveFileRows in a loading mode that morph into the loaded rows inside one AnimatePresence. No block-to-list jump, no layout shift.

Mounts resolve independently. Whichever mount answers first renders immediately; the slower one reconciles in with a quiet "Loading more…" hint. A blocking skeleton shows only at the very first blank (nothing resolved yet), and the terminal "No files" waits until every mount has resolved. So a fast drive is never held back by a slow one, and "No files" never flashes mid-load.

useSessionDriveSummary reframes this around per-side resolution:

isLoading   = no in-play mount has answered yet AND nothing to show   // initial blank only
reconciling = one mount answered but a sibling is still loading        // show content + "Loading more…"

Mount failures are surfaced without hijacking the list. The summary now splits two states:

  • errored (terminal): the session side failed with nothing to show. Drives the inline error + Retry card, as before.
  • partialErrored (new): a mount failed but the drive still browses, or only the agent mount broke. The inline list stays clean and a small amber warning badge rides the drawer-trigger folder icon (config header, chat rail collapsed + expanded, runtime section). The trigger's tooltip explains, and a tap opens the drawer.

Retry lives in the drawer. A partial failure shows a compact "Try again" in the drawer's existing header row (not a new banner that would push the tree down). The full-failure Alert, which had no retry before, now carries one too. Retry re-runs the underlying mount and count queries and uses the warning tone rather than a link-blue.

Tests / notes

  • eslint clean on all touched files; tsc --noEmit reports no new errors (the @agenta/oss baseline is unchanged, and none of the touched files report errors).
  • Verified visually during development via a dev-only ?__driveState= override, which was removed before this PR. The partial-failure path needs a real mount error to reproduce (e.g. an object store that is not configured on the deployment).

What to QA

  • Open the config Files section and the chat Files rail on a session with files. The rows fade in from matching skeletons, with no block-to-list jump.
  • On a cold load, confirm the panel never flashes "No files" before the files appear.
  • With a session that has files while the agent mount is slow, files show immediately with a "Loading more…" hint, then reconcile. Neither drive blocks the other.
  • When a mount fails: the trigger folder icon (config header, chat rail, runtime Files section) shows a small amber badge, its tooltip reads "Some files couldn't be loaded", and opening the drawer shows "Try again" in the header. The still-loaded files stay browsable.
  • Regression: a genuinely empty drive still reads "No files" with no badge; a total session-side failure still shows the inline error + Retry card and the drawer's full Alert (now with Retry).

Rework the session-drive summary surfaces (config Files, chat rail,
runtime lens) and the Files drawer:

- Loading shows the SAME list rendering placeholder rows that morph into
  real file rows in one AnimatePresence (no skeleton-block -> list jump).
- The session cwd and agent mounts resolve independently: whichever
  answers first renders immediately, the slower reconciles in with a
  "Loading more..." hint. A blocking skeleton shows only at the initial
  blank; terminal "No files" waits for every mount to resolve.
- A mount failure no longer masks a working session -- the inline list
  stays clean and a warning badge rides the drawer-trigger folder icon
  (both modes); the drawer carries the retry ("Try again" in its header
  for a partial failure, and on the full-failure Alert).
- Retry re-runs the mount/count queries; warning tone throughout.
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 21, 2026 10:57am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d680b9d7-8368-487e-819d-c1d5606fd4e6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Drive state hooks now expose retry, reconciliation, and partial-error status. Shared drive UI primitives and multiple file surfaces render animated loading, error, warning, retry, and empty states.

Changes

Drive states and file surfaces

Layer / File(s) Summary
Session drive state and retry contract
web/oss/src/components/Drives/useSessionDrive.ts
The drive summary distinguishes blocking loading, reconciliation, terminal errors, and partial errors, and exposes a callback that refetches relevant session and agent queries.
Retry, warning, and skeleton primitives
web/oss/src/components/Drives/DriveFileRow.tsx
Shared retry and warning components are added, while DriveFileRow gains variant-specific skeleton rendering and relaxed row props.
Drive surface state rendering
web/oss/src/components/Drives/ContextRail.tsx, web/oss/src/components/Drives/DriveExplorer.tsx, web/oss/src/components/Drives/StorageFilesHeader.tsx, web/oss/src/components/Drives/StorageSection.tsx
Drive surfaces render partial-error badges, inline retry controls, animated phases, skeleton rows, reconciliation indicators, and existing file actions.
Runtime inspector drive integration
web/oss/src/components/AgentChatSlice/components/Inspector/lenses/RuntimeLens.tsx
Drive summary acquisition moves to RuntimeLens, and the Files accordion consumes the shared summary with animated states and partial-error indication.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant FilesSurface
  participant useSessionDriveSummary
  participant SessionDriveQueries
  FilesSurface->>useSessionDriveSummary: request drive summary
  useSessionDriveSummary->>SessionDriveQueries: resolve mounts, counts, and listings
  SessionDriveQueries-->>useSessionDriveSummary: return loading, error, and file data
  useSessionDriveSummary-->>FilesSurface: provide phases, retry, and partial-error state
  FilesSurface->>useSessionDriveSummary: invoke retry()
  useSessionDriveSummary->>SessionDriveQueries: refetch failed queries
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main frontend drive loading, reconciliation, and retry changes.
Description check ✅ Passed The description matches the PR scope and explains the loading, partial-error, and retry behavior changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fe-fix/drive-files-skeleton

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ardaerzin
ardaerzin marked this pull request as ready for review July 21, 2026 09:34
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Frontend Improvement UX labels Jul 21, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: def2b604-c58d-4e5a-a152-75d67277eaa0

📥 Commits

Reviewing files that changed from the base of the PR and between dd19a60 and 9d506ce.

📒 Files selected for processing (7)
  • web/oss/src/components/AgentChatSlice/components/Inspector/lenses/RuntimeLens.tsx
  • web/oss/src/components/Drives/ContextRail.tsx
  • web/oss/src/components/Drives/DriveExplorer.tsx
  • web/oss/src/components/Drives/DriveFileRow.tsx
  • web/oss/src/components/Drives/StorageFilesHeader.tsx
  • web/oss/src/components/Drives/StorageSection.tsx
  • web/oss/src/components/Drives/useSessionDrive.ts

Comment thread web/oss/src/components/Drives/useSessionDrive.ts Outdated
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-07-21T11:33:23.369Z

@ardaerzin
ardaerzin requested a review from ashrafchowdury July 21, 2026 10:05
@ardaerzin
ardaerzin changed the base branch from main to release/v0.105.8 July 21, 2026 10:05
@ashrafchowdury

Copy link
Copy Markdown
Contributor

QAed and looks good to me

@ashrafchowdury
ashrafchowdury merged commit 516e295 into release/v0.105.8 Jul 21, 2026
39 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend Improvement size:XXL This PR changes 1000+ lines, ignoring generated files. UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants