Skip to content

NUX: Make disabling tips instance specific. #12633

Closed

Description

@TimothyBJacobs

Is your feature request related to a problem? Please describe.
If I disable tips in the Block Editor, I don't want that to hide tips for all other apps in my WordPress install.

Describe the solution you'd like
Something like context that would function similarly to the notices package. areTipsEnabled, enableTips and disableTips would all take an optional context parameter that defaults to global. Perhaps that'd include modifying the <DotTip /> component to include a context prop, it could be inferred from the tipId but that is almost certainly not correct for "shared spaces" like the editor.

Alternately, the context could be set for the entire page load and would just effect the reducer ( which would in turn mean they are persisted differently in localStorage. Like wp.nux.setContext().

For clarity, I mean a reducer shape something like this.

{
  "preferences": {
    "areTipsEnabled": ["global", "my-app"]
  }
}

Or if was important to distinguish the null state.

{
  "preferences": {
    "areTipsEnabled": {
      "global": true,
      "my-app": false
    }
  }
}

Describe alternatives you've considered
Heavily monkey patching isTipVisible(). #12632 would alleviate this need a bit since it'd be less likely that users would completely disable tips.

Activity

  1. designsimply commented on Dec 6, 2018

    @designsimply
    Member

    Would adding the ability to disable tips in one context area over another also cover the case you raised in #12632? Why is a separate issue needed for that case? Can that one be consolidated into this issue?

  2. TimothyBJacobs commented on Dec 6, 2018

    @TimothyBJacobs
    MemberAuthor

    As I mentioned, I think #12632 does alleviate the need partially, but I think they are distinct features.

    For instance, I'm planning on having an "enable/disable" tips control in the Screen Options section of our plugin section. It isn't particularly clear that disabling tips there would disable tips for the entirety of WordPress. And vice-versa, disabling the tips in the Gutenberg options doesn't seem clear that it'd disable tips for our plugin.

    Also, for clarity, I'm not sure I'd sum up #12632 as disabling tips in a certain area. More that it'd remove the current guide from the store state. It wouldn't necessarily be a permanent disabling of that guide, as I don't there is any way to permanently identify a guide.

  3. noisysocks commented on Dec 19, 2019

    @noisysocks
    Member

    Closing this out as DotTip is deprecated as of #18981. The Welcome Guide which has replaced tips uses isFeatureActive instead of areTipsEnabled.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] NUXAnything that impacts the new user experience[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions