diff --git a/README.md b/README.md index af17d30..af2d6db 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ That quits `CodexToolbar` if it is running, removes its launch-at-login registra ## Screenshots -Captured from v0.1.18 with fixed sample values. The default examples show a Weekly Codex window; the optional Spark example adds separately labeled 5h and Weekly windows. Available windows depend on what Codex reports for your account. The website uses the same Weekly projection screenshots. +Captured from v0.1.18 with fixed sample values. The default examples show a Weekly Codex window; the optional Spark example adds separately labeled 5h and Weekly windows. Available windows depend on what Codex reports for your account. The website uses a separate Weekly scenario with a same-day reset so the image shows relative timing instead of a calendar date. | Theme | Normal | Warning | Critical | Projection | | --- | --- | --- | --- | --- | diff --git a/Sources/CodexToolbar/App/ScreenshotScenario.swift b/Sources/CodexToolbar/App/ScreenshotScenario.swift index 589964a..c2067f6 100644 --- a/Sources/CodexToolbar/App/ScreenshotScenario.swift +++ b/Sources/CodexToolbar/App/ScreenshotScenario.swift @@ -46,6 +46,8 @@ struct ScreenshotScenario: Equatable, Sendable { return multiweek case "projection": return projection + case "website": + return website case "spark": return spark default: @@ -193,6 +195,21 @@ struct ScreenshotScenario: Equatable, Sendable { ) }() + static let website: ScreenshotScenario = { + let now = date(year: 2026, month: 5, day: 13, hour: 12, minute: 0) + let reset = date(year: 2026, month: 5, day: 13, hour: 16, minute: 0) + return ScreenshotScenario( + name: "website", + snapshot: snapshot(used: 45, reset: reset), + rateLimitsByLimitId: nil, + now: now, + lastUpdated: now, + calendar: calendar, + locale: locale, + timeZone: pacificTimeZone + ) + }() + static let spark: ScreenshotScenario = { let now = date(year: 2026, month: 3, day: 10, hour: 10, minute: 22) let primaryReset = date(year: 2026, month: 3, day: 10, hour: 15, minute: 7) diff --git a/Tests/CodexToolbarTests/ScreenshotScenarioTests.swift b/Tests/CodexToolbarTests/ScreenshotScenarioTests.swift index 6bcff78..b55c4b1 100644 --- a/Tests/CodexToolbarTests/ScreenshotScenarioTests.swift +++ b/Tests/CodexToolbarTests/ScreenshotScenarioTests.swift @@ -12,6 +12,18 @@ final class ScreenshotScenarioTests: XCTestCase { } } + func testWebsiteScenarioShowsSameDayResetWithoutCalendarDate() throws { + let scenario = try XCTUnwrap(ScreenshotScenario.named("website")) + let cards = RateLimitStore.makeCards( + from: scenario.snapshot, now: scenario.now, + calendar: scenario.calendar, locale: scenario.locale, timeZone: scenario.timeZone + ) + XCTAssertEqual(cards.map(\.title), ["Weekly"]) + let card = try XCTUnwrap(cards.first) + XCTAssertEqual(card.combinedResetText, "Resets in 4h (4:00 PM)") + XCTAssertEqual(card.projection?.detailText, "On pace to last through reset") + } + func testWarningScenarioMapsToExpectedCardStates() throws { let scenario = try XCTUnwrap(ScreenshotScenario.named("warning")) diff --git a/screenshots/website-dark-popover.png b/screenshots/website-dark-popover.png new file mode 100644 index 0000000..f4d4210 Binary files /dev/null and b/screenshots/website-dark-popover.png differ diff --git a/screenshots/website-light-popover.png b/screenshots/website-light-popover.png new file mode 100644 index 0000000..a9aaf65 Binary files /dev/null and b/screenshots/website-light-popover.png differ diff --git a/scripts/generate_screenshots.sh b/scripts/generate_screenshots.sh index 87d86d4..30f5434 100755 --- a/scripts/generate_screenshots.sh +++ b/scripts/generate_screenshots.sh @@ -18,6 +18,8 @@ for appearance in light dark; do done generated_files+=( + "$SCREENSHOTS_DIR/website-light-popover.png" + "$SCREENSHOTS_DIR/website-dark-popover.png" "$SCREENSHOTS_DIR/normal-light-status-item.png" "$SCREENSHOTS_DIR/critical-dark-status-item.png" ) @@ -70,7 +72,8 @@ for scenario in "${README_SCENARIOS[@]}"; do done for appearance in light dark; do - cp "$SCREENSHOTS_DIR/projection-$appearance-popover.png" \ + run_capture "website" "$appearance" + cp "$SCREENSHOTS_DIR/website-$appearance-popover.png" \ "$ROOT_DIR/site/assets/codextoolbar-tahoe-$appearance.png" done diff --git a/site/assets/codextoolbar-tahoe-dark.png b/site/assets/codextoolbar-tahoe-dark.png index 6c0acb0..f4d4210 100644 Binary files a/site/assets/codextoolbar-tahoe-dark.png and b/site/assets/codextoolbar-tahoe-dark.png differ diff --git a/site/assets/codextoolbar-tahoe-light.png b/site/assets/codextoolbar-tahoe-light.png index c41b586..a9aaf65 100644 Binary files a/site/assets/codextoolbar-tahoe-light.png and b/site/assets/codextoolbar-tahoe-light.png differ