fix: Improve codespace UX - README and terminal handling#1
Merged
Conversation
Fixes two UX issues: 1. README not opening on codespace start - VS Code "Get Started" page appears instead of README - Added postStartCommand to open README.md - Duplicated in postAttachCommand for reconnects 2. Post-setup script opens confusing new terminal - Script was running in .bashrc, blocking first terminal - User had to manually switch terminals - Solution: Run post-create via postCreateCommand in background - Uses nohup to detach from terminal - Logs to /tmp/post-create.log instead of blocking Before: - First terminal blocked by post-create.sh output - User sees "Get Started" page - Must manually find and switch to correct terminal After: - Terminal immediately available with venv active - README.md opens automatically - Post-create runs silently in background 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Automatically comments on PRs with a link to test the devcontainer changes via the configurator's template_branch parameter. When a PR is opened, the workflow comments with: https://configurator.chipflow.io/?template_branch=<branch-name> This enables testing devcontainer changes in a real codespace before merging. Benefits: - Zero additional infrastructure needed - Real testing with actual codespaces - Fast iteration on PR changes - Integrated with configurator workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🧪 Test this PR in a CodespaceUse the configurator with this PR's devcontainer changes: Open Configurator with branch: This will create a codespace using the devcontainer configuration from this PR branch. How to test:
💡 Tip: You can also manually append |
Add README.md with two-part structure: - Getting Started section for codespace users (top priority) - Developer documentation for reference Fixes the postStartCommand/postAttachCommand errors since README now exists when codespace opens. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace README auto-opening with welcome page served from configurator. Changes: - Remove postStartCommand/postAttachCommand from devcontainer.json (was trying to run 'code README.md' which fails in codespace startup) - Update post-create.sh to display and auto-open welcome page URL - Show formatted message in terminal with welcome URL - Auto-open browser with 'gp preview' (Codespaces) or Python webbrowser - Keep README.md for reference (but don't auto-open) The welcome page provides personalized getting started info including design configuration, enabled blocks, and copy-paste commands. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
GitHub's codespace creation API doesn't support env_vars parameter, so we now pass configuration through the design API response instead. Changes: - Extract config (configuratorApi, welcomeUrl) from design API response - Use extracted values instead of environment variables - Save config to bashrc for future terminal sessions - Add fallback to production URL if config missing This ensures welcome URL and API URL are always available in codespaces. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Export CHIPFLOW_CONFIGURATOR_API and CHIPFLOW_WELCOME_URL to current environment - This ensures variables are available in post-create script and child processes - bashrc writes ensure future terminal sessions also have these variables
- Create ~/.chipflow.env with config values - Add source statement to ~/.bashrc if not present - Source immediately for current session - This ensures new terminals automatically have env vars available
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.
Problem
When users opened GitHub Codespaces, they experienced confusing UX:
code README.mdcommand failedSolution
1. Run post-create script in background
.bashrcexecution topostCreateCommandindevcontainer.jsonnohupto run script in background:nohup bash /usr/local/share/post-create.sh > /tmp/post-create.log 2>&1 &2. Add personalized welcome page (NEW)
postStartCommand/postAttachCommand(was trying to runcode README.mdwhich fails)3. Add comprehensive README
4. Clean up .bashrc
.bashrcin DockerfileTesting
✅ Docker build test passed successfully
chipflow-template-devcontainer-testResult
Users now get a better first experience:
Dependencies
Requires companion PR in configurator (PR #15)