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

chore: rotate model hub banner on app launch until set #4542

Merged

Conversation

louis-menlo
Copy link
Contributor

Describe Your Changes

As designed, users will see a different Model Hub banner every time they reopen the app if they haven't set any banner. This PR is for that.

  1. Users have not changed the banner hub -> Set a random hub image from the default list when the app is opened using Atom Storage and a bridge ReadOnly Atom.
  2. As soon as users set a banner hub image, WriteOnly Atom writes this setting into Atom Storage. From then on, it returns the latest banner hub image.

Fixes Issues

Self Checklist

This pull request introduces changes to the web/helpers/atoms/App.atom.ts and web/screens/Hub/index.tsx files to enhance the management of the app banner hub settings. The most important changes include renaming and refactoring atoms for better clarity, adding new atoms for retrieving and setting the banner, and updating the Hub screen to use these new atoms.

Refactoring and renaming atoms:

  • web/helpers/atoms/App.atom.ts: Renamed appBannerHubAtom to appBannerHubStorageAtom and changed its type to string | undefined. Added new atoms getAppBannerHubAtom for retrieving the banner and setAppBannerHubAtom for setting the banner.

Updating imports and usage in Hub screen:

  • web/screens/Hub/index.tsx: Updated imports to use the new atoms getAppBannerHubAtom and setAppBannerHubAtom instead of appBannerHubAtom.
  • web/screens/Hub/index.tsx: Modified the HubScreen component to use useAtomValue for getAppBannerHubAtom and useSetAtom for setAppBannerHubAtom.

Additional import adjustments:

@github-actions github-actions bot added the type: chore Maintenance, operational label Jan 29, 2025
@louis-menlo louis-menlo requested a review from urmauur January 29, 2025 16:03
Copy link
Contributor

Barecheck - Code coverage report

Total: 67.61%

Your code coverage diff: -0.01% ▾

Uncovered files and lines
FileLines
web/helpers/atoms/App.atom.ts50, 58

@louis-menlo louis-menlo merged commit f071497 into dev Jan 29, 2025
16 checks passed
@louis-menlo louis-menlo deleted the chore/rotate-model-hub-banner-on-app-launch-until-set branch January 29, 2025 16:12
@github-actions github-actions bot added this to the v0.5.15 milestone Jan 29, 2025
Copy link
Contributor

This is the build for this pull request. You can download it from the Artifacts section here: Build URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore Maintenance, operational
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: New Jan Hub UI
2 participants