Conversation
no-cache forces a conditional GET on every page load. The server sends Cache-Control: public, max-age=300, must-revalidate, so default browser caching already gives 5-min freshness, which is plenty for an announcement banner. Returning users with a dismissed banner also already short-circuit via localStorage before the fetch runs anyway. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous fallback (#3451b2, VitePress default dark blue) made black banner text unreadable if --vp-c-brand-1 ever fails to resolve. Use a fallback that matches this site's actual brand color so black text stays readable in the fallback scenario. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #111 +/- ##
=======================================
Coverage 94.08% 94.08%
=======================================
Files 26 26
Lines 4055 4055
Branches 4055 4055
=======================================
Hits 3815 3815
Misses 155 155
Partials 85 85 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Greptile SummaryTwo targeted follow-up tweaks to the banner introduced in #110: the fetch no longer overrides browser caching (letting the server's Confidence Score: 5/5Safe to merge — both changes are small, correct, and well-reasoned with no logic or security concerns. No P0 or P1 findings. The cache removal correctly defers to the server-provided Cache-Control header, and the fallback color fix improves readability. All remaining quality is P2 or better. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant Cache as Browser Cache
participant Server as jdx.dev/banner.json
participant LS as localStorage
Browser->>Cache: fetch(ENDPOINT) [default mode]
alt Cache hit (within max-age=300s)
Cache-->>Browser: Cached BannerData (no network request)
else Cache miss or expired
Cache->>Server: GET /banner.json
Server-->>Cache: 200 + Cache-Control: public, max-age=300, must-revalidate
Cache-->>Browser: BannerData
end
Browser->>LS: getItem("jdx-banner-dismissed")
alt Banner not dismissed & enabled
Browser->>Browser: render(b) — inject .jdx-banner div
Note over Browser: background: var(--vp-c-brand-1, #ff71ce)
end
Reviews (1): Last reviewed commit: "docs: fix banner fallback color to match..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request updates the banner's fallback background color to improve readability and removes the no-cache fetch configuration. Feedback suggests addressing potential contrast issues when the primary CSS variable is used and preventing duplicate banner rendering in SPA environments through a DOM check.
| justify-content: center; | ||
| padding: 0.5rem 2.75rem; | ||
| background: var(--vp-c-brand-1, #3451b2); | ||
| background: var(--vp-c-brand-1, #ff71ce); |
There was a problem hiding this comment.
While changing the fallback color to #ff71ce improves readability when the CSS variable is missing, the primary background still uses --vp-c-brand-1. In many VitePress themes, this variable defaults to a dark color (like the #3451b2 mentioned in the PR description), which will still result in unreadable black text. To fully resolve the readability issue, consider using a background color that is guaranteed to contrast with black text, or use a corresponding variable for the text color.
| export function initBanner(): void { | ||
| if (typeof window === "undefined") return; | ||
| fetch(ENDPOINT, { cache: "no-cache" }) | ||
| fetch(ENDPOINT) |
There was a problem hiding this comment.
In a Single Page Application (SPA) context like VitePress, initBanner might be called multiple times during navigation. Since the render function prepends a new element to the DOM without checking for existing ones, this could result in multiple banners being displayed. It's safer to check for an existing banner before initiating the fetch.
| fetch(ENDPOINT) | |
| if (document.querySelector(".jdx-banner")) return; | |
| fetch(ENDPOINT) |
A small patch release that fixes a panic when generating notes against releases with multi-byte characters in their bodies, and picks up a security fix in `rustls-webpki`. ## Fixed - **Don't panic on multi-byte chars in style-reference bodies** — `communique generate` truncates each recent release body to 3072 bytes to keep the prompt small, but previously sliced `&body[..3072]` directly. If byte 3072 fell inside a multi-byte UTF-8 character (common with em-dashes, which are 3 bytes), the command would panic with `byte index 3072 is not a char boundary`. The truncation now walks back to the nearest char boundary before slicing, with a regression test covering the case. ([#113](#113)) (@jdx) ## Security - **`rustls-webpki` bumped to 0.103.13** — Addresses [RUSTSEC-2026-0104](https://rustsec.org/advisories/RUSTSEC-2026-0104), a reachable panic in certificate revocation list parsing. Lockfile-only change. ([#107](#107)) (@jdx) ## Docs - Added a dismissible cross-site announcement banner and an en.dev footer to the documentation site, with follow-up polish (contrast, centering, z-index), smarter caching, and `ResizeObserver`-based height syncing so VitePress's nav offset stays correct on resize. ([#109](#109), [#110](#110), [#111](#111), [#112](#112)) (@jdx) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Follow-ups after #110 merged.
Summary
\U0001F916 Generated with Claude Code
Note
Low Risk
Low risk: only adjusts docs-site banner styling and removes a
no-cachefetch option, which may slightly change how quickly banner updates propagate but doesn’t affect core app logic.Overview
Updates the docs announcement banner to rely on default browser caching by removing
cache: "no-cache"from thefetchininitBanner().Also changes the banner background fallback color in
banner.cssto#ff71ceto keep text readable if--vp-c-brand-1isn’t defined.Reviewed by Cursor Bugbot for commit 67ff10a. Bugbot is set up for automated code reviews on this repo. Configure here.