Skip to content

Conversation

@Che-Zhu
Copy link
Collaborator

@Che-Zhu Che-Zhu commented Jan 20, 2026

🎯 What does this PR do?

Adds the ability for users to select which directory to deploy when running their app. Previously, the app always started from the fixed path /home/fulling/next. Now users can choose from available project directories.

✨ Features

  • Directory Selector Dropdown - Shows available directories fetched dynamically from the sandbox
  • Custom Workdir - Selected directory is used as the working directory when starting the app
  • Smart Filtering - Automatically excludes node_modules, .git, .next, and other build artifacts

🔧 Technical Changes

Area Change
Component Architecture Refactored toolbar into smaller, focused components
State Management Created useAppRunner hook for app start/stop logic
Server Actions Added runCommand action to execute sandbox commands

📁 Files Changed

  • New: actions/sandbox.ts, hooks/use-app-runner.ts, directory-selector.tsx, app-runner.tsx, app-runner-dialog.tsx
  • Modified: toolbar.tsx (refactored, now much simpler)

🧪 Testing

  • Directory list loads correctly from sandbox
  • Selected directory persists in UI
  • App starts with correct workdir
  • Default ./ uses base path /home/fulling/next
  • Build passes
  • Lint passes (warnings only)

Che-Zhu and others added 7 commits January 19, 2026 19:00
- Move lib/actions to root /actions directory
- Implement runCommand action in actions/sandbox.ts
- Extract TTYD context helper to lib/util/ttyd-context.ts
- Create actions/types.ts for shared action types
- Update component imports
- Move terminal-toolbar.tsx to toolbar/toolbar.tsx
- Update imports in terminal-container.tsx
…arate components

- Extract app runner state and logic into useAppRunner custom hook
- Split app runner UI into dedicated AppRunner and AppRunnerDialog components
- Simplify TerminalToolbar by removing inline app runner implementation
- Improve code organization and reusability

This refactoring separates concerns by moving app runner business logic
into a reusable hook and component, making the toolbar component cleaner
and easier to maintain.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…dropdown

- Extract directory selector from app-runner.tsx into directory-selector.tsx
- Implement dropdown menu using shadcn DropdownMenu for directory selection
- Add placeholder options (./ and /app) for testing
- Increase width from 80px to 120px for better readability
- Support both controlled and uncontrolled modes via value/onChange props
…ctor

- Add sandboxId prop and fetch directories via runCommand('find . -type d -maxdepth 2')
- Filter out node_modules, .git, .next, and other build directories
- Filter welcome message lines by only keeping paths starting with . or /
- Add loading spinner while fetching directories
- Match dropdown width to trigger button using CSS variable
- Limit directory list to 20 items with overflow scroll
- Move separator outside the flex container in AppRunner
- Add deployDirectory state to AppRunner and pass to DirectorySelector (controlled mode)
- Modify useAppRunner to accept deployDir param and dynamically calculate workdir
- workdir defaults to /home/fulling/next, appends relative path when non-root selected
- Reduce directory search depth to maxdepth 1 for cleaner listing
- Increase DirectorySelector width from 120px to 180px for better readability
@github-actions
Copy link

✅ PR Check Results: Passed

Build Checks

Check Status
Lint & Build ✅ Passed
Docker Build ✅ Passed

✨ Great work!

All checks passed successfully. Your PR is ready for review.

Details:

  • ✅ Code quality verified (linting passed)
  • ✅ Build successful
  • ✅ Docker image build verified (linux/amd64)
    Commit: 6253ac26479847d3fb8cc6aa1d75469a145b1a20
    Branch: feat/selective-deploy-path

🔗 View Details:

@Che-Zhu Che-Zhu merged commit 0f77faf into main Jan 20, 2026
9 checks passed
@Che-Zhu Che-Zhu deleted the feat/selective-deploy-path branch January 20, 2026 07:36
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.

2 participants