30 lines · 1.0 KB · Swift
RawDownload
import CodexBarCore extension CodexConsumerProjection.RateLane {    var quotaWarningWindow: QuotaWarningWindow {        switch self {        case .session:            .session        case .weekly:            .weekly        }    }} extension UsageMenuCardView.Model {    static func warningMarkerPercents(thresholds: [Int]?, showUsed: Bool) -> [Double] {        guard let thresholds, !thresholds.isEmpty else { return [] }        return QuotaWarningThresholds.active(thresholds)            .map { showUsed ? 100 - Double($0) : Double($0) }            .filter { $0 > 0 && $0 < 100 }    }} /// Returns boundary percentages for work day markers on a weekly progress bar./// Only valid when windowMinutes == 10080 (standard 7-day week)./// nil workDays means feature is disabled.func workDayMarkerPercents(workDays: Int?, windowMinutes: Int?) -> [Double] {    guard workDays != nil, windowMinutes == 10080 else { return [] }    guard let wd = workDays, wd >= 2, wd <= 7 else { return [] }    return (1..<wd).map { Double($0) * 100.0 / Double(wd) }}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t