Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| --- | --- | --- | --- | --- |
Expand Down
17 changes: 17 additions & 0 deletions Sources/CodexToolbar/App/ScreenshotScenario.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ struct ScreenshotScenario: Equatable, Sendable {
return multiweek
case "projection":
return projection
case "website":
return website
case "spark":
return spark
default:
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions Tests/CodexToolbarTests/ScreenshotScenarioTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down
Binary file added screenshots/website-dark-popover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/website-light-popover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion scripts/generate_screenshots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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

Expand Down
Binary file modified site/assets/codextoolbar-tahoe-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/assets/codextoolbar-tahoe-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.