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

Request: Finer control over "view all" links #84

Open
acarnwath opened this issue Oct 9, 2017 · 10 comments
Open

Request: Finer control over "view all" links #84

acarnwath opened this issue Oct 9, 2017 · 10 comments

Comments

@acarnwath
Copy link

I'd like to be able to hide the global "view all" link in the top bar (I am using a "defaultPattern" already), as that view is just so bogged down once all of my (and third-party) JS starts running on all of my patterns. However, I'd like to keep the "view all" links in the folders (atoms/molecules/organisms) and in the subfolders, as those are not too bogged down (yet!).

Currently ishControlsHide[views-all] :false controls all of the links - I would like more fine control over which "levels" should be hidden.

@bmuenzenmeyer
Copy link
Member

thanks for opening this - part of the problem was me bastardizing the original implementation of ishControlsHide to have [views-all] do both.

I'd propose a new property for the top-level link.

@acarnwath
Copy link
Author

acarnwath commented Oct 9, 2017

It would be really awesome if there was some way to show it for some folders and not others.
For example, we use our "view all atoms" pretty regularly, but hardly ever use "view all organisms" but we do use "view all organisms > header" (lots of pseudo patterns) regularly. Not sure quite how to handle that in a config though...

Not knowing any of the "under the hood" code, something like this could be user friendly, perhaps:

"ishControlsHide": {
    "views-all": ["*", "01-atoms/*", "02-organisms", "02-organisms/03-modals"]
}

* being the global "view all",
00-atoms/* being all subfolders in the atoms folder, but not the "view all atoms"
02-organisms being the "view all organisms", but not subfolders
02-organisms/03-modals being the "view all organisms > modal"

@bradfrost
Copy link
Member

One proposition would be to put that fine-grained config in the optional markdown file that lives adjacent to the folder. So in 00-global.md sitting beside atoms/00-global, you could have something like:

---
title: Global Elements
viewAllLink: true | false (defaults to true)
---

@acarnwath
Copy link
Author

acarnwath commented Oct 9, 2017

It seems like this is related, on the PHP side: pattern-lab/patternlab-php#257 though when I prepend the file with a -, like the _, it just hides from the nav altogether in the node version (haven't tested PHP to see if that's consistent).

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Oct 9, 2017 via email

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Oct 9, 2017

It seems like this is related, on the PHP side: pattern-lab/patternlab-php#257 though when I prepend the file with a -, like the _, it just hides from the nav altogether in the node version (haven't tested PHP to see if that's consistent).

I am very opposed to the filename conventions doing magic things. It messes with version control, regexes, file parsing, and is not the correct way to represent the state or presentation of a pattern or group of patterns. This is what the markdown frontmatter is for.

@bradfrost
Copy link
Member

I am very opposed to the filename conventions doing magic things.

I concur. A lot of that stuff was put in place before Markdown/YAML support. Now that we have those hooks in there, let's take advantage of them instead.

@bmuenzenmeyer
Copy link
Member

Labeling "spec writeup needed" to make sure we review and cull out file convention logic and replace it with markdown/frontmatter

@bradfrost
Copy link
Member

Good plan. That stuff should be deprecated and I think that's acceptable.

@bradfrost bradfrost changed the title Request: More fine control over the "view all" links Request: Finer control over the "view all" links Oct 9, 2017
@bradfrost bradfrost changed the title Request: Finer control over the "view all" links Request: Finer control over "view all" links Oct 9, 2017
@EvanLovely
Copy link
Member

pattern-lab/the-spec#34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants