Skip to content

Add announcement banner system to home page#1901

Merged
Mbeaulne merged 1 commit intomasterfrom
03-05-add_announcment_banner_to_tangle_homepage
Mar 5, 2026
Merged

Add announcement banner system to home page#1901
Mbeaulne merged 1 commit intomasterfrom
03-05-add_announcment_banner_to_tangle_homepage

Conversation

@Mbeaulne
Copy link
Collaborator

@Mbeaulne Mbeaulne commented Mar 5, 2026

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 AnnouncementBanners component that renders announcements using the existing InfoBox component. Currently displays a warning about upcoming GPU quota enforcement for Tangle workloads.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

image.png

Test Instructions

  1. Navigate to the home page
  2. Verify that the GPU quota enforcement announcement banner appears at the top of the page
  3. Confirm the banner displays with a warning variant styling
  4. Test that the page functions normally with the banner present
  5. Verify that removing all announcements from the config file hides the banner component

Additional Comments

The announcement system is designed to be easily configurable through the src/config/announcements.ts file. New announcements can be added by updating the array with the required id, title, body, and optional variant properties. The configuration file has been added to the knip ignore list to prevent unused export warnings when no announcements are active.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

🎩 To tophat this PR:

You can add the following URL parameter to your browser to tophat this PR:

`?tophat_location=03-05-add_announcment_banner_to_tangle_homepage/6e65be0`

Copy link
Collaborator Author

Mbeaulne commented Mar 5, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Mbeaulne Mbeaulne changed the title Add announcment banner to tangle homepage Add announcement banner system to home page Mar 5, 2026
@Mbeaulne Mbeaulne marked this pull request as ready for review March 5, 2026 15:21
@Mbeaulne Mbeaulne requested a review from a team as a code owner March 5, 2026 15:21
@Mbeaulne Mbeaulne force-pushed the 03-05-add_announcment_banner_to_tangle_homepage branch 3 times, most recently from 0113e28 to a13639f Compare March 5, 2026 16:13
maxy-shpfy
maxy-shpfy previously approved these changes Mar 5, 2026
Comment on lines +9 to +15
function getDismissedIds(): string[] {
try {
return JSON.parse(localStorage.getItem(DISMISSED_KEY) ?? "[]");
} catch {
return [];
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use typedStorage for access to localStorage

Comment on lines +31 to +35
const handleDismiss = (id: string) => {
const updated = [...dismissedIds, id];
localStorage.setItem(DISMISSED_KEY, JSON.stringify(updated));
setDismissedIds(updated);
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use typedStorage to access localStorage. This should be abstracted into hook or smth

Comment on lines +45 to +49
onDismiss={
announcement.dismissible
? () => handleDismiss(announcement.id)
: undefined
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: extract handle as function

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add to react-compiler

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just thinking outloud. Maybe we can use it as "json" similar to other files in config?

Copy link
Collaborator

Choose a reason for hiding this comment

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

json would make sense to me - like the launcher annotation schema.

Copy link
Collaborator

Choose a reason for hiding this comment

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

would allow us to also put it in the shopify-overlay and thus do shopify-specific announcements

@maxy-shpfy maxy-shpfy dismissed their stale review March 5, 2026 17:06

add comment

Copy link
Collaborator

@maxy-shpfy maxy-shpfy left a comment

Choose a reason for hiding this comment

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

LGTM! Left some suggestions - would be nice to have it implemented before merge

@Mbeaulne Mbeaulne force-pushed the 03-05-add_announcment_banner_to_tangle_homepage branch from a13639f to 32370db Compare March 5, 2026 17:39
<InfoBox
key={announcement.id}
title={announcement.title}
variant={announcement.variant ?? "warning"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

announcements are informative - would info variant be a better default?

@Mbeaulne Mbeaulne force-pushed the 03-05-add_announcment_banner_to_tangle_homepage branch from 32370db to e594a86 Compare March 5, 2026 17:44
Comment on lines +43 to +46
{visible.map((announcement) => {
const onDismiss = announcement.dismissible
? () => handleDismiss(announcement.id)
: undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

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?

@Mbeaulne Mbeaulne force-pushed the 03-05-add_announcment_banner_to_tangle_homepage branch 2 times, most recently from e3ea61f to 1a75c52 Compare March 5, 2026 17:51
Copy link
Collaborator Author

Mbeaulne commented Mar 5, 2026

Merge activity

  • Mar 5, 6:00 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 5, 6:01 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 5, 6:05 PM UTC: Graphite couldn't merge this PR because it had merge conflicts.
  • Mar 5, 9:52 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 5, 9:52 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 5, 9:54 PM UTC: @Mbeaulne merged this pull request with Graphite.

@Mbeaulne Mbeaulne force-pushed the 03-05-add_announcment_banner_to_tangle_homepage branch from 1a75c52 to 1a7fc4d Compare March 5, 2026 18:00
{
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.",

Choose a reason for hiding this comment

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

This is a Shopify-specific problem and shouldn't belong in our OSS :thinking_face:

Choose a reason for hiding this comment

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

Let's build an API to pull announcements from the backend instead?

Choose a reason for hiding this comment

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

For a faster turn around, you can have it read from the window and we can add to index.html in oasis-frontend.

@Mbeaulne Mbeaulne force-pushed the 03-05-add_announcment_banner_to_tangle_homepage branch 2 times, most recently from a5fb570 to b3709c7 Compare March 5, 2026 21:38
@Mbeaulne Mbeaulne force-pushed the 03-05-add_announcment_banner_to_tangle_homepage branch from b3709c7 to d9fbdd8 Compare March 5, 2026 21:41
@Mbeaulne Mbeaulne force-pushed the 03-05-add_announcment_banner_to_tangle_homepage branch from d9fbdd8 to 6e65be0 Compare March 5, 2026 21:52
@Mbeaulne Mbeaulne merged commit 7148ec9 into master Mar 5, 2026
17 checks passed
@Mbeaulne Mbeaulne deleted the 03-05-add_announcment_banner_to_tangle_homepage branch March 5, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants