Skip to content

Feat: Sandbox Logs#239

Open
ben-fornefeld wants to merge 23 commits intomainfrom
implement-sandbox-details-logs
Open

Feat: Sandbox Logs#239
ben-fornefeld wants to merge 23 commits intomainfrom
implement-sandbox-details-logs

Conversation

@ben-fornefeld
Copy link
Member

@ben-fornefeld ben-fornefeld commented Feb 11, 2026

Note

Medium Risk
Introduces new infra API integration and new TRPC surface for log retrieval, plus non-trivial changes to log pagination/polling that could affect ordering, duplicates, and load behavior.

Overview
Adds a new Sandbox Logs experience in the dashboard: new /logs route under a sandbox, new TRPC sandbox.logsBackwards/logsForward endpoints, and a repository call to infra’s new /v2/sandboxes/{sandboxID}/logs API (OpenAPI + generated types updated).

Reworks the sandbox details layout to use tabbed navigation (Logs and Filesystem) with header controls (refresh/kill) moved into a DashboardTabs header accessory; sandbox list links and sbx/new redirect are updated to point at the new default destinations.

Refactors the existing build logs viewer and store to share new common log viewer UI components (log-cells, log-viewer-ui), improves pagination de-duplication via cursor+"seen" counts, and adds a drain window to keep polling briefly after builds stop (similar logic used for sandboxes).

Written by Cursor Bugbot for commit 4ad367b. This will update automatically on new commits. Configure here.

- Removed redundant wrapper in SandboxDetailsHeader for SandboxDetailsTitle.
- Updated DashboardLayoutHeader to ensure consistent rendering of ThemeSwitcher.
- Refactored logs handling in VirtualizedLogsBody to utilize state for scroll container, enhancing performance and readability.
- Adjusted event listeners for scroll handling to improve responsiveness.
@vercel
Copy link

vercel bot commented Feb 11, 2026

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

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Feb 18, 2026 11:59pm
web-juliett Ready Ready Preview, Comment Feb 18, 2026 11:59pm

Request Review

{ cursor, limit, direction }
)

const logs: SandboxLogDTO[] = sandboxLogs.logs
Copy link
Member

Choose a reason for hiding this comment

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

is this needed?


const logs: SandboxLogDTO[] = sandboxLogs.logs
.map(mapInfraSandboxLogToDTO)
.sort((a, b) => a.timestampUnix - b.timestampUnix)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.sort((a, b) => a.timestampUnix - b.timestampUnix)

export const sandboxRouter = createTRPCRouter({
// QUERIES

logsBackwards: protectedTeamProcedure
Copy link
Member

Choose a reason for hiding this comment

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

you should reverse outside this query

Copy link
Member

Choose a reason for hiding this comment

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

or add at least comment

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

`/dashboard/${teamIdOrSlug}/sandboxes/${sandboxId}`,
SANDBOX_INSPECT: (teamIdOrSlug: string, sandboxId: string) =>
`/dashboard/${teamIdOrSlug}/sandboxes/${sandboxId}/inspect`,
`/dashboard/${teamIdOrSlug}/sandboxes/${sandboxId}/logs`,
Copy link

Choose a reason for hiding this comment

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

Unused duplicate URL definition is dead code

Low Severity

PROTECTED_URLS.SANDBOX produces the exact same URL as PROTECTED_URLS.SANDBOX_LOGS (both resolve to .../sandboxes/${sandboxId}/logs), and SANDBOX is never referenced anywhere in the codebase. It's unused dead code introduced by this diff.

Fix in Cursor Fix in Web

}

return logs.slice(0, end)
}
Copy link

Choose a reason for hiding this comment

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

Cursor-tracking helpers duplicated across two store files

Low Severity

countLeadingAtTimestamp, countTrailingAtTimestamp, dropLeadingAtTimestamp, and dropTrailingAtTimestamp are copy-pasted identically between sandbox-logs-store.ts and build-logs-store.ts. Both only access the timestampUnix property, so a single generic or shared implementation would work for both DTO types.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments