Conversation
The banner.json endpoint now includes an optional ISO-8601 `expires` timestamp so announcements can auto-hide without a code change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Greptile SummaryThis PR adds support for an optional Confidence Score: 5/5Safe to merge — single-file, additive change with correct fallback behavior and no breaking changes. No P0 or P1 findings. The logic is correct: NaN guard prevents accidental banner suppression on invalid dates, absence of the field preserves existing behavior, and the check ordering in the flow is appropriate. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[fetch banner.json] --> B{r.ok?}
B -- No --> Z[silent catch / no-op]
B -- Yes --> C{b.enabled?}
C -- No --> Z
C -- Yes --> D{isExpired?}
D -- "expires absent → false" --> E
D -- "invalid date → false" --> E
D -- "Date.now() >= t → true" --> Z
D -- "Date.now() < t → false" --> E{dismissed in localStorage?}
E -- Yes --> Z
E -- No --> F[render banner]
Reviews (1): Last reviewed commit: "docs: respect banner expires field" | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
=======================================
Coverage 79.03% 79.03%
=======================================
Files 48 48
Lines 7235 7235
Branches 7235 7235
=======================================
Hits 5718 5718
Misses 1140 1140
Partials 377 377 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
expires(ISO-8601) field in jdx.dev/banner.jsonDate.now() >= Date.parse(expires)expiresis absent (preserves existing behavior)Test plan
expiresin the past → banner hiddenexpiresin the future → banner shownexpiresfield → banner shown as before🤖 Generated with Claude Code
Note
Low Risk
Low risk: small, client-side docs banner change that only gates rendering based on an optional timestamp; no auth or data writes beyond existing localStorage usage.
Overview
Adds support for an optional
expiresfield inbanner.jsonso the docs site announcement banner will not render once the timestamp has passed.Introduces
isExpired()to safely parse the date (treating missing/invalid values as non-expired) and checks it duringinitBanner()before callingrender().Reviewed by Cursor Bugbot for commit b64256d. Bugbot is set up for automated code reviews on this repo. Configure here.