Skip to content

feat(updates): add passive release update indicator - #845

Merged
mcharles-square merged 8 commits into
mainfrom
codex/release-updates-05-notification
Aug 3, 2026
Merged

feat(updates): add passive release update indicator#845
mcharles-square merged 8 commits into
mainfrom
codex/release-updates-05-notification

Conversation

@mcharles-square

@mcharles-square mcharles-square commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Reviewable diff: +208/-57 across 6 files (excludes generated, test, and story files).

Summary

Adds a passive Update available pill to eligible Proto Fleet headers. Permission holders can use it to open /settings/updates, which remains the authoritative place for release details and the install command. Because update discovery is useful but not operationally critical, fullscreen and other headerless routes intentionally do not poll or render the indicator.

Stack: #841, #842, #843, and #844 are merged; this PR is 5/5 of phase one and its diff is relative to main. It relies on those PRs for release discovery, the instance:update permission, update-status RPC, and authoritative Settings workflow. Privileged host execution and true one-click upgrade remain out of scope here and are stacked in #835#836#837#838#839#840.

How it works

On a route with the normal Fleet header, an authenticated instance:update holder polls status every 15 minutes and retains only the eligible version. An available version renders a compact header pill; activating it navigates to Settings, where status is fetched independently before any release notes or install command are shown. Hiding the shell header or entering the Updates page disables the indicator poll, and background failures simply hide stale indicator text without mutating global auth or permissions.

Diagrams

flowchart LR
  A["Eligible Fleet header route"] --> B["Permission-gated version poll"]
  B --> C["Passive update pill"]
  C -->|"Open"| D["Settings > Updates"]
  D --> E["Fresh authoritative status"]
  E --> F["Release details and install command"]
Loading

Areas of the code involved

Area / package / file What changed Why it matters for review
features/updates/api/useAvailableUpdate.ts Adds the permission-gated, version-only poll Establishes the security and freshness boundary
features/updates/useUpdateIndicator.ts Maps availability to Settings navigation Keeps actionable update data out of shell state
components/AppLayout Owns polling only while the shell header is eligible Defines route coverage without a global lifecycle owner
components/PageHeader Renders the pill in responsive widget layouts Integrates the indicator with existing header controls
docs/plans/...release-update-notifications-plan.md Narrows the product contract and records review guidance Makes the intentional scope and trade-offs explicit
Tests and story Cover gating, polling, navigation, header visibility, and layouts Regression coverage — implementation can be skimmed

Key technical decisions & trade-offs

  • Keep Settings authoritative; the shell retains only a version and never an install command or release notes.
  • Scope discovery to routes with the normal Fleet header instead of adding a global owner for a non-critical notification.
  • Disable the background poll on /settings/updates so the actionable page owns its status while mounted.
  • Accept eventual cross-tab convergence through polling; stale passive text cannot initiate an upgrade, so cross-tab messaging is disproportionate.
  • Keep background failures silent and local; the passive poll cannot log a user out or alter permissions.
  • Treat automated findings as advisory and assess realistic impact, existing safeguards, feature scope, and added complexity before accepting them.

Testing & validation

  • npm run test -- --run across the update hooks, AppLayout, PageHeader, Settings Updates, and App: 62 passed, 3 skipped.
  • npm exec --no -- tsc --noEmit.
  • npm run lint.
  • git diff --check and pre-push client typecheck.

@github-actions github-actions Bot added javascript Pull requests that update javascript code client labels Jul 30, 2026
@github-actions github-actions Bot added the review-policy: needs-review Managed by the Review Policy workflow. label Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated security-focused code review generated by Codex.
It should be used as a supplementary check alongside human review.
False positives are possible - use your judgment.

Scope summary

  • Reviewed pull request diff only (92fb0fc9b7fc627f2875f69fdd50fff689990c99...1b48092c090cc7469ecbd801a75a69ffdcedf0dc, exact PR three-dot diff)
  • Model: gpt-5.5

💡 Click "edited" above to see previous reviews for this PR.


Review Summary

Overall Risk: NONE

Findings

No security, correctness, or reliability findings were identified in the reviewed diff.

Notes

Reviewed .git/codex-review.diff as the authoritative scope. The new update indicator is permission-gated, bounded to a 15-minute poll cadence, stores only the available version, and routes to the existing authoritative settings page for update actions. No changed hunk introduced command execution, pool configuration changes, auth bypass, unbounded polling, XSS-relevant rendering, or protobuf wire-format risk.


Generated by Codex Security Review |
Triggered by: @mcharles-square |
Review workflow run

Copilot AI review requested due to automatic review settings August 1, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a proactive release-update notification UX to Proto Fleet, backed by a permission-aware update-status poller, and extends the shared toaster system to support persistent, clickable “info” toasts.

Changes:

  • Added useUpdateStatus polling (15 min) for instance:update permission holders and a new useUpdateNotification hook to drive a persistent toast + dismissible header pill.
  • Introduced info toast status and onClick support in the shared toaster/Toast UI, including a clickable toast body.
  • Added an Update Notification modal for the manual update command + release notes, wired globally via AppLayout and PageHeader.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
client/src/shared/features/toaster/types.ts Adds optional onClick callback to toast type/props.
client/src/shared/features/toaster/constants.ts Adds info status to toaster status set.
client/src/shared/features/toaster/components/Toaster/Toaster.tsx Renders info toasts as “basic” toasts and passes onClick through to Toast.
client/src/shared/features/toaster/components/Toaster/Toaster.stories.tsx Adds Storybook example for persistent clickable “update available” toast.
client/src/shared/features/toaster/components/Toast/Toast.tsx Adds Info icon rendering and clickable toast-body button support.
client/src/shared/features/toaster/components/Toast/Toast.test.tsx Tests clickable informational toast body behavior.
client/src/protoOS/features/settings/components/MiningPools/constants.ts Adds STATUSES.info label mapping (“Notice”).
client/src/protoFleet/features/updates/useUpdateNotification.ts New notification lifecycle hook (toast, dismissal storage, header pill, modal open/close).
client/src/protoFleet/features/updates/useUpdateNotification.test.tsx Tests notification toast/pill/modal behavior and dismissal semantics.
client/src/protoFleet/features/updates/constants.ts Adds localStorage key constant for dismissed update tag.
client/src/protoFleet/features/updates/components/UpdateNotificationModal.tsx New modal rendering install command + release notes link.
client/src/protoFleet/features/updates/components/UpdateNotificationModal.stories.tsx Storybook story for the update notification modal.
client/src/protoFleet/features/updates/api/useUpdateStatus.ts New permission-aware polling hook with deduping to avoid unnecessary rerenders.
client/src/protoFleet/features/settings/components/Updates.test.tsx Switches dismissed-tag key to shared constant import.
client/src/protoFleet/components/PageHeader/PageHeader.tsx Adds update pill widget support and positioning in header widgets.
client/src/protoFleet/components/PageHeader/PageHeader.test.tsx Adds test asserting update pill placement relative to “Continue setup”.
client/src/protoFleet/components/PageHeader/PageHeader.stories.tsx Adds story demonstrating update pill alongside setup pill state.
client/src/protoFleet/components/PageHeader/headerWidgetLayout.ts Includes update pill in phone header widget count/stacking logic.
client/src/protoFleet/components/NavigationMenu/NavigationMenu.stories.tsx Adds permission seeding + baseline reset for deterministic nav rendering in stories.
client/src/protoFleet/components/AppLayout/AppLayout.tsx Globally mounts update notification modal and plumbs header pill data.
client/src/protoFleet/components/AppLayout/AppLayout.test.tsx Mocks update notification hook/modal and tests phone offset calculation with update pill.

Comment thread client/src/shared/features/toaster/components/Toast/Toast.tsx Outdated
Comment thread client/src/protoFleet/components/NavigationMenu/NavigationMenu.stories.tsx Outdated

@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: edfbec4104

ℹ️ 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".

Comment thread client/src/protoFleet/features/updates/api/useUpdateStatus.ts Outdated
Comment thread client/src/protoFleet/features/updates/api/useUpdateStatus.ts Outdated

@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: 8c41aebb74

ℹ️ 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".

Comment thread client/src/protoFleet/components/AppLayout/AppLayout.tsx Outdated

@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: 8a73f552a1

ℹ️ 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".

Comment thread client/src/protoFleet/api/updateStatusEvents.ts Outdated
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 3, 2026
@mcharles-square mcharles-square changed the title feat(updates): add release update notification feat(updates): add passive release update indicator Aug 3, 2026

@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: 584cc8fc2d

ℹ️ 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".

Comment thread client/src/protoFleet/features/updates/api/useAvailableUpdate.ts Outdated
@mcharles-square
mcharles-square force-pushed the codex/release-updates-05-notification branch from 584cc8f to ad58b4a Compare August 3, 2026 12:40

@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: ad58b4a682

ℹ️ 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".

Comment thread client/src/protoFleet/features/updates/useUpdateIndicator.ts Outdated
@mcharles-square
mcharles-square force-pushed the codex/release-updates-05-notification branch from 3e78949 to 54d2f82 Compare August 3, 2026 13:08
Comment thread client/src/protoFleet/features/updates/api/useAvailableUpdate.ts
Comment thread client/src/protoFleet/components/AppLayout/AppLayout.test.tsx Outdated
@github-actions github-actions Bot added review-policy: human-approved Managed by the Review Policy workflow. review-policy: needs-review Managed by the Review Policy workflow. and removed review-policy: needs-review Managed by the Review Policy workflow. review-policy: human-approved Managed by the Review Policy workflow. labels Aug 3, 2026

@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: 5c1133b2a9

ℹ️ 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".

Comment thread client/src/protoFleet/features/updates/useUpdateIndicator.ts Outdated
@mcharles-square
mcharles-square force-pushed the codex/release-updates-05-notification branch from 8498340 to 1b48092 Compare August 3, 2026 15:49
@mcharles-square
mcharles-square merged commit 4039274 into main Aug 3, 2026
69 checks passed
@mcharles-square
mcharles-square deleted the codex/release-updates-05-notification branch August 3, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client documentation Improvements or additions to documentation javascript Pull requests that update javascript code review-policy: needs-review Managed by the Review Policy workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants