Skip to content

fix(announcements): pop the full-screen announcement from unread state, not a per-browser watermark - #1285

Open
JamieRuderman wants to merge 10 commits into
mainfrom
fix/announcement-popup-unread
Open

JamieRuderman wants to merge 10 commits into
mainfrom
fix/announcement-popup-unread

Conversation

@JamieRuderman

@JamieRuderman JamieRuderman commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Problem

The full-screen announcement popup was gated by a presentedThrough watermark stored in the persisted announcements slice. That slice is shared by every account on a browser, and switching saved accounts reloads without purging it. So once one account saw a notice, every other account on that browser skipped it, even though their per-account read state said unread. A fresh sign-in also seeded the watermark to "now", which suppressed any notice published before that sign-in.

Seen in practice: a notice published as jamie@remote.it never popped for a test account signed in afterwards on the same browser.

Change

The popup is now driven by per-account unread state from the API.

  • Eligibility: only the newest non-banner notice can pop, and only while it is unread and was saved on or after 2026-07-20, the date the full-screen popup was introduced (Add full-screen announcement presentation #1129). Older notices stay in the list but never pop, so nobody is walked through a backlog.

  • Fresh data only: the dialog waits for this session's notices fetch, tracked by a non-persisted ui.announcementsFetched flag. Before that, the persisted list may belong to the previous account.

  • No reopen: the dialog remembers the notice it presented, so a failed read call cannot reopen it the moment it closes. A newer notice published mid-session still pops on the next fetch.

  • Stale responses: a notices response that lands after its account signed out is dropped.

  • Chat popout: the dialog no longer mounts in the popout window, which previously relied on the watermark to stay quiet.

  • The watermark, its reducers, and its reset in "Clear viewed announcements" are removed.

  • Start date is the announcement's date: the popup, the choice of newest notice, the list order and the card's date all use the notice's From date, falling back to the last save while it's blank. Editing a notice no longer moves its date or re-announces it.

  • Admin form fills it in: a blank From is filled on save. Enabling a notice sets it to now. Saving a notice that was already enabled sets it to that notice's last save before this one, so editing it doesn't re-announce it. Drafts stay blank until they're enabled.

No backfill

Existing notices keep a blank From, and the app falls back to their last save, which hasn't moved. Each one gets its real date the first time it's edited through the admin form. A bulk update through updateNotice would have reset every notice's modified, which released app versions still use for the card date and the popup.

Behavior to know

  • A notice that is never marked read pops again on the next launch, for example after quitting with the popup open.

Testing

  • New tests for the selector, the dialog and the model fetch guard. Guard tests were checked to fail with the guard removed.
  • npm test -w=frontend and npm run typecheck pass.

@JamieRuderman

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T22:07:08.041965Z b55ad8e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@aws-amplify-us-west-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1285.d20k671nqqv4kl.amplifyapp.com

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: df3fb3d7b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@JamieRuderman

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08026ea8f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Marking it read still happens on dismiss to clear the navigation badge.
announcements.setPresentedThrough(latestUnread.modified?.getTime() || 0)
}, [activeId, announcements, dismissedIds, latestUnread?.id, presentedThrough])
setPresentedId(presentable.id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retain every presented announcement ID

When notice A has been presented but its read request fails, presenting a newer notice B overwrites this sole guard. If B is later omitted by a refresh—for example because it expires, is disabled, or is deleted—selectPresentableAnnouncement selects unread A again and the dialog reopens it during the same session. Preserve all IDs presented during the mount rather than only the most recent one.

Useful? React with 👍 / 👎.

@JamieRuderman

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: b5eaa547db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@JamieRuderman

Copy link
Copy Markdown
Member Author

@codex review

… its start is blank, so no backfill is needed
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 41cac3ace2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@JamieRuderman

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c82d81daea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Marking it read still happens on dismiss to clear the navigation badge.
announcements.setPresentedThrough(latestUnread.modified?.getTime() || 0)
}, [activeId, announcements, dismissedIds, latestUnread?.id, presentedThrough])
setPresentedIds(ids => [...ids, presentable.id])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Record test previews in the presented-ID guard

When “Show latest announcement” previews an unread notice that has not already been auto-presented in this mount, only the normal presentation path adds its ID here. Closing the test dialog deliberately skips announcements.read, then handleExited clears activeId, so this effect immediately opens the same notice again as a normal announcement; closing that second dialog marks it read, contrary to the test control’s promise not to change read status. Add test-presented IDs to the same guard (as the removed dismissedIds update did).

Useful? React with 👍 / 👎.

@JamieRuderman

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: b55ad8e26a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
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.

1 participant