Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TreeSection actions container styling #1390

Merged
merged 7 commits into from
Apr 18, 2024
Merged

Conversation

dotNomad
Copy link
Collaborator

@dotNomad dotNomad commented Apr 17, 2024

This PR adds more functionality and styling to the TreeSection:

  • Adds an actions container to place icons (currently hardcoded with one)
  • Actions are only visible if the pane is hovered or focused just like other views
  • Moves @click handling to the title only so clicking on an action doesn't cause expanded to be toggled
  • Adds focus and hover styling to the actions and header
  • Adds the ability to expand the TreeSection when it is focused, and enter is pressed
Preview Video
CleanShot.2024-04-17.at.16.05.54.mp4

Intent

Part of #1333

Type of Change

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

:class="{ expanded: expanded }"
@click="expanded = !expanded"
@keydown.enter.self="toggleExpanded"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This makes it so ONLY the pane-header listens for keydown.enter otherwise focus on the children would have caused the toggle.

:class="expanded ? 'codicon-chevron-down' : 'codicon-chevron-right'"
/>
<h3 class="title">{{ title }}</h3>
<div class="pane-header-title-container" @click="toggleExpanded">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created this, and used justify-content: space-between to better handle toggleExpanded in Vue.

This is not how VSCode structures the DOM or styles it, but it looks and behaves functionality the same.

Copy link
Collaborator

@sagerb sagerb left a comment

Choose a reason for hiding this comment

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

Looking good!

@dotNomad dotNomad merged commit 1c7f272 into main Apr 18, 2024
16 checks passed
@dotNomad dotNomad deleted the dotnomad/tree-actions branch April 18, 2024 21:24
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.

2 participants