Skip to content

Add the line status endpoint and the site-wide status banner (W3-05) - #83

Merged
calebyhan merged 1 commit into
mainfrom
73/line-status-banner
Oct 25, 2026
Merged

calebyhan merged 1 commit into
mainfrom
73/line-status-banner

Conversation

@ahkim76

@ahkim76 ahkim76 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Every public page needs to show whether a responder is actually available, when the line next opens, and where to get immediate help. This adds the shared status banner and its API, with online status driven only by open shifts with recent heartbeats.

Changes:

  • Added GET /api/status and StatusDTO, combining responder presence, the next scheduled opening, and launch settings using one UTC timestamp. Responses include Cache-Control: public, max-age=15.
  • Added useLineStatus: fetch on mount and every 30 seconds, pause while hidden, and refresh on return. Failed or malformed responses clear previous online status; requests time out after 10 seconds, and canceled or late responses cannot restore stale status.
  • Added the banner above the public header with online, offline, pre-launch, loading, and error states; Eastern-time formatting; a Text Us link; and a 988 fallback. The skip link remains first and role="status" announces changes politely.
  • Required timezone-aware launch dates and regenerated frontend OpenAPI types. The generated file also picks up existing endpoints missing from its previous health-only version.
  • Added regression tests for heartbeat and launch boundaries, schedules and exceptions, polling, visibility changes, timeouts, malformed responses, and request cleanup.

Validation:

  • ./codex-dev make check passed: lint/format, backend and frontend type checks, 185 backend tests, 126 frontend tests, and the production build.
  • alembic upgrade head and alembic check passed; this change needs no new migration.
  • Verified the live endpoint through the frontend proxy returns HTTP 200 and the required cache header.
  • Checked the banner at 375px and 1280px with no horizontal overflow, and confirmed it persists when navigating to About.
  • All pre-commit hooks passed.

Screenshots show the live offline state with no configured upcoming opening:

Mobile, 375px Desktop, 1280px
Mobile status banner Desktop status banner

Closes #73

@github-actions

Copy link
Copy Markdown

Backend Test Results

185 tests  +14   185 ✅ +14   1s ⏱️ ±0s
  1 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit 5c2f7e3. ± Comparison against base commit a18ee26.

@calebyhan calebyhan 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.

LGTM

@calebyhan
calebyhan merged commit 44e6060 into main Oct 25, 2026
4 checks passed
@calebyhan
calebyhan deleted the 73/line-status-banner branch October 25, 2026 05:33
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.

Add the line status endpoint and the site-wide status banner (W3-05)

2 participants