Skip to content

Load documentation notices from OneUptime - #126

Merged
ClintonChe merged 2 commits into
mainfrom
issues/91-oneuptime-docs-notices
Oct 14, 2026
Merged

ClintonChe merged 2 commits into
mainfrom
issues/91-oneuptime-docs-notices

Conversation

@ClintonChe

Copy link
Copy Markdown
Collaborator

What changed

  • Load active service announcements from the public OneUptime overview API in the browser.
  • Cache successful and failed results once per browser tab session.
  • Treat a successful empty response as authoritative while retaining the local notice when OneUptime is unreachable or invalid.
  • Reevaluate announcement expiry against the visitor clock and safely handle unavailable browser storage.
  • Show English-only announcement titles with lang="en" on French pages while keeping French labels and controls.
  • Add focused parsing, caching, expiry, storage, and browser-rendering tests and run them in CI.

Why

This removes the need to publish the same service notice in OneUptime and deploy a matching documentation change.

Related to https://github.com/zsoftly/zcp-website/issues/91

Verification

  • OneUptime notice tests: 13 passed
  • Reported-link regression tests: 10 passed
  • AI-readable tests: 7 passed
  • ESLint: passed
  • TypeScript typecheck: passed
  • Changed-file Prettier check: passed
  • git diff --check: passed
  • Final code and context reviews: clean

The repository-wide formatter still reports four unrelated existing documentation files. The full build completes browser rendering, route generation, optimized images, and AI-readable generation before the link validator reports 66 existing invalid links across 33 unrelated files.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e9f120d2-3844-4474-9f68-69222129964a
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@godsonten godsonten left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If the browser blocks session storage and there are two active announcements, dismissing the notice hides it at first. When the other announcement expires, the page refreshes the notice bar and shows the same dismissed notice again, without the user reloading or leaving the page. Please make sure the notice stays dismissed in this situation.

@ClintonChe

Copy link
Copy Markdown
Collaborator Author

Resolved the blocked sessionStorage dismissal issue. The review claim was valid: timer-driven rerenders could show the same dismissed announcement again when storage was unavailable. The fix now retains the dismissed announcement ID in memory for the current page while preserving normal sessionStorage persistence. Added regression coverage for the two-active-announcement expiry scenario; all 14 notice tests pass.

@ClintonChe
ClintonChe merged commit ae7d032 into main Oct 14, 2026
5 checks passed
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.

2 participants