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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ automatically and used as the GitHub Release notes.

## [Unreleased]

## [1.0.13] - 2026-07-21

### Changed

- Show only the month name in Year chart detail headers because each bar
represents a whole calendar month.

## [1.0.12] - 2026-07-21

### Fixed

- Fetch every page of yearly Upwork time-report data so the Year dashboard
Expand Down
4 changes: 2 additions & 2 deletions Sources/UpworkBuddy/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.12</string>
<string>1.0.13</string>
<key>CFBundleVersion</key>
<string>13</string>
<string>14</string>
<key>LSMinimumSystemVersion</key>
<string>14.0</string>
<key>LSUIElement</key>
Expand Down
3 changes: 2 additions & 1 deletion Sources/UpworkBuddy/Views/DashboardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ struct DashboardView: View {
currency: store.currency,
masked: store.hideSensitive,
metric: store.dashboardMetric,
title: chartTitle
title: chartTitle,
period: store.selectedPeriod
)
.zIndex(2)
}
Expand Down
21 changes: 17 additions & 4 deletions Sources/UpworkBuddy/Views/SparklineView.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
import SwiftUI

enum SparklineDateLabelFormatter {
static func string(
for date: Date,
period: Period,
locale: Locale = L10n.currentLocale,
timeZone: TimeZone = .current
) -> String {
let formatter = DateFormatter()
formatter.locale = locale
formatter.timeZone = timeZone
formatter.setLocalizedDateFormatFromTemplate(period == .year ? "MMM" : "EEE MMM d")
return formatter.string(from: date)
}
}

struct SparklineView: View {
let points: [DailyPoint]
let currency: String
var masked: Bool = false
var metric: MenuBarMetric = .earnings
var title: String?
let period: Period

@State private var hoverIndex: Int?

Expand Down Expand Up @@ -108,15 +124,12 @@ struct SparklineView: View {
}

private func tooltip(for point: DailyPoint, format: CurrencyFormat) -> some View {
let f = DateFormatter()
f.locale = L10n.currentLocale
f.setLocalizedDateFormatFromTemplate("EEE MMM d")
let rows = Array(point.breakdown.prefix(5))
let isPayoutOnly = point.earnings > 0 && point.hours <= 0.01
let primaryValue = metric == .hours ? point.hours.asHours() : format.compact(point.earnings)
return VStack(alignment: .leading, spacing: 4) {
HStack {
Text(f.string(from: point.date))
Text(SparklineDateLabelFormatter.string(for: point.date, period: period))
.font(Theme.body(size: 11, weight: .semibold))
.foregroundStyle(Theme.textPrimary)
if isPayoutOnly {
Expand Down
39 changes: 39 additions & 0 deletions Tests/UpworkBuddyTests/SparklineDateLabelTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import Foundation
import Testing
@testable import UpworkBuddy

@Suite("Sparkline date labels")
struct SparklineDateLabelTests {
private let locale = Locale(identifier: "en_US_POSIX")
private let timeZone = TimeZone(secondsFromGMT: 0)!

@Test func yearUsesMonthNameOnly() {
let label = SparklineDateLabelFormatter.string(
for: juneFirst2026,
period: .year,
locale: locale,
timeZone: timeZone
)

#expect(label == "Jun")
}

@Test func shorterPeriodsKeepWeekdayAndDay() {
let label = SparklineDateLabelFormatter.string(
for: juneFirst2026,
period: .month,
locale: locale,
timeZone: timeZone
)

#expect(label.contains("Mon"))
#expect(label.contains("Jun"))
#expect(label.contains("1"))
}

private var juneFirst2026: Date {
var calendar = Calendar(identifier: .gregorian)
calendar.timeZone = timeZone
return calendar.date(from: DateComponents(year: 2026, month: 6, day: 1))!
}
}
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.12
1.0.13