Skip to content

feat(github-status): add GitHub status indicator with resolved state support#18

Merged
cheefbird merged 24 commits into
mainfrom
feature/github-status-indicator
Mar 14, 2026
Merged

feat(github-status): add GitHub status indicator with resolved state support#18
cheefbird merged 24 commits into
mainfrom
feature/github-status-indicator

Conversation

@cheefbird
Copy link
Copy Markdown
Owner

@cheefbird cheefbird commented Mar 14, 2026

Context

GitHub's status page API exposes incident data but there's no native in-page indicator when things are broken.

This feature gives users immediate visibility into GitHub outages while they're browsing, without needing to check
githubstatus.com separately.

The content script match pattern was widened from */actions* to */* so the status banner renders on all GitHub pages, not just Actions.

Changes Made

Data layer

src/lib/github-status.ts

  • Types for incidents, components, indicators, and status storage
  • transformSummary validates and normalizes the raw API response
  • fetchGitHubStatus with discriminated union result type
  • Storage items for status data, poll interval, enabled, and collapsed state
  • Helper utils: timeSince, indicatorColor, componentStatusColor, RESOLVED_COLOR

Background polling

src/entrypoints/background.ts

  • Alarm-based polling with configurable interval (default 15 min)
  • Reacts to enabled/interval storage changes in real time
  • Auto-clears collapsed state when incidents resolve

UI components

  • StatusBannerHost — reactive wrapper that hydrates from storage and watches for changes
  • StatusBanner — main banner with severity derivation, affected component summary, and dismiss/expand
  • StatusPopover — details dropdown with per-incident component breakdown and external links
  • StatusStrip — collapsed pill view with expand affordance
  • Resolved state: green accent color, filtered severity calc, three-tier timestamp fallback

Options page

src/entrypoints/options/App.svelte

  • Enable/disable toggle and poll interval select for status notifications
  • Token help section collapsed behind a "Learn more" toggle

Housekeeping

  • Removed unused SVGs (wxt.svg, svelte.svg)
  • Biome config: added line width, HTML formatter
  • Added biocheck script, .git-blame-ignore-revs entry for formatting commit
  • Content script match pattern widened to *://github.com/*
  • Added alarms permission to manifest

Tests

src/lib/github-status.test.ts

  • Full coverage for transformSummary: valid statuses, edge cases, nulls, unknowns, resolved_at handling
  • fetchGitHubStatus: network errors, API errors, parse errors, resolved incident flow, URL verification

Testing Notes

  • pnpm test — all 19 tests pass
  • pnpm build — production build succeeds
  • Manual: load unpacked extension, verify banner appears during active incidents
  • Manual: verify dismiss -> collapsed strip -> expand flow
  • Manual: verify options page toggle and interval changes take effect immediately
  • Manual: verify resolved incidents show green accent and "Resolved" label
  • Edge case: signed-out GitHub pages (no auth header in status API call)

- Adds types, storage definitions, API fetch/transform for stauspage api
- alarm-based background polling with configurable options
- StatusBanner with state machine and severity-based colors
- StatusStrip as collapsed 3px severity bar with expand affordance
- StatusPopover with per-incident detail view, click-outside/Escape dismiss
- Content script match pattern expanded to all GitHub pages
- Status indicator feature init with storage watchers and context cleanup
- fix collapse/expand by managing dismissed state locally in StatusBanner
- fix header selector for current GitHub markup
- collapsed strip uses banner bg colors, centered "Incident" label
- options page: transparent bg, collapsible token help section
- add header.HeaderMktg selector for signed-out GitHub pages
- guard dismissed IDs with Array.isArray to handle unexpected storage values
- use Set for dismissed lookup instead of .includes()
…banner

- collapsed boolean replaces dismissed incident ID tracking
- kill pruneDismissedIncidents and its tests
- background clears collapsed when incidents resolve
- banner is now drawer card with accent bar, severity dot, pill button, X
- popover anchors near the Details button not the page edge
… styles

- move all status components from inline styles to blocks and directives
- collapsed indicator now a centered pill with dot, label, and chevron-down
- details popover right-aligned off the button instead of left
- rename .label to .pill-text to dodge Primer CSS collision
- watch collapsedStorage in content script for cross-tab sync
- catch unhandled promise rejections in background service worker
- derive banner subtitle from actual incident status instead of hardcoding
- separate fetch/parse try-catch blocks and add "parse-error" result reason
- validate API values against typed Sets instead of blind as casts
- sanitize poll interval before passing to browser.alarms
- revert UI state on storage write failures in StatusBanner and options
- surface status settings load errors to user instead of swallowing
…overage

- extract shared color functions
- differentiate component status colors from indicator severity colors
- remove unused StoredStatus wrapper, store GitHubStatusData directly
- guard against duplicate containers on content script re-injection
- guard timeSince against NaN/negative values
- immediate re-poll when interval changes
- add 11 tests
- add StatusBannerHost.svelte to own $state and storage subscriptions
- make StatusBanner pure presentational with callback props
- add error logging to hydration and storage write catch handlers
- add resolved incident display with green accent via --fgColor-success
- banner prioritizes active incidents, falls back to resolved state
- strip accepts resolved prop for green dot and "Resolved" label
- popover shows per-incident resolved timestamp with fallback chain
- replace hardcoded dark-mode hex with Primer CSS custom properties
- use Primer button tokens for Details button styling
@cheefbird cheefbird merged commit e4c3d94 into main Mar 14, 2026
7 checks passed
@cheefbird cheefbird deleted the feature/github-status-indicator branch March 14, 2026 22:38
@cheefbird cheefbird restored the feature/github-status-indicator branch March 14, 2026 22:58
@cheefbird cheefbird deleted the feature/github-status-indicator branch March 28, 2026 01:45
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