pattern-lab / styleguidekit-assets-default

The static assets for the default StyleguideKit for Pattern Lab. Contains styles and mark-up for Pattern Lab's front-end.
http://patternlab.io/
MIT License
35 stars 67 forks source link

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

Open acarnwath opened 6 years ago

acarnwath commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

It seems like this is related, on the PHP side: https://github.com/pattern-lab/patternlab-php/issues/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 commented 6 years ago

There's a lot of opportunity to put stuff at that level of navigation / markdown! Love it

On Mon, Oct 9, 2017 at 10:58 AM Brad Frost notifications@github.com wrote:

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)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/pattern-lab/styleguidekit-assets-default/issues/84#issuecomment-335201460, or mute the thread https://github.com/notifications/unsubscribe-auth/AASNw4CHnph2C7SRParFM6P2VfoHVYxUks5sqkKSgaJpZM4Pyrg3 .

bmuenzenmeyer commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

bradfrost commented 6 years ago

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

EvanLovely commented 6 years ago

https://github.com/pattern-lab/the-spec/issues/34