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

ui: add splash screen for oss segments #5053

Merged
merged 20 commits into from
Oct 19, 2023
Merged

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Oct 16, 2023

This PR adds a splash screen for segments being open-sourced.

It looks like this:

image

About the changes

I've more or less wholesale copied the demo dialog that @nunogois implemented. I've put it in the splash directory for now (because that's where it seemed most appropriate). The reason for straight copying it instead of extending existing functionality is primarily that this should be short-lived and deleted after the next release or so. So isolating all the changes into a single directory seems like a good idea.

Discussion points

Because OSS installations don't connect to Unleash, we can't use feature flags to control the rollout here. Instead, we must just assume that OSS users will want to see it. If there is a better way we can control this, that'd be great. I'd love to be able to use time constraints to not show this after a certain date, for instance, but I don't think that's something we can do right now?

The splash is also set to display on any page you're at when you first load unleash. However, closing the dialog (either by closing or by asking to see segments) will store that in localstorage, and you won't be shown the dialog again.

@vercel
Copy link

vercel bot commented Oct 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 0:33am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2023 0:33am

Because this will run in OSS installations, the feature flag will
always be false (because it doesn't connect to our systems)
@thomasheartman thomasheartman changed the title [wip]: set up a splash screen ui: add splash screen for oss segments Oct 17, 2023
@thomasheartman thomasheartman marked this pull request as ready for review October 17, 2023 10:01
Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great job with this 👍

…ashScreen.tsx

Co-authored-by: Nuno Góis <github@nunogois.com>
@thomasheartman
Copy link
Contributor Author

Found a visual glitch in non-oss versions (it's in the vercel preview). Seems like the splash gets rendered initially before getting turned off. Could it be that the isOss function doesn't return the right value immediately? It might also be related to localstorage, but that's further down the road, so I'd expect it to be stopped before then 🤔

@thomasheartman
Copy link
Contributor Author

Interestingly, I'm not able to replicate it locally, so this'll be a little tricky.

@thomasheartman
Copy link
Contributor Author

thomasheartman commented Oct 18, 2023

But yeah, this line is probably why:

    const isOss = useCallback(() => {
        return !data?.versionInfo?.current?.enterprise;
    }, [data]);

So before we get data, I'm assuming we're counting everything as OSS. I wonder if that's the right approach? Probably fine 💁🏼

update:
Yeah, we have the loading prop as well, which should be helpful in this case 😄

@thomasheartman thomasheartman merged commit 8954277 into main Oct 19, 2023
14 checks passed
@thomasheartman thomasheartman deleted the feat/segments-splash-screen branch October 19, 2023 06:28
thomasheartman added a commit that referenced this pull request Oct 19, 2023
This PR adds a splash screen for segments being open-sourced.

It looks like this:

![image](https://github.com/Unleash/unleash/assets/17786332/bf8766e6-b9cc-4f0b-a6d1-f6e89e21d844)

## About the changes

I've more or less wholesale copied the demo dialog that @nunogois
implemented. I've put it in the `splash` directory for now (because
that's where it seemed most appropriate). The reason for straight
copying it instead of extending existing functionality is primarily that
this should be short-lived and deleted after the next release or so. So
isolating all the changes into a single directory seems like a good
idea.

## Discussion points

Because OSS installations don't connect to Unleash, we can't use feature
flags to control the rollout here. Instead, we must just assume that OSS
users will want to see it. If there is a better way we can control this,
that'd be great. I'd love to be able to use time constraints to not show
this after a certain date, for instance, but I don't think that's
something we can do right now?

The splash is also set to display on any page you're at when you first
load unleash. However, closing the dialog (either by closing or by
asking to see segments) will store that in localstorage, and you won't
be shown the dialog again.

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
thomasheartman added a commit that referenced this pull request Oct 19, 2023
This PR adds a splash screen for segments being open-sourced.

It looks like this:


![image](https://github.com/Unleash/unleash/assets/17786332/bf8766e6-b9cc-4f0b-a6d1-f6e89e21d844)

## About the changes

I've more or less wholesale copied the demo dialog that @nunogois
implemented. I've put it in the `splash` directory for now (because
that's where it seemed most appropriate). The reason for straight
copying it instead of extending existing functionality is primarily that
this should be short-lived and deleted after the next release or so. So
isolating all the changes into a single directory seems like a good
idea.

## Discussion points

Because OSS installations don't connect to Unleash, we can't use feature
flags to control the rollout here. Instead, we must just assume that OSS
users will want to see it. If there is a better way we can control this,
that'd be great. I'd love to be able to use time constraints to not show
this after a certain date, for instance, but I don't think that's
something we can do right now?

The splash is also set to display on any page you're at when you first
load unleash. However, closing the dialog (either by closing or by
asking to see segments) will store that in localstorage, and you won't
be shown the dialog again.

---------

Co-authored-by: Nuno Góis <github@nunogois.com>

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
thomasheartman added a commit that referenced this pull request Nov 17, 2023
This change removes the oss segments splash screen that was introduced
in #5053.
thomasheartman added a commit that referenced this pull request Nov 17, 2023
This change removes the oss segments splash screen that was introduced
in #5053.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants