Disable stack features by default - #9002
Alex Ross (alexr00) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (4)
UsingcanSelectMany: areStacksEnabled()makes multi-selection depend on the setting at *tree view… · New Thecontributes.configurationschema in VS Code doesn’t include anincludedproperty for… · New The same stacks-disabled guard and identical error message are repeated in multiple places in this… · New This introduces a user-facing error string that isn’t localized, while other new call sites use… · New
What changed in this PR
Introduces an opt-in setting to disable pull request stack functionality by default, and gates stack-related UI/actions based on that setting.
Changes:
- Added
githubPullRequests.experimental.stackssetting (defaultfalse) plus a sharedareStacksEnabled()helper. - Disabled/guarded stack-dependent behaviors in the PR tree, PR overview/webviews, merge-stack, unstack, and create-PR stack flows.
- Added test coverage and a reusable test mock for the new stacks setting.
| File | Description |
|---|---|
| src/view/prsTreeDataProvider.ts | Gates tree multi-select and “Add to Stack” enablement/execution based on the stacks setting. |
| src/github/pullRequestStack.ts | Prevents stack creation logic from running when stacks are disabled. |
| src/github/pullRequestReviewCommon.ts | Blocks merge-stack when stacks are disabled. |
| src/github/pullRequestOverview.ts | Skips stack loading/refresh and blocks unstack when stacks are disabled; refreshes on setting changes. |
| src/github/createPRViewProvider.ts | Skips stack candidate lookup and blocks stack operations when stacks are disabled; reacts to setting changes. |
| src/github/activityBarViewProvider.ts | Skips stack loading in the activity bar view when stacks are disabled; refreshes on setting changes. |
| src/common/settingsUtils.ts | Adds areStacksEnabled() helper reading the new setting. |
| src/common/settingKeys.ts | Adds EXPERIMENTAL_STACKS setting key constant. |
| package.json | Contributes the new experimental stacks setting (default disabled). |
| package.nls.json | Adds localized description string for the new setting. |
| src/test/mocks/mockStackSetting.ts | Adds a shared test helper to toggle stacks on/off via config stubbing. |
| src/test/view/prsTree.test.ts | Adds tests ensuring stack UI is disabled when stacks are disabled. |
| src/test/github/pullRequestStack.test.ts | Adds test ensuring stack creation is rejected when disabled. |
| src/test/github/pullRequestOverview.test.ts | Adds tests ensuring stack membership/merge/unstack are blocked or skipped when disabled. |
| src/test/github/createPRViewProvider.test.ts | Adds tests ensuring stack candidate lookup/stack selection is blocked when disabled. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
d06e3e7 to
2cd62f1
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Hidden overview panels can retain stale stack UI after the setting changes.
Review effort: Balanced
Findings: 1
Open (1)
Resolved since last review (4)
UsingcanSelectMany: areStacksEnabled()makes multi-selection depend on the setting at *tree view… This introduces a user-facing error string that isn’t localized, while other new call sites use… The same stacks-disabled guard and identical error message are repeated in multiple places in this… Thecontributes.configurationschema in VS Code doesn’t include anincludedproperty for…
| this._register(vscode.workspace.onDidChangeConfiguration(e => { | ||
| if (e.affectsConfiguration(`${PR_SETTINGS_NAMESPACE}.${EXPERIMENTAL_STACKS}`)) { | ||
| void this.refreshPanel(); | ||
| } | ||
| })); |


No description provided.