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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 0.50.1 — Unreleased

### Added
- Usage bars: make workday tick marks configurable with hidden, subtle, and high-contrast appearances (#2904, #2950). Thanks @dstier-git!

### Fixed
- Usage & Spend: keep safely priced Codex totals visible after completed history scans when request-tier uncertainty leaves some days unpriced (#2948). Thanks @Atopoz for the report!
- Vertex AI: match Cloud Monitoring quota usage without a `limit_name` to its unambiguous same-metric, same-location limit, restoring quota percentages (#2958). Thanks @MachApple!
Expand Down
1 change: 1 addition & 0 deletions Sources/CodexBar/MenuCardView+ModelHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ extension UsageMenuCardView.Model {
paceOnTop: metric.paceOnTop,
warningMarkerPercents: metric.warningMarkerPercents,
workdayMarkerPercents: metric.workdayMarkerPercents,
workdayTickAppearance: metric.workdayTickAppearance,
cardStyle: metric.cardStyle,
sessionEquivalentDetail: metric.sessionEquivalentDetail)
}
Expand Down
3 changes: 3 additions & 0 deletions Sources/CodexBar/MenuCardView+ModelInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ extension UsageMenuCardView.Model {
let sessionEquivalentForecast: SessionEquivalentForecast?
let quotaWarningThresholds: [QuotaWarningWindow: [Int]]
let workDaysPerWeek: Int?
let workdayTickAppearance: WorkdayTickAppearance
let usesLiveSubtitle: Bool
let preferredCurrencyCode: String
let now: Date
Expand Down Expand Up @@ -84,6 +85,7 @@ extension UsageMenuCardView.Model {
sessionEquivalentForecast: SessionEquivalentForecast? = nil,
quotaWarningThresholds: [QuotaWarningWindow: [Int]] = [:],
workDaysPerWeek: Int? = nil,
workdayTickAppearance: WorkdayTickAppearance = .subtle,
usesLiveSubtitle: Bool = false,
preferredCurrencyCode: String = "auto",
now: Date)
Expand Down Expand Up @@ -125,6 +127,7 @@ extension UsageMenuCardView.Model {
self.sessionEquivalentForecast = sessionEquivalentForecast
self.quotaWarningThresholds = quotaWarningThresholds
self.workDaysPerWeek = workDaysPerWeek
self.workdayTickAppearance = workdayTickAppearance
self.usesLiveSubtitle = usesLiveSubtitle
self.preferredCurrencyCode = preferredCurrencyCode
self.now = now
Expand Down
14 changes: 9 additions & 5 deletions Sources/CodexBar/MenuCardView+SessionEquivalent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ extension UsageMenuCardView.Model {
id = "monthly"
paceDetail = nil
}
let workdayMarkerPercents: [Double] = if lane == .weekly, input.workdayTickAppearance != .hidden {
workDayMarkerPercents(
workDays: input.workDaysPerWeek,
windowMinutes: window.windowMinutes)
} else {
[]
}

return Metric(
id: id,
Expand All @@ -66,11 +73,8 @@ extension UsageMenuCardView.Model {
warningMarkerPercents: Self.warningMarkerPercents(
thresholds: lane.quotaWarningWindow.flatMap { input.quotaWarningThresholds[$0] },
showUsed: input.usageBarsShowUsed),
workdayMarkerPercents: lane == .weekly
? workDayMarkerPercents(
workDays: input.workDaysPerWeek,
windowMinutes: window.windowMinutes)
: [],
workdayMarkerPercents: workdayMarkerPercents,
workdayTickAppearance: input.workdayTickAppearance,
sessionEquivalentDetail: lane == .weekly
? Self.sessionEquivalentDetail(input: input, weeklyWindow: window, weeklyWindowID: nil)
: nil)
Expand Down
15 changes: 11 additions & 4 deletions Sources/CodexBar/MenuCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct UsageMenuCardView: View {
let paceOnTop: Bool
let warningMarkerPercents: [Double]
let workdayMarkerPercents: [Double]
let workdayTickAppearance: WorkdayTickAppearance
let cardStyle: Bool
let sessionEquivalentDetail: UsagePaceText.SessionEquivalentDetail?

Expand All @@ -61,6 +62,7 @@ struct UsageMenuCardView: View {
paceOnTop: Bool,
warningMarkerPercents: [Double] = [],
workdayMarkerPercents: [Double] = [],
workdayTickAppearance: WorkdayTickAppearance = .subtle,
cardStyle: Bool = false,
sessionEquivalentDetail: UsagePaceText.SessionEquivalentDetail? = nil)
{
Expand All @@ -77,6 +79,7 @@ struct UsageMenuCardView: View {
self.paceOnTop = paceOnTop
self.warningMarkerPercents = warningMarkerPercents
self.workdayMarkerPercents = workdayMarkerPercents
self.workdayTickAppearance = workdayTickAppearance
self.cardStyle = cardStyle
self.sessionEquivalentDetail = sessionEquivalentDetail
}
Expand Down Expand Up @@ -539,7 +542,8 @@ private struct MetricRow: View {
pacePercent: self.metric.pacePercent,
paceOnTop: self.metric.paceOnTop,
warningMarkerPercents: self.metric.warningMarkerPercents,
workdayMarkerPercents: self.metric.workdayMarkerPercents)
workdayMarkerPercents: self.metric.workdayMarkerPercents,
workdayTickAppearance: self.metric.workdayTickAppearance)
if let metaText = presentation.metaText {
Text(metaText)
.font(.footnote)
Expand Down Expand Up @@ -1532,9 +1536,12 @@ extension UsageMenuCardView.Model {
warningMarkerPercents: Self.warningMarkerPercents(
thresholds: input.quotaWarningThresholds[.weekly],
showUsed: input.usageBarsShowUsed),
workdayMarkerPercents: workDayMarkerPercents(
workDays: input.workDaysPerWeek,
windowMinutes: weekly.windowMinutes),
workdayMarkerPercents: input.workdayTickAppearance == .hidden
? []
: workDayMarkerPercents(
workDays: input.workDaysPerWeek,
windowMinutes: weekly.windowMinutes),
workdayTickAppearance: input.workdayTickAppearance,
sessionEquivalentDetail: Self.sessionEquivalentDetail(
input: input,
weeklyWindow: weekly,
Expand Down
13 changes: 13 additions & 0 deletions Sources/CodexBar/PreferencesMenuPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ struct MenuPane: View {
Text(MenuSettingsMenuOptions.weeklyProgressWorkDaysLabel(workDays))
})

SettingsMenuPicker(
selection: self.$settings.workdayTickAppearance,
options: MenuSettingsMenuOptions.workdayTickAppearances,
label: {
SettingsRowLabel(
L("workday_tick_appearance_title"),
subtitle: L("workday_tick_appearance_subtitle"))
},
optionLabel: { appearance in
Text(appearance.label)
})
.disabled(self.settings.weeklyProgressWorkDays == nil)

SettingsMenuPicker(
selection: self.$settings.resetTimesOption,
options: MenuSettingsMenuOptions.resetTimes,
Expand Down
1 change: 1 addition & 0 deletions Sources/CodexBar/PreferencesMenuPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ enum MenuBarSettingsMenuOptions {

enum MenuSettingsMenuOptions {
static let weeklyProgressWorkDays: [Int?] = [nil, 4, 5, 7]
static let workdayTickAppearances = WorkdayTickAppearance.allCases
static let multiAccountLayouts = MultiAccountMenuLayout.allCases
static let usageBarsFill = UsageBarsFillOption.allCases
static let resetTimes = ResetTimesOption.allCases
Expand Down
3 changes: 2 additions & 1 deletion Sources/CodexBar/PreferencesProviderDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@ private struct ProviderMetricInlineRow: View {
pacePercent: self.metric.pacePercent,
paceOnTop: self.metric.paceOnTop,
warningMarkerPercents: self.metric.warningMarkerPercents,
workdayMarkerPercents: self.metric.workdayMarkerPercents)
workdayMarkerPercents: self.metric.workdayMarkerPercents,
workdayTickAppearance: self.metric.workdayTickAppearance)
.frame(maxWidth: .infinity)

if let metaText = presentation.metaText {
Expand Down
1 change: 1 addition & 0 deletions Sources/CodexBar/PreferencesProvidersPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ struct ProvidersPane: View {
.weekly: self.quotaWarningMarkerThresholds(provider: provider, window: .weekly),
],
workDaysPerWeek: self.settings.weeklyProgressWorkDays,
workdayTickAppearance: self.settings.workdayTickAppearance,
now: now)
return UsageMenuCardView.Model.make(input)
}
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@
"show_quota_warning_markers_subtitle" = "ارسم علامات عتبة على أشرطة الاستخدام عند تكوين تحذيرات الحصص.";
"weekly_progress_work_days_title" = "أيام العمل الأسبوعية للتقدم";
"weekly_progress_work_days_subtitle" = "حدد أيام عمل لمؤشرات شريط الاستخدام الأسبوعي وحسابات السرعة.";
"workday_tick_appearance_title" = "مظهر علامات أيام العمل";
"workday_tick_appearance_subtitle" = "اختر كيفية ظهور حدود أيام العمل على أشرطة الاستخدام الأسبوعية.";
"workday_tick_appearance_hidden" = "مخفية";
"workday_tick_appearance_subtle" = "خفيفة";
"workday_tick_appearance_high_contrast" = "تباين عالٍ";
"show_provider_changelog_links_title" = "اعرض روابط سجل التغييرات لمزود الخدمة";
"show_provider_changelog_links_subtitle" = "يضيف روابط ملاحظات الإصدار لمزودي الخدمة المدعومين بدعم CLI إلى القائمة.";
"show_credits_extra_usage_title" = "اعتمادات العرض + الاستخدام الإضافي";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/ca.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,11 @@
"show_quota_warning_markers_subtitle" = "Dibuixa marques de llindar a les barres d'ús quan hi ha avisos de quota configurats.";
"weekly_progress_work_days_title" = "Dies laborables del progrés setmanal";
"weekly_progress_work_days_subtitle" = "Definiu els dies laborables per als marcadors de les barres d'ús setmanal i els càlculs de ritme.";
"workday_tick_appearance_title" = "Aparença de les marques dels dies laborables";
"workday_tick_appearance_subtitle" = "Trieu com es mostren els límits dels dies laborables a les barres d'ús setmanal.";
"workday_tick_appearance_hidden" = "Ocultes";
"workday_tick_appearance_subtle" = "Subtils";
"workday_tick_appearance_high_contrast" = "Contrast alt";
"show_provider_changelog_links_title" = "Mostreu els enllaços al registre de canvis del proveïdor";
"show_provider_changelog_links_subtitle" = "Afegiu al menú enllaços a les notes de versió dels proveïdors compatibles basats en CLI.";
"show_credits_extra_usage_title" = "Mostreu crèdits + ús addicional";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,11 @@
"show_quota_warning_markers_subtitle" = "Zeichnen Sie Schwellenwertmarkierungen auf Nutzungsbalken, wenn Kontingentwarnungen konfiguriert sind.";
"weekly_progress_work_days_title" = "Wöchentliche Fortschrittsarbeitstage";
"weekly_progress_work_days_subtitle" = "Legt Arbeitstage für Markierungen in wöchentlichen Nutzungsbalken und Tempo-Berechnungen fest.";
"workday_tick_appearance_title" = "Darstellung der Arbeitstagsmarkierungen";
"workday_tick_appearance_subtitle" = "Wähle, wie Arbeitstagsgrenzen in wöchentlichen Nutzungsbalken erscheinen.";
"workday_tick_appearance_hidden" = "Ausgeblendet";
"workday_tick_appearance_subtle" = "Dezent";
"workday_tick_appearance_high_contrast" = "Hoher Kontrast";
"show_provider_changelog_links_title" = "Links zum Änderungsprotokoll des Anbieters anzeigen";
"show_provider_changelog_links_subtitle" = "Fügt dem Menü Versionshinweise-Links für unterstützte CLI-gestützte Anbieter hinzu.";
"show_credits_extra_usage_title" = "Credits + zusätzliche Nutzung anzeigen";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,11 @@
"show_quota_warning_markers_subtitle" = "Draw threshold tick marks on usage bars when quota warnings are configured.";
"weekly_progress_work_days_title" = "Work days";
"weekly_progress_work_days_subtitle" = "Set work days for weekly usage-bar markers and pace calculations.";
"workday_tick_appearance_title" = "Workday tick appearance";
"workday_tick_appearance_subtitle" = "Choose how workday boundaries appear on weekly usage bars.";
"workday_tick_appearance_hidden" = "Hidden";
"workday_tick_appearance_subtle" = "Subtle";
"workday_tick_appearance_high_contrast" = "High contrast";
"show_provider_changelog_links_title" = "Show provider changelog links";
"show_provider_changelog_links_subtitle" = "Adds release-notes links for supported CLI-backed providers to the menu.";
"show_credits_extra_usage_title" = "Show credits & extra usage";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,11 @@
"show_quota_warning_markers_subtitle" = "Dibuja marcas de umbral en las barras de uso cuando hay avisos de cuota configurados.";
"weekly_progress_work_days_title" = "Días laborables del progreso semanal";
"weekly_progress_work_days_subtitle" = "Define los días laborables para los marcadores de las barras de uso semanal y los cálculos de ritmo.";
"workday_tick_appearance_title" = "Aspecto de las marcas de días laborables";
"workday_tick_appearance_subtitle" = "Elige cómo aparecen los límites de los días laborables en las barras de uso semanal.";
"workday_tick_appearance_hidden" = "Ocultas";
"workday_tick_appearance_subtle" = "Sutiles";
"workday_tick_appearance_high_contrast" = "Contraste alto";
"show_provider_changelog_links_title" = "Mostrar enlaces al registro de cambios del proveedor";
"show_provider_changelog_links_subtitle" = "Añade al menú enlaces a las notas de versión de los proveedores compatibles basados en CLI.";
"show_credits_extra_usage_title" = "Mostrar créditos + uso adicional";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/fa.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@
"show_quota_warning_markers_subtitle" = "علامت تیک آستانه را روی نوارهای استفاده هنگام پیکربندی هشدارهای سهمیه رسم کنید.";
"weekly_progress_work_days_title" = "روزهای کاری پیشرفت هفتگی";
"weekly_progress_work_days_subtitle" = "روزهای کاری را برای نشانگرهای نوار مصرف هفتگی و محاسبات سرعت تعیین کنید.";
"workday_tick_appearance_title" = "نمایش نشانه‌های روز کاری";
"workday_tick_appearance_subtitle" = "نحوهٔ نمایش مرز روزهای کاری در نوارهای مصرف هفتگی را انتخاب کنید.";
"workday_tick_appearance_hidden" = "پنهان";
"workday_tick_appearance_subtle" = "ملایم";
"workday_tick_appearance_high_contrast" = "کنتراست بالا";
"show_provider_changelog_links_title" = "لینک های تغییرات ارائه دهنده را نمایش دهید";
"show_provider_changelog_links_subtitle" = "لینک های یادداشت های انتشار برای ارائه دهندگان پشتیبانی شده با پشتیبانی CLI به منو اضافه می شود.";
"show_credits_extra_usage_title" = "نمایش اعتبارها + استفاده اضافی";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,11 @@
"show_quota_warning_markers_subtitle" = "Dessinez des coches de seuil sur les barres d’utilisation lorsque des avertissements de quota sont configurés.";
"weekly_progress_work_days_title" = "Jours de travail hebdomadaires";
"weekly_progress_work_days_subtitle" = "Définit les jours ouvrés pour les repères des barres d’utilisation hebdomadaire et le calcul du rythme.";
"workday_tick_appearance_title" = "Apparence des repères de jours ouvrés";
"workday_tick_appearance_subtitle" = "Choisissez l’apparence des limites des jours ouvrés sur les barres d’utilisation hebdomadaire.";
"workday_tick_appearance_hidden" = "Masqués";
"workday_tick_appearance_subtle" = "Discrets";
"workday_tick_appearance_high_contrast" = "Contraste élevé";
"show_provider_changelog_links_title" = "Afficher les liens du journal des modifications du fournisseur";
"show_provider_changelog_links_subtitle" = "Ajoute au menu des liens de notes de version pour les fournisseurs pris en charge par CLI.";
"show_credits_extra_usage_title" = "Afficher les crédits + utilisation supplémentaire";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/gl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@
"show_quota_warning_markers_subtitle" = "Debuxa marcas de limiar nas barras de uso cando hai avisos de cota configurados.";
"weekly_progress_work_days_title" = "Días laborables do progreso semanal";
"weekly_progress_work_days_subtitle" = "Define os días laborables para os marcadores das barras de uso semanal e os cálculos de ritmo.";
"workday_tick_appearance_title" = "Aspecto das marcas dos días laborables";
"workday_tick_appearance_subtitle" = "Escolle como aparecen os límites dos días laborables nas barras de uso semanal.";
"workday_tick_appearance_hidden" = "Ocultas";
"workday_tick_appearance_subtle" = "Sutís";
"workday_tick_appearance_high_contrast" = "Contraste alto";
"show_provider_changelog_links_title" = "Amosar as ligazóns ao rexistro de cambios do provedor";
"show_provider_changelog_links_subtitle" = "Engade ao menú enlaces ás notas de versión dos provedores compatibles baseados en CLI.";
"show_credits_extra_usage_title" = "Amosar créditos + uso adicional";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/id.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,11 @@
"show_quota_warning_markers_subtitle" = "Gambar tanda centang ambang batas pada bilah penggunaan saat peringatan kuota dikonfigurasi.";
"weekly_progress_work_days_title" = "Hari kerja progres mingguan";
"weekly_progress_work_days_subtitle" = "Atur hari kerja untuk penanda bilah penggunaan mingguan dan perhitungan pace.";
"workday_tick_appearance_title" = "Tampilan tanda hari kerja";
"workday_tick_appearance_subtitle" = "Pilih tampilan batas hari kerja pada bilah penggunaan mingguan.";
"workday_tick_appearance_hidden" = "Tersembunyi";
"workday_tick_appearance_subtle" = "Samar";
"workday_tick_appearance_high_contrast" = "Kontras tinggi";
"show_provider_changelog_links_title" = "Tampilkan tautan changelog penyedia";
"show_provider_changelog_links_subtitle" = "Menambahkan tautan catatan rilis untuk penyedia berbasis CLI yang didukung ke menu.";
"show_credits_extra_usage_title" = "Tampilkan kredit + penggunaan ekstra";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,11 @@
"show_quota_warning_markers_subtitle" = "Disegna tacche soglia sulle barre quando gli avvisi quota sono configurati.";
"weekly_progress_work_days_title" = "Giorni lavorativi progresso settimanale";
"weekly_progress_work_days_subtitle" = "Disegna i confini giornalieri sulle barre settimanali.";
"workday_tick_appearance_title" = "Aspetto delle tacche dei giorni lavorativi";
"workday_tick_appearance_subtitle" = "Scegli come mostrare i confini dei giorni lavorativi nelle barre di utilizzo settimanale.";
"workday_tick_appearance_hidden" = "Nascoste";
"workday_tick_appearance_subtle" = "Discrete";
"workday_tick_appearance_high_contrast" = "Contrasto elevato";
"show_provider_changelog_links_title" = "Mostra link changelog provider";
"show_provider_changelog_links_subtitle" = "Aggiunge link alle note di rilascio per i provider CLI supportati.";
"show_credits_extra_usage_title" = "Mostra crediti + uso extra";
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodexBar/Resources/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,11 @@
"show_quota_warning_markers_subtitle" = "クォータ警告が設定されている場合、使用量バーにしきい値の目盛りを描画します。";
"weekly_progress_work_days_title" = "週間進捗の作業日";
"weekly_progress_work_days_subtitle" = "週間使用量バーの目盛りとペース計算に使用する作業日を設定します。";
"workday_tick_appearance_title" = "稼働日の目盛りの表示";
"workday_tick_appearance_subtitle" = "週間使用量バーで稼働日の境界をどのように表示するか選択します。";
"workday_tick_appearance_hidden" = "非表示";
"workday_tick_appearance_subtle" = "控えめ";
"workday_tick_appearance_high_contrast" = "高コントラスト";
"show_provider_changelog_links_title" = "プロバイダの変更履歴リンクを表示";
"show_provider_changelog_links_subtitle" = "対応する CLI ベースのプロバイダのリリースノートへのリンクをメニューに追加します。";
"show_credits_extra_usage_title" = "クレジットと追加使用量を表示";
Expand Down
Loading