Skip to content

Feat/ez terminal#321

Merged
matthewlouisbrockman merged 15 commits into
mainfrom
feat/ez-terminal
May 22, 2026
Merged

Feat/ez terminal#321
matthewlouisbrockman merged 15 commits into
mainfrom
feat/ez-terminal

Conversation

@matthewlouisbrockman
Copy link
Copy Markdown
Contributor

@matthewlouisbrockman matthewlouisbrockman commented May 10, 2026

adds a standalone terminal that starts and reconnects to a sandbox at /dashboard/terminal

currently just creates or connects to a sandbox with the passed in params. not linking it externally, but lets us re-use it for the dashboard specific terminal use as well as play with it in other use cases

Screenshot 2026-05-10 at 3 01 46 PM

go to /dashboard/terminal to have it spawn one for you.

note: this doesn't handle new user sign up. keeping it minimal for now.

@cla-bot cla-bot Bot added the cla-signed label May 10, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

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

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment May 20, 2026 10:07pm
web-juliett Ready Ready Preview, Comment May 20, 2026 10:07pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 10, 2026

PR Summary

Medium Risk
Adds a browser-accessible terminal that can create/connect to persistent sandboxes and relaxes auth redirects for /dashboard/terminal, which could unintentionally broaden access surface if route checks drift or terminal actions become reachable without proper validation.

Overview
This PR adds a new /dashboard/terminal page and client-side terminal implementation that can create/reconnect to persistent E2B sandboxes, run optional URL-provided commands after a confirmation dialog, and persist the last sandbox in localStorage.

Potential issues: the proxy auth redirect now explicitly exempts /dashboard/terminal (and trailing slash) from sign-in redirects; if any future logic on that route assumes authentication, it may be reachable unauthenticated. Also, the terminal relies on client-side Supabase session retrieval and passes auth headers directly from the browser, so any mistakes in team resolution or template validation could lead to unexpected sandbox access attempts.

Reviewed by Cursor Bugbot for commit 26151e9. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread src/app/layout.tsx Outdated
Comment thread src/features/dashboard/terminal/terminal-panel.tsx Outdated
Comment thread src/features/dashboard/terminal/terminal-panel.tsx Outdated
Comment thread src/features/dashboard/terminal/dashboard-terminal.tsx Outdated
@matthewlouisbrockman matthewlouisbrockman marked this pull request as ready for review May 10, 2026 21:57
Copilot AI review requested due to automatic review settings May 10, 2026 21:57
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization has reached its monthly code review spending cap.

An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.

Once the cap resets or is raised, reopen this pull request to trigger a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a standalone dashboard terminal experience at /dashboard/terminal that can start or reconnect to an E2B sandbox, including template handling, local session persistence, and a command-confirmation flow.

Changes:

  • Introduces a new /dashboard/terminal route with server-side team/template resolution and an unauthenticated sign-in prompt.
  • Implements a client-side terminal UI using @xterm/xterm, including resize logic, sandbox lifecycle management, and command-confirmation before sending URL-provided commands.
  • Updates middleware auth redirect logic to exempt /dashboard/terminal, and adds unit/integration coverage for the new behavior.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/unit/dashboard-terminal.test.ts Adds unit tests for template normalization, localStorage session handling, sizing calculations, and sandbox open/reuse behavior.
tests/integration/proxy.test.ts Ensures unauthenticated users are not redirected away from /dashboard/terminal.
src/features/dashboard/terminal/types.ts Adds terminal-related types (status, storage session shape, launch options).
src/features/dashboard/terminal/terminal-size.ts Implements terminal sizing based on container size and measured xterm cell dimensions.
src/features/dashboard/terminal/terminal-panel.tsx Adds the terminal header UI (template/sandbox ID display + copy/refresh actions).
src/features/dashboard/terminal/template.ts Adds template normalization + override resolution with basic input hardening.
src/features/dashboard/terminal/storage.ts Adds localStorage persistence for per-user sandbox session info.
src/features/dashboard/terminal/sandbox-session.ts Adds logic to connect/create sandboxes and reuse stored sessions when compatible.
src/features/dashboard/terminal/dashboard-terminal.tsx Implements the xterm-based terminal client, PTY wiring, command queueing, and URL synchronization.
src/features/dashboard/terminal/dashboard-terminal-command-dialog.tsx Adds a confirmation dialog before running commands sourced from URL params.
src/features/dashboard/terminal/constants.ts Centralizes terminal constants (timeouts, defaults, storage prefix).
src/features/dashboard/layouts/header.tsx Minor layout adjustment (adds gap in header client-only area).
src/core/server/http/proxy.ts Updates auth redirect logic to allow /dashboard/terminal without authentication.
src/core/server/api/middlewares/auth.ts Tightens typing for Supabase cookie setAll integration.
src/app/dashboard/terminal/page.tsx Adds the server route for terminal, including auth/team/template checks and sign-in/unavailable states.
src/app/dashboard/terminal/layout.tsx Adds a layout importing xterm CSS for the terminal route segment.
package.json Adds @xterm/xterm dependency.
bun.lock Locks @xterm/xterm dependency version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/features/dashboard/terminal/storage.ts Outdated
Comment thread src/core/server/http/proxy.ts
Comment thread src/features/dashboard/terminal/dashboard-terminal.tsx
Comment thread src/features/dashboard/terminal/dashboard-terminal.tsx Outdated
Comment thread src/app/dashboard/terminal/page.tsx Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe70042bf8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/features/dashboard/terminal/storage.ts Outdated
Comment thread src/features/dashboard/terminal/template.ts Outdated
Copy link
Copy Markdown

@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 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8cf74ca. Configure here.

Comment thread src/app/dashboard/terminal/page.tsx
@djeebus djeebus requested a review from drankou as a code owner May 20, 2026 22:05
Copy link
Copy Markdown

@djeebus djeebus left a comment

Choose a reason for hiding this comment

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

not exposed anywhere, but a good foundational step forward

@matthewlouisbrockman matthewlouisbrockman merged commit 6994abf into main May 22, 2026
15 checks passed
@matthewlouisbrockman matthewlouisbrockman deleted the feat/ez-terminal branch May 22, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants