styleguidekit-assets-default icon indicating copy to clipboard operation
styleguidekit-assets-default copied to clipboard

Request: Finer control over "view all" links

Open acarnwath opened this issue 8 years ago • 10 comments

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.

acarnwath avatar Oct 09 '17 15:10 acarnwath

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.

bmuenzenmeyer avatar Oct 09 '17 15:10 bmuenzenmeyer

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"

acarnwath avatar Oct 09 '17 15:10 acarnwath

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)
---

bradfrost avatar Oct 09 '17 15:10 bradfrost

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).

acarnwath avatar Oct 09 '17 16:10 acarnwath

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 [email protected] 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 avatar Oct 09 '17 16:10 bmuenzenmeyer

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.

bmuenzenmeyer avatar Oct 09 '17 16:10 bmuenzenmeyer

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.

bradfrost avatar Oct 09 '17 16:10 bradfrost

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

bmuenzenmeyer avatar Oct 09 '17 16:10 bmuenzenmeyer

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

bradfrost avatar Oct 09 '17 16:10 bradfrost

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

EvanLovely avatar Oct 16 '17 05:10 EvanLovely