Default new workspace placement to end - #3293
austinywang wants to merge 9 commits into
Conversation
The new workspace placement default is changing for Cmd+N behavior, so this captures the intended default and the append insertion contract before the implementation changes. Constraint: Local tests were explicitly disallowed for this task Confidence: high Scope-risk: narrow Tested: Not run; test-only commit is intentionally red against current main because defaultPlacement is still .afterCurrent Not-tested: Local test execution per user instruction
Cmd+N should match the expected append behavior from issue #3291 and the related #3238 discussion. The workspace placement default now resolves to end, while explicit user settings continue to win through UserDefaults and the managed settings template stays synced through WorkspacePlacementSettings.defaultPlacement. Constraint: Preserve explicit stored newWorkspacePlacement values Rejected: Duplicate an "end" literal in the settings-file template | using WorkspacePlacementSettings.defaultPlacement keeps managed config defaults synced with the app default Confidence: high Scope-risk: narrow Tested: git diff --check Not-tested: Local tests per user instruction; app build deferred to required final reload command
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughDefault new-workspace placement fallback changed from ChangesDefault placement behavior
Test coverage for placement decoding
Docs example update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Greptile SummaryThis PR changes the default new workspace placement from
Confidence Score: 5/5Safe to merge — the change is a single enum constant swap with no logic modifications, and all related layers are updated consistently. The diff touches only the fallback default value; the insertion logic itself is untouched. The Swift constant, JSON schema, doc template, and tests all agree on No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User presses Cmd+N] --> B{newWorkspacePlacement\nstored in UserDefaults?}
B -- "Yes (valid raw value)" --> C[Use stored placement\ntop / afterCurrent / end]
B -- "No or invalid" --> D[Use defaultPlacement\n.end ← changed from .afterCurrent]
C --> E[insertionIndex resolves position]
D --> E
E --> F[Workspace appended / inserted]
Reviews (6): Last reviewed commit: "docs: align workspace placement config e..." | Re-trigger Greptile |
The previous default was afterCurrent. User feedback confirmed the three placement modes are useful, but the default itself should remain unchanged from the existing behavior. Constraint: Latest user instruction overrides the earlier issue request to default to end Rejected: Keep the end default from #3291 | user explicitly asked not to change the previous default Confidence: high Scope-risk: narrow Tested: git diff --check Not-tested: Local tests per prior task instruction; app rebuild/launch still required
|
Closing after follow-up feedback: the previous default was .afterCurrent, and we should not change it to .end. The branch now restores the prior default. |
The placement selector already supports Top, End, and After Current. This strengthens the settings reader regression coverage so all stored placement values round-trip while preserving the original afterCurrent default. Constraint: Do not change the existing default placement Rejected: Keep the earlier end-default regression | user confirmed the default should not change Confidence: high Scope-risk: narrow Tested: git diff --check Not-tested: Local tests per earlier task instruction
The branch is synced with current main before addressing PR #3293. The workspace placement tests now use XCTest's throwing unwrap helper for isolated UserDefaults setup, preserving allCases coverage while removing setup boilerplate that pushed WorkspaceUnitTests over the file-length guard on the old CI merge base. Constraint: PR intent is to keep the afterCurrent default while testing all stored placements Constraint: iterate-pr requires syncing the latest base before pushing fixes Rejected: Refresh the Swift file-length budget | this PR should not accept new test-file debt for setup boilerplate Confidence: high Scope-risk: narrow Tested: git diff --check; ./tests/test_ci_swift_file_length_budget.sh Not-tested: Local XCTest/app tests per repo policy
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7e32f52. Configure here.
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 `@Sources/TabManager.swift`:
- Line 211: The fallback default for new workspace placement was changed
improperly: restore the static constant defaultPlacement in TabManager (symbol:
static let defaultPlacement) back to .afterCurrent so unset or invalid
newWorkspacePlacement continues to behave as before; update the value in
TabManager.swift from .end to .afterCurrent and run tests/quick manual check of
workspace opening to confirm behavior.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: cea3a0eb-4a71-4746-8174-a6c8535c5339
📒 Files selected for processing (1)
Sources/TabManager.swift
Dismissed as a verified false positive: issue #3291 explicitly requests changing the default fallback to .end, and the inline CodeRabbit thread was answered and resolved.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
Sources/TabManager.swift (1)
211-211:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRestore the fallback default to
.afterCurrentto match the branch’s final objective.Line 211 currently keeps
.end, so unset/invalid placement values still resolve to end instead of the restored legacy default.Suggested fix
- static let defaultPlacement: NewWorkspacePlacement = .end + static let defaultPlacement: NewWorkspacePlacement = .afterCurrent🤖 Prompt for 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. In `@Sources/TabManager.swift` at line 211, The stored default for new workspace placement is wrong: change the constant static let defaultPlacement: NewWorkspacePlacement = .end to use the legacy fallback .afterCurrent so that unset or invalid placement values resolve to .afterCurrent; update the declaration of defaultPlacement in TabManager (or wherever static let defaultPlacement is defined) to use .afterCurrent and run tests/compile to ensure callers of defaultPlacement pick up the restored fallback.
🤖 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.
Duplicate comments:
In `@Sources/TabManager.swift`:
- Line 211: The stored default for new workspace placement is wrong: change the
constant static let defaultPlacement: NewWorkspacePlacement = .end to use the
legacy fallback .afterCurrent so that unset or invalid placement values resolve
to .afterCurrent; update the declaration of defaultPlacement in TabManager (or
wherever static let defaultPlacement is defined) to use .afterCurrent and run
tests/compile to ensure callers of defaultPlacement pick up the restored
fallback.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0e2418c3-ad32-4c89-8e33-2df325d0ab35
📒 Files selected for processing (2)
Sources/TabManager.swiftweb/app/[locale]/docs/configuration/page.tsx

Summary
Closes #3291.
Changes the default new workspace placement from
After CurrenttoEndso new Cmd+N workspaces append to the end when the user has not explicitly configurednewWorkspacePlacement.What changed:
WorkspacePlacementSettings.defaultPlacementnow defaults to.end.WorkspacePlacementSettings.defaultPlacement, keeping the generated config default in sync.app.newWorkspacePlacementis nowend..end, while explicit stored values for all placement modes still win.Verification
git diff --checkSummary by CodeRabbit
Chores
Tests
Documentation
Note
Low Risk
Low risk: a small default-behavior tweak with synchronized schema/docs and updated unit coverage; only affects users who haven’t explicitly set
newWorkspacePlacement.Overview
Defaults
newWorkspacePlacementtoend(instead ofafterCurrent) so newly created workspaces append to the bottom when the setting is unset or invalid.Updates unit tests to expect the new fallback behavior and to validate all
NewWorkspacePlacementstored values, and syncs the web config schema and docs example to showendas the default.Reviewed by Cursor Bugbot for commit 27d12fe. Bugbot is set up for automated code reviews on this repo. Configure here.