Skip to content

fix: address CodeRabbit steward findings (#16-#18, #207-#210) - #26

Merged
kleinbem merged 2 commits into
mainfrom
fix/cr-findings-batch
Dec 4, 2026
Merged

kleinbem merged 2 commits into
mainfrom
fix/cr-findings-batch

Conversation

@kleinbem

@kleinbem kleinbem commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Addresses CodeRabbit steward findings #16, #17, #18, #207, #208, #209, #210.

Closes #22

Verified: npm run check (0 errors/warnings) and npm test (73/73 passed).

Summary by CodeRabbit

  • Bug Fixes
    • Service cards now show response times for healthy services even when recent-check history is unavailable.
    • Weather updates no longer show stale results when settings change, and snow forecasts are described more accurately.
    • Changing status or attention-feed settings now clears outdated information while new data loads.
    • Status information is less likely to be mislabelled when endpoint names overlap.

@kleinbem kleinbem added the cr-review Ask CodeRabbit to review this PR label Dec 4, 2026
@kleinbem
kleinbem enabled auto-merge (squash) December 4, 2026 10:24
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change updates dashboard data resets, Gatus status mapping, service response-time display, weather refresh handling and weather-code classification.

Changes: Dashboard updates

Layer / File(s) Summary
Configured-source resets and feed URL validation
src/routes/+page.svelte, src/lib/data/attention.ts
The page clears Gatus data and attention-feed items when their configured URLs change. Feed URLs are trimmed and rejected if they exceed 2,000 characters or fail the safety check.
Gatus mapping and service response time
src/lib/data/gatus.ts, src/lib/components/ServiceCard.svelte
Gatus endpoint keys take precedence over name aliases. The service card can show response time without history when the service is healthy.
Weather refresh and code handling
src/lib/components/WeatherWidget.svelte, src/lib/portal.ts
The weather widget clears weather when its configuration changes and ignores results from aborted requests. Weather codes 85 and 86 are classified as snow.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • kleinbem-dev/foyer#15: Adds the response-time display and Gatus snapshot code changed here.
  • kleinbem-dev/foyer#8: Defines health lookup behaviour that the Gatus alias precedence change affects.
  • kleinbem-dev/foyer#13: Introduces the runtime configuration and Gatus URL contract used by these source-change resets.
Merge Risk: Minimal · up to 995a4

This change fixes several minor dashboard display and data-reset issues. No concrete merge-blocking risk was found, and the changes are small and easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names a fix and cites the steward findings it addresses, but does not name the specific changes. The changeset covers seven findings: response-time display, Gatus alias handling, clearing re…
Linked Issues check Passed Issue #22 lists seven active MINOR findings. Each has a corresponding change in the PR summary:

- [#16] ServiceCard.svelte: the history and response-time row now shows when history exists or a health…
Out of Scope Changes check Passed Every changed file maps to one of the seven findings in #22: ServiceCard.svelte (#16), gatus.ts (#17), +page.svelte (#18), WeatherWidget.svelte (#207, #208), attention.ts (#209) and portal.ts (#210). …
Full details: Title check

Explanation

The title names a fix and cites the steward findings it addresses, but does not name the specific changes. The changeset covers seven findings: response-time display, Gatus alias handling, clearing retained data on source change, weather refresh state, feed URL preservation, and snow-shower handling. The title points to the right scope, but it does not highlight the main change, so the check is partially related.

Full details: Linked Issues check

Explanation

Issue #22 lists seven active MINOR findings. Each has a corresponding change in the PR summary:

  • [#16] ServiceCard.svelte: the history and response-time row now shows when history exists or a healthy service has a defined responseMs. The response time no longer depends on history length.
  • [#17] gatus.ts: endpoint keys and their lowercase forms are added first. Name aliases are added only when absent from statuses, so aliases no longer overwrite endpoint keys.
  • [#18] +page.svelte: when the Gatus URL changes, health statuses, details, the update timestamp and the stale flag are cleared. When the attention-feed URL changes, feed items are cleared before the polling check.
  • [#207] WeatherWidget.svelte: when config changes, the effect clears weather and sets loading to true.
  • [#208] WeatherWidget.svelte: after fetchWeather resolves, an aborted request returns without writing weather. The finally block clears loading only when the request was not aborted.
  • [#209] attention.ts: URLs are trimmed without truncation. A URL is accepted only when it is at most 2,000 characters and passes isSafePortalUrl.
  • [#210] portal.ts: weather codes 85 and 86 are classified as snow.

No non-coding requirements exist in #22. The issue sets no explicit test requirement. The evidence is the PR summary, not the full diff. The PR reports npm test at 73/73, but the summary does not list new tests. This does not block a PASS because the issue asks for behaviour changes, not tests.

Full details: Out of Scope Changes check

Explanation

Every changed file maps to one of the seven findings in #22: ServiceCard.svelte (#16), gatus.ts (#17), +page.svelte (#18), WeatherWidget.svelte (#207, #208), attention.ts (#209) and portal.ts (#210). The summary shows no unrelated behaviour changes, API declaration changes or extra features. The assessment relies on the AI-generated summary and did not inspect the full diff.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae3856c0-7982-4ae2-86ed-3b752692f3f4
Commits

Reviewing files that changed from the base of the PR and between e8b7412 and 995a498.

Files selected for processing: 6

  • src/lib/components/ServiceCard.svelte
  • src/lib/components/WeatherWidget.svelte
  • src/lib/data/attention.ts
  • src/lib/data/gatus.ts
  • src/lib/portal.ts
  • src/routes/+page.svelte

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@kleinbem-bot kleinbem-bot 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.

🔍 Revue Code Analysis (Google Gemini (Antigravity)) — kleinbem-dev/foyer #26

  • Addresses CodeRabbit steward findings across UI components (ServiceCard, WeatherWidget, +page.svelte) and data/portal helpers (attention.ts, gatus.ts, portal.ts).
  • Resets stale state on config/URL changes, guards aborted weather fetches, preserves raw URLs up to 2000 chars without whitespace collapsing, adds WMO snow codes 85/86, and prioritizes explicit Gatus endpoint keys over name aliases.

📋 Verification & Review Details
  • Repository: kleinbem-dev/foyer
  • Pull Request: #26
  • Base Branch: main
  • Source Branch: fix/cr-findings-batch
  • Target Head: 79ccc473
  • Inspected Files: 6
  • Actionable Issues Flagged: 1
  • Review Pipeline: Pass 0 (Semgrep AST) → Pass 1 (Detective) → Pass 2 (Judge)
  • Engine: Revue v0.1.0

Comment thread src/lib/data/gatus.ts Resolved

@kleinbem-bot kleinbem-bot 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.

🔍 Revue Code Analysis (Google Gemini (Antigravity)) — kleinbem-dev/foyer #26

  • Fixed ServiceCard.svelte to display healthy service response times even when check history is unavailable, and WeatherWidget.svelte / +page.svelte to reset stale state and guard against aborted requests when configuration or source URLs change.
  • Fixed attention.ts URL validation to avoid whitespace collapsing or truncation, gatus.ts to prevent name-based aliases from overwriting explicit endpoint keys, and portal.ts to map WMO codes 85 and 86 to Snow.

📋 Verification & Review Details
  • Repository: kleinbem-dev/foyer
  • Pull Request: #26
  • Base Branch: main
  • Source Branch: fix/cr-findings-batch
  • Target Head: 995a4982
  • Inspected Files: 6
  • Actionable Issues Flagged: 0
  • Review Pipeline: Pass 0 (Semgrep AST) → Pass 1 (Detective) → Pass 2 (Judge)
  • Engine: Revue v0.1.0

@kleinbem
kleinbem merged commit 08a96fe into main Dec 4, 2026
3 checks passed
@kleinbem
kleinbem deleted the fix/cr-findings-batch branch December 4, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cr-review Ask CodeRabbit to review this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CodeRabbit findings

1 participant