Skip to content

Multiple Gallery Filters #178

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

Merged
merged 43 commits into from
Nov 19, 2021
Merged

Multiple Gallery Filters #178

merged 43 commits into from
Nov 19, 2021

Conversation

jukent
Copy link
Contributor

@jukent jukent commented Oct 28, 2021

Closes #125

Step 1 - Add a class associated with each tag to every card

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2021

This pull request is being automatically built with GitHub Actions and Netlify. To see the status of your deployment, click below.

🔍 Git commit SHA: 73d86c6
✅ Deployment Preview URL: https://6196e4e471ef9c009a5ae0ca--projectpythia-org.netlify.app

@kmpaul
Copy link
Collaborator

kmpaul commented Oct 28, 2021

Just popping in to say, "Thanks, @jukent!"

@jukent
Copy link
Contributor Author

jukent commented Oct 28, 2021

Just popping in to say, "Thanks, @jukent!"

Of course! Might have to pick your brain later. :)

@jukent
Copy link
Contributor Author

jukent commented Oct 28, 2021

Step 2 - Initial JS

@kmpaul
Copy link
Collaborator

kmpaul commented Oct 28, 2021

@jukent: Take a look at the three commits I just made, one to custom.js and one to the yaml_gallery_generator.py file. I changed the JS to modify the classes of the elements instead of the style directly. That way we don't have to compete with Bootstrap's styling. (That is, we actually use Bootstrap styling directly by changing the classes!) And the change to the Python file is to add the tag names to the :column: element of each Sphinx Panel. I think this now actually works the way it is intended...namely, clicking on a tag from any of the dropdown menus toggles the display of that tag. (The last commit just styles the button elements with Bootstrap btn classes so they are pretty.)

This behavior is not exactly what we want, though. In fact, I think I just realized that it is wrong in some ways. For example, imagine you have 2 visible cards with the following tags:

  • card1: tag1 tag2
  • card2: tag1 tag3

With this implementation, if you "click" tag3, then card2 will be hidden, but card1 will still be visible. Then, if you click tag1, then card1 will be hidden and card2 will be made visible! That's not what we want. And it's result of toggling the state of the cards as hidden or visible.

So, what we need to do is provide a way of selecting and de-selecting tags to display. And I think we need to not use the toggling behavior, but I'm not sure how better to do this.

@jukent
Copy link
Contributor Author

jukent commented Oct 28, 2021

Hmm that is interesting. We may be able to manipulate the toggling. I'll look into other avenues for this.

@kmpaul kmpaul added the infrastructure Infrastructure related issue label Nov 18, 2021
@jukent jukent marked this pull request as ready for review November 18, 2021 22:27
@jukent jukent requested a review from a team as a code owner November 18, 2021 22:27
@jukent jukent requested review from brian-rose and andersy005 and removed request for a team November 18, 2021 22:27
@jukent jukent mentioned this pull request Nov 18, 2021
@kmpaul
Copy link
Collaborator

kmpaul commented Nov 18, 2021

@ProjectPythia/infrastructure: This PR is failing to build, and the failure says that even though mamba appears to be correctly installed by the conda-incubator/setup-miniconda action, it cannot find mamba. I don't know what is going on here.

This failure is happening on #151, too.

@kmpaul
Copy link
Collaborator

kmpaul commented Nov 18, 2021

@ProjectPythia/infrastructure: This error (mamba not found) is happening on the Foundations repo, too. So, this is a more widespread problem. I don't see any issues in the conda-incubator/setup-miniconda GitHub repo about this, and it seems to have only started in the last 8 hours. If I try to install mamba in my own test environment, it installs and is executable.

@kmpaul
Copy link
Collaborator

kmpaul commented Nov 18, 2021

Ok. I believe the problem is coming from the latest release of mamba (0.18.0). I fixed the version of mamba to 0.17.0 (last releast) and it appears to build, now.

@kmpaul
Copy link
Collaborator

kmpaul commented Nov 18, 2021

@brian-rose @andersy005: This is ready for review, now.

Copy link
Member

@brian-rose brian-rose left a comment

Choose a reason for hiding this comment

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

I'm reviewing only the functionality because I know nothing about javascript, but I love this! I played around with various checkbox combinations and didn't find any glitches. This is just what I was envisioning when I originally proposed #125.

Great work @jukent and @kmpaul ! This is critical infrastructure.

@jukent jukent merged commit ef59521 into ProjectPythia:main Nov 19, 2021
@jukent jukent deleted the mlt-gal-flt branch November 19, 2021 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Infrastructure related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple gallery filters
4 participants