Add announcement banner system to home page#1901
Conversation
🎩 To tophat this PR:You can add the following URL parameter to your browser to tophat this PR: |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
0113e28 to
a13639f
Compare
| function getDismissedIds(): string[] { | ||
| try { | ||
| return JSON.parse(localStorage.getItem(DISMISSED_KEY) ?? "[]"); | ||
| } catch { | ||
| return []; | ||
| } | ||
| } |
There was a problem hiding this comment.
Please use typedStorage for access to localStorage
| const handleDismiss = (id: string) => { | ||
| const updated = [...dismissedIds, id]; | ||
| localStorage.setItem(DISMISSED_KEY, JSON.stringify(updated)); | ||
| setDismissedIds(updated); | ||
| }; |
There was a problem hiding this comment.
Use typedStorage to access localStorage. This should be abstracted into hook or smth
| onDismiss={ | ||
| announcement.dismissible | ||
| ? () => handleDismiss(announcement.id) | ||
| : undefined | ||
| } |
There was a problem hiding this comment.
NIT: extract handle as function
There was a problem hiding this comment.
Just thinking outloud. Maybe we can use it as "json" similar to other files in config?
There was a problem hiding this comment.
json would make sense to me - like the launcher annotation schema.
There was a problem hiding this comment.
would allow us to also put it in the shopify-overlay and thus do shopify-specific announcements
maxy-shpfy
left a comment
There was a problem hiding this comment.
LGTM! Left some suggestions - would be nice to have it implemented before merge
a13639f to
32370db
Compare
| <InfoBox | ||
| key={announcement.id} | ||
| title={announcement.title} | ||
| variant={announcement.variant ?? "warning"} |
There was a problem hiding this comment.
announcements are informative - would info variant be a better default?
32370db to
e594a86
Compare
| {visible.map((announcement) => { | ||
| const onDismiss = announcement.dismissible | ||
| ? () => handleDismiss(announcement.id) | ||
| : undefined; |
There was a problem hiding this comment.
Announcement expiry date is optional. It's entirely possible we forget to set them and thus we could end up with many announcements at the same time, all the way down the page.
Do we want to limit the number of announcements we show at once? Or maybe put them all into a carousal system within the banner?
e3ea61f to
1a75c52
Compare
Merge activity
|
1a75c52 to
1a7fc4d
Compare
src/config/announcements.ts
Outdated
| { | ||
| id: "gpu-quota-enforcement-march-2026", | ||
| title: "Upcoming: GPU Quota Enforcement for Tangle Workloads", | ||
| body: "GPU workloads will soon require registered project quotas. Please ensure your quota groups are configured before enforcement begins. For any questions, reach out in the #tangle Slack channel.", |
There was a problem hiding this comment.
This is a Shopify-specific problem and shouldn't belong in our OSS :thinking_face:
There was a problem hiding this comment.
Let's build an API to pull announcements from the backend instead?
There was a problem hiding this comment.
For a faster turn around, you can have it read from the window and we can add to index.html in oasis-frontend.
a5fb570 to
b3709c7
Compare
b3709c7 to
d9fbdd8
Compare
d9fbdd8 to
6e65be0
Compare

Description
Added an announcement banner system to display important notifications to users on the home page. The system includes a configurable announcements configuration file and a reusable
AnnouncementBannerscomponent that renders announcements using the existingInfoBoxcomponent. Currently displays a warning about upcoming GPU quota enforcement for Tangle workloads.Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
Test Instructions
Additional Comments
The announcement system is designed to be easily configurable through the
src/config/announcements.tsfile. New announcements can be added by updating the array with the requiredid,title,body, and optionalvariantproperties. The configuration file has been added to the knip ignore list to prevent unused export warnings when no announcements are active.