Skip to content

Add a Collapse All button to the Bundle Resource Explorer - #2273

Open
rugpanov wants to merge 5 commits into
mainfrom
rugpanov/resource-explorer-collapse-all
Open

rugpanov wants to merge 5 commits into
mainfrom
rugpanov/resource-explorer-collapse-all

Conversation

@rugpanov

@rugpanov rugpanov commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Changes

The Bundle Resource Explorer had no way to collapse the tree. Users folded each job, pipeline, and "Tasks" node by hand. Large bundles made the view cluttered. Closes #1698.

  • The extension now registers dabsResourceExplorerView with window.createTreeView(..., {showCollapseAll: true}), not registerTreeDataProvider.
  • VS Code adds its native Collapse All icon to the view title bar. The icon has a "Collapse All" tooltip and no text label.
  • The default expand state does not change. Users see the same tree on load as before.
  • The change adds no command, setting, or telemetry event.

Tests

  • New e2e step in refresh_resource_explorer_on_yml_change.e2e.ts:
    • It clicks Collapse All and waits until the job row is hidden.
    • It expands Jobs and checks that the job node stays collapsed. This proves that the button collapses nested nodes, not only the root.
  • The e2e helper getViewSection now collapses the other view sections with a click on the twisty. wdio's collapse() clicks the header centre. The wider Bundle Resource Explorer toolbar covers that point in CI, and VS Code ignores clicks on the toolbar. Without this change, almost every e2e spec timed out.
  • CI unit tests (Linux, Windows) pass. The integration tests run the new e2e step.
  • tsc, ESLint, and Prettier pass on the changed files.
  • I did not run the e2e step locally, because it needs a live workspace.

Known limitations

  • Collapse All also collapses the Jobs and Pipelines headers. To see the list of resources, the user expands a header again.
  • The extension has no Expand All button. VS Code has no native Expand All for extension tree views.
  • A deploy can expand task rows again. TaskTreeNode ids include the job id, which changes after the first deploy. Manual folding on main has the same behavior.
  • The native button does not send telemetry, because it is not an extension command.

This pull request and its description were written by Isaac.

*Why*:
* Users must fold each job, pipeline and task node by hand; large bundles make the view cluttered (#1698).

*What:*
* Register `dabsResourceExplorerView` with `window.createTreeView` and `showCollapseAll: true`, which adds VS Code's native Collapse All icon to the view title bar.
* The default expand state of the tree is unchanged.

*Verification:*
* `tsc --noEmit`: same error set as `origin/main` (pre-existing worktree artifacts only); e2e tsconfig compiles clean.
* ESLint and Prettier clean on the changed files.
* New e2e step in `refresh_resource_explorer_on_yml_change.e2e.ts` clicks Collapse All and checks that only the `Jobs` header stays visible; runs in CI.

Co-authored-by: Isaac <no-reply@databricks.com>
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:31 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:31 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:31 — with GitHub Actions Active
@rugpanov

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests running for 444ae0e6 — ⏳.
View run

*Why*:
* Clicking the centre of the view to reveal title actions can land on a tree row and toggle it, so the step could pass even if Collapse All did nothing.
* The step checked only the root, not nested nodes.

*What:*
* Hover the view header to reveal the action, and re-fetch and click it inside the retry loop.
* After Collapse All, expand `Jobs` and assert that the job node stays collapsed.

*Verification:*
* e2e `tsc`, ESLint and Prettier clean on the changed file; the step itself runs in CI.

Co-authored-by: Isaac <no-reply@databricks.com>
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:37 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:38 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:38 — with GitHub Actions Active
@rugpanov

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests running for 5d0253a0 — ⏳.
View run

*Why*:
* The check required exactly one visible `Jobs` row, which breaks if the fixture gains another resource type.
* The hover target used a hard-coded `.pane-header` class instead of the library's versioned locator.

*What:*
* Wait until no visible row shows the job, instead of matching an exact row list.
* Hover via `ViewSection.header$`.

*Verification:*
* e2e `tsc`, ESLint and Prettier clean on the changed file; the step itself runs in CI.

Co-authored-by: Isaac <no-reply@databricks.com>
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:43 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:44 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 11:45 — with GitHub Actions Active
@rugpanov

rugpanov commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ❌ failed for 673e5319.
View run

*Why*:
* `getViewSection` collapses every other section with wdio's `ViewSection.collapse()`, which clicks the centre of the pane header.
* The new Collapse All icon widens the Bundle Resource Explorer title-bar toolbar, so in the CI sidebar the toolbar covers the header centre. VS Code ignores header clicks that land on the toolbar, the section stays expanded, and `collapse()` times out — failing nearly every e2e spec at "wait for extension activation" / "wait for connection".

*What:*
* Add a `collapseViewSection` helper that clicks the section's `.twisty-container` and waits for it to collapse; use it in `getViewSection`.

*Verification:*
* CI integration logs: every failing shard hit "waitUntil condition timed out after 1000ms" on the Bundle Resource Explorer header click (aria-expanded stayed true); last night's nightly on main has none.
* e2e `tsc`, ESLint and Prettier clean; the integration run on this commit is the real check.

Co-authored-by: Isaac <no-reply@databricks.com>
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 12:48 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 12:48 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 12:50 — with GitHub Actions Active
@rugpanov

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests running for 69a54c34 — ⏳.
View run

*Why*:
* The nested-collapse check could pass without Collapse All if the previous step ever stopped expanding the job.

*What:*
* Assert that the job node is expanded before clicking Collapse All.
* Note why `collapseViewSection` skips hidden headers.

*Verification:*
* e2e `tsc`, ESLint and Prettier clean; the integration run on this commit is the real check.

Co-authored-by: Isaac <no-reply@databricks.com>
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 12:54 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2273
  • Commit SHA: f0a4e0ebea5a8972bceff4a37e0abf1a58d53c59

Checks will be approved automatically on success.

@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 12:55 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is October 23, 2026 12:56 — with GitHub Actions Active
@rugpanov

rugpanov commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ❌ failed for f0a4e0eb.
View run

@rugpanov
rugpanov marked this pull request as ready for review October 27, 2026 14:22
@rugpanov
rugpanov requested a review from rclarey October 27, 2026 14:22

This branch was successfully deployed

1 active deployment
test-trigger-is — f0a4e0eb Deployed Oct 23, 2026 by rugpanov via Trigger Tests #2433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add the option to collapse all resources in the Bundle Resources Explorer window

1 participant