feat(terminal): add directory selector for customizable deploy path#127
Merged
feat(terminal): add directory selector for customizable deploy path#127
Conversation
- 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
✅ PR Check Results: PassedBuild Checks
✨ Great work!All checks passed successfully. Your PR is ready for review. Details:
🔗 View Details: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 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
node_modules,.git,.next, and other build artifacts🔧 Technical Changes
useAppRunnerhook for app start/stop logicrunCommandaction to execute sandbox commands📁 Files Changed
actions/sandbox.ts,hooks/use-app-runner.ts,directory-selector.tsx,app-runner.tsx,app-runner-dialog.tsxtoolbar.tsx(refactored, now much simpler)🧪 Testing
./uses base path/home/fulling/next