fix(frontend): drive loading skeletons, non-blocking resolve, retry#5430
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughDrive 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. ChangesDrive states and file surfaces
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (7)
web/oss/src/components/AgentChatSlice/components/Inspector/lenses/RuntimeLens.tsxweb/oss/src/components/Drives/ContextRail.tsxweb/oss/src/components/Drives/DriveExplorer.tsxweb/oss/src/components/Drives/DriveFileRow.tsxweb/oss/src/components/Drives/StorageFilesHeader.tsxweb/oss/src/components/Drives/StorageSection.tsxweb/oss/src/components/Drives/useSessionDrive.ts
Railway Preview Environment
Updated at 2026-07-21T11:33:23.369Z |
|
QAed and looks good to me |
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:
Changes
Loading is now the same list. The placeholder rows are real
DriveFileRows in aloadingmode that morph into the loaded rows inside oneAnimatePresence. 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.
useSessionDriveSummaryreframes this around per-side resolution: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
eslintclean on all touched files;tsc --noEmitreports no new errors (the@agenta/ossbaseline is unchanged, and none of the touched files report errors).?__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