dweber019 / backstage-plugins

A collection of Backstage plugins
MIT License
17 stars 5 forks source link

🐛 Tips Icon Doesn't Scroll or Disappear After Being Seen #18

Open JD-Gonz opened 2 months ago

JD-Gonz commented 2 months ago

Hey @dweber019 Great work on your plugins!

I noticed that for the tips plugin the icon doesn't scroll with the page. I would expect it to stay in the bottom right corner at all times. Tips-demo

I also can not get rid of the icon. There is always one tip at all times. Tips-demo2

Finally, Is there a way to review already seen tips or like a glossary of all tips in case someone wants to go see the expanded list of tips within backstage.

dweber019 commented 2 months ago

Hi @JD-Gonz

Thanks for the feedback, appreciate it 😉 Can you give me more infos about the scroll behaviour as this would be a bug.

I tried the same in this repo and don't have the issue CleanShot 2024-05-04 at 18 49 07

Did you setup the plugin like described at https://github.com/dweber019/backstage-plugins/blob/main/plugins/tips/README.md#entity-pages in the entityWarningContent?

I also can not get rid of the icon. There is always one tip at all times.

Yes this is currently the intended behaviour. It will always show all tips relevant for the page. The red cycle just shows the amount of tips available for this page and will not reduce when viewed.

Could you describe the use case you like to see. I in fact had some thoughts about memorisation, which tips where already viewed or some sorts of don't show next time checkbox.

Is there a way to review already seen tips or like a glossary of all tips in case someone wants to go see the expanded list of tips within backstage.

I could provide a page with all tips. Would you imagine something like this?

JD-Gonz commented 2 months ago

1. Scroll Bug

Did you setup the plugin like described at https://github.com/dweber019/backstage-plugins/blob/main/plugins/tips/README.md#entity-pages in the entityWarningContent?

Yes, I followed the setup as described in the README. Here is a snippet of my code where I added it but I'm pretty sure it's just OOB boilerplate code.

const entityWarningContent = (
  <>
    <EntitySwitch>
      <EntitySwitch.Case if={isOrphan}>
        <Grid item xs={12}>
          <EntityOrphanWarning />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>

    <EntitySwitch>
      <EntitySwitch.Case if={hasRelationWarnings}>
        <Grid item xs={12}>
          <EntityRelationWarning />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>

    <EntitySwitch>
      <EntitySwitch.Case if={hasCatalogProcessingErrors}>
        <Grid item xs={12}>
          <EntityProcessingErrorsPanel />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>

    <EntityTipsDialog />
  </>
);

2. Tips Icon

I could provide a page with all tips. Would you imagine something like this?

Yeah, I was thinking something along those lines. With the addition of this type of page, it would enable the icon to only show up when new tips are available.

Could you describe the use case you like to see.

I am thinking of the power user who has set up their components correctly. They don't need tips and might find the tips icon annoying as it adds no value. as for the added page - I am thinking of the user that accidentally clicks through the tip to quickly or reads a tip that isn't helpful right away but later becomes helpful, having a place they can query seen tips or tips that were not directly recommend to them could be helpful

dweber019 commented 2 months ago

1. Scroll bug Just tested it with a on my mac with chrome and safari and on windows with chrome and edge but could not reproduce it at least with this repo's setup.

2. Tips Icon Would you be willing to contribute such a page?

For the dismissible feature, we would have to figure out how this is communicated to the user that this tip is no longer shown after viewed. Thinking about a feature flag in the settings page, where you can toggle the feature generally to disable any tips (https://backstage.io/docs/plugins/feature-flags/). Additionally, we could add a checkbox to each tip like "Don't show this tip again".

JD-Gonz commented 2 months ago

1. Scroll Bug I will look into what setup I have that is causing this bug. I am on windows (WSL) running on Edge and Chrome.

2. Tips Icon yeah happy to look into this when I have a little more free time.