Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Fixes #259879

Copilot AI changed the title [WIP] Fix item indentation when no parents are present Hide twisties and indentation when SCM repositories have flat hierarchy Nov 17, 2025
Copilot AI requested a review from dmitrivMS November 17, 2025 19:02
Copilot finished work on behalf of dmitrivMS November 17, 2025 19:02
@dmitrivMS
Copy link
Contributor

This is what it looks like:
image

@dmitrivMS dmitrivMS marked this pull request as ready for review November 18, 2025 07:40
Copilot AI review requested due to automatic review settings November 18, 2025 07:40
@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@TylerLeonhardt

Matched files:

  • src/vs/platform/quickinput/browser/media/quickInput.css
  • src/vs/platform/quickinput/browser/tree/quickInputTreeController.ts

@dmitrivMS dmitrivMS enabled auto-merge (squash) November 18, 2025 07:40
@dmitrivMS dmitrivMS added quick-pick Quick-pick widget issues ~copilot-video-please ⚠️WIP🏗️ Use in PRs. Runs Copilot CLI agent to record a video of "trying out the change" labels Nov 18, 2025
@dmitrivMS dmitrivMS added this to the November 2025 milestone Nov 18, 2025
@vs-code-engineering vs-code-engineering bot removed the ~copilot-video-please ⚠️WIP🏗️ Use in PRs. Runs Copilot CLI agent to record a video of "trying out the change" label Nov 18, 2025
@dmitrivMS dmitrivMS changed the title Hide twisties and indentation when SCM repositories have flat hierarchy Hide twisties and indentation when tree nodes have flat hierarchy Nov 18, 2025
Copilot finished reviewing on behalf of dmitrivMS November 18, 2025 07:43
@vs-code-engineering
Copy link

🤖 Copilot has tried out this change! Members of the team can view the recording here or download the Playwright trace here (run)

@vs-code-engineering
Copy link

🤖 Copilot has tried out this change! Members of the team can view the recording here or download the Playwright trace here (run)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the hiding of twistie icons and indentation in tree views when there are no nested items, specifically for the QuickInputTree component. This saves horizontal space when all items are at the top level.

Key Changes

  • Flat hierarchy detection: The setTreeData method now detects when items have no children by checking if item.children?.length exists during tree element creation
  • Visual treatment: Applied CSS rules to hide twistie icons and indent containers when the quick-input-tree-flat class is present
  • Bug fix: Corrected missing parentheses in Emitter constructor call

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/platform/quickinput/browser/tree/quickInputTreeController.ts Added flat hierarchy detection logic and constant, fixed Emitter syntax, and toggles CSS class based on nested items
src/vs/platform/quickinput/browser/media/quickInput.css Added CSS rules to hide twistie and indent elements when flat hierarchy class is applied

@dmitrivMS
Copy link
Contributor

@copilot change this:
if ((item.children?.length ?? 0) > 0) {
to
if (item.children && item.children.length > 0) {

Change condition from `if ((item.children?.length ?? 0) > 0)` to
`if (item.children && item.children.length > 0)` for better clarity.

Co-authored-by: dmitrivMS <[email protected]>
Copy link
Contributor Author

Copilot AI commented Nov 18, 2025

@copilot change this:
if ((item.children?.length ?? 0) > 0) {
to
...

Done in d7e8e78

Copilot finished work on behalf of dmitrivMS November 18, 2025 08:35
Copy link
Contributor Author

Copilot AI commented Nov 18, 2025

@dmitrivMS Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: f3260b50-3231-4aa9-af9d-4e7bfb6e10fe

Sorry for the inconvenience!

@dmitrivMS dmitrivMS merged commit afd78dd into main Nov 19, 2025
28 checks passed
@dmitrivMS dmitrivMS deleted the copilot/fix-indent-logic-for-items branch November 19, 2025 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

quick-pick Quick-pick widget issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If none of the items have parents do not indent the items

3 participants