Skip to content
Open
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
1 change: 1 addition & 0 deletions Sources/Runway/Services/UsageHistoryAggregator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ enum UsageHistorySnapshotRenderer {
combined: Bool = true
) -> ProviderSnapshot {
var result = snapshot
result.usageHistory = history
result.lines.removeAll { historyLabels.contains($0.label) }
let sourceNote = combined ? "Across your Macs · \(descriptor.sourceNote)" : descriptor.sourceNote
SpendTileMapper.appendTokenUsage(
Expand Down
16 changes: 11 additions & 5 deletions Sources/Runway/Support/ShareCardRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,17 @@ enum ShareCardRenderer {
return renderAndCopy(view, label: group.provider.id, layout: layout)
}

/// The Total Spend counterpart to `share(group:…)`: renders the aggregate ring card for the
/// currently selected period and metric and copies the PNG to the clipboard, with the same compact
/// render and the same "Copied to clipboard" confirmation. `total` is passed
/// already aggregated — the card computed it for the on-screen ring, so the export can't drift
/// The Total Spend counterpart to `share(group:…)`: renders the aggregate card for the
/// currently selected period, metric, and chart kind and copies the PNG to the clipboard, with
/// the same compact render and the same "Copied to clipboard" confirmation. `total` is passed
/// already aggregated — the card computed it for the on-screen chart, so the export can't drift
/// from the display. Returns whether the PNG landed on the pasteboard, so the share button can
/// gate its own "copied" micro-animation on actual success.
@discardableResult
static func shareTotalSpend(
total: TotalSpend,
metric: TotalSpendMetric,
chartKind: TotalSpendChartKind = .pie,
appearance: ColorScheme,
layout: LayoutStore
) -> Bool {
Expand All @@ -143,7 +144,12 @@ enum ShareCardRenderer {
playAlertSound()
return false
}
let view = TotalSpendShareCardView(total: total, metric: metric, appearance: appearance)
let view = TotalSpendShareCardView(
total: total,
metric: metric,
chartKind: chartKind,
appearance: appearance
)
return renderAndCopy(view, label: metric.title.lowercased(), layout: layout)
}

Expand Down
Loading