Set active workspace as default terminal cwd#8195
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughTerminalTab reads the active workspace pathname from Redux and uses it as the default cwd when creating new terminal sessions; createNewSession now resolves cwd with that fallback and its callback dependencies include activeWorkspacePathname. ChangesTerminal working directory initialization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/bruno-app/src/components/Devtools/Console/TerminalTab/index.js`:
- Around line 222-226: The selector assigned to activeWorkspacePathname assumes
state.workspaces is present and can throw; update the useSelector callback to
defensively guard when state.workspaces is undefined (e.g., return null early or
default to an empty object) before destructuring workspaces and
activeWorkspaceUid so the lookup (workspaces?.find(...)) never runs on
undefined; reference the activeWorkspacePathname constant, the useSelector
callback, and the state.workspaces / workspaces / activeWorkspaceUid fields when
making this change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 014f3a1b-1cda-4301-b3a3-31e4d48c9c30
📒 Files selected for processing (1)
packages/bruno-app/src/components/Devtools/Console/TerminalTab/index.js
59daa4c to
d733129
Compare
This PR updates the Terminal tab so new sessions created with the + button start in the active workspace directory by default. Contextual Open in Terminal actions still pass their explicit cwd.
Tested manually by creating a new terminal session and verifying pwd points to the active workspace.
Summary by CodeRabbit