Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Collapse packages/themes on click - #593

Merged
thomasjo merged 10 commits into
atom:masterfrom
acontreras89:ac-collapse-lists
Aug 3, 2015
Merged

thomasjo merged 10 commits into
atom:masterfrom
acontreras89:ac-collapse-lists

Conversation

@acontreras89

Copy link
Copy Markdown
Contributor

Minimal implementation of the enhancement requested in #475.

  • Make packages and themes to collapse/expand on click
  • Make dynamically added entries to be shown or hidden depending on the visibility of the list (e.g. when installing a new package or theme)
  • Add specs

Closes #475

@winstliu

Copy link
Copy Markdown
Contributor

This will need some specs.

Comment thread lib/themes-panel.coffee Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason you're using underscore-plus's map function here instead of native Array.map?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No reason. I'll change that right away

@acontreras89

Copy link
Copy Markdown
Contributor Author

Specs added @50Wliu

@thomasjo

thomasjo commented Aug 2, 2015

Copy link
Copy Markdown
Contributor

This looks really good! Maybe we can have one spec that only collapses one sub-section? And perhaps one to verify that expanding collapses sections also work? That could help guard against any future regressions.

Besides these minor additions, this looks really to ⛵.

Comment thread lib/installed-packages-panel.coffee Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔥 empty line

@acontreras89

Copy link
Copy Markdown
Contributor Author

Updated the specs and removed the empty lines as you suggested, @thomasjo

Comment thread styles/settings-view.less Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this selector could be simplified to just .sub-section.collapsed .package-container – I'd also like to avoid referencing Bootstrap classes (like .row) since this package will stop using the Bootstrap grid at some point.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Using .sub-section.collapsed .package-container makes sections with zero packages to change in size when their headers are clicked. Would that be ok?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmmm what about .sub-section.collapsed .package-container .package-card?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, no problem! 💃

@thomasjo

thomasjo commented Aug 3, 2015

Copy link
Copy Markdown
Contributor

Been trying this out this morning and I like it. I do think the affordance of the click to collapse/expand is missing. There's no hint that clicking will expand or collapse the section. We will have to fix that. The easiest route is to use the fold and unfold icons. I'll experiment with this shortly.

/cc @simurai

@acontreras89

Copy link
Copy Markdown
Contributor Author

Thanks @thomasjo
I played a little bit with some icons, but couldn't find anything that felt right (not really good at styling, tbh).
That's why I described this PR as a minimal implementation of the enhancement 😛

Let me know if you need anything!

@thomasjo

thomasjo commented Aug 3, 2015

Copy link
Copy Markdown
Contributor

@acontreras89 Here's what I came up with: 4cc717d

settings-view-tweaks

You should be able to cherry-pick that commit into your branch (if you like it). I can tweak it further first if you want. And if you don't like, be honest.

@thomasjo

thomasjo commented Aug 3, 2015

Copy link
Copy Markdown
Contributor

By the way, is there any reason you're targeting .package-card elements for the collapsing? Why not just remove that from the selector and hide the entire .package-container instead? In other words change the selector to this

.sub-section.collapsed .package-container {
  display: none;
}

There might be a very good reason that I'm completely ignorant to, just figured I'd ask the obvious question.

@thomasjo

thomasjo commented Aug 3, 2015

Copy link
Copy Markdown
Contributor

I also think the waster whitespace between collapsed sections should be altered, but I can fix that later in a separate PR, just mentioning it for posterity.

@mnquintana

Copy link
Copy Markdown
Contributor

@thomasjo Looks good to me! 👍

By the way, is there any reason you're targeting .package-card elements for the collapsing?

@thomasjo #593 (comment)

@thomasjo

thomasjo commented Aug 3, 2015

Copy link
Copy Markdown
Contributor

@mnquintana Thanks for the heads up. We can tweak those little things later. There are some improvements I'd like to make, but I don't want that to stop this PR from moving forward. This is already a huge improvement over the current situation.

@acontreras89

Copy link
Copy Markdown
Contributor Author

There are some improvements I'd like to make, but I don't want that to stop this PR from moving forward. This is already a huge improvement over the current situation.

I definitely agree.
Give me 20 minutes and I'll push your commit :)

@thomasjo

thomasjo commented Aug 3, 2015

Copy link
Copy Markdown
Contributor

Unless anyone has any further comments or suggestions, I think this is ready to 🚢.

/cc @atom/feedback

@benogle

benogle commented Aug 3, 2015

Copy link
Copy Markdown
Contributor

👍

thomasjo added a commit that referenced this pull request Aug 3, 2015
@thomasjo
thomasjo merged commit e309359 into atom:master Aug 3, 2015
@thomasjo

thomasjo commented Aug 3, 2015

Copy link
Copy Markdown
Contributor

Thanks @acontreras89! Awesome work ❤️

@acontreras89

Copy link
Copy Markdown
Contributor Author

No problem at all, @thomasjo
I'll keep it coming as long as you guys make it this easy 👌

@simurai

simurai commented Aug 5, 2015

Copy link
Copy Markdown
Contributor

Nice.. 👏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants