Skip to content

Add forecast fields and formatting to the shared metric view model #4

@kmatsunami

Description

@kmatsunami

Summary

Extend the shared usage metric view model so menu rows and provider detail rows can carry forecast information and forecast copy without overloading pace fields.

This issue consumes the projection contract and exposes forecast data to shared UI models. It must not compute forecast itself or decide whether forecast is shown on real rows.

Scope

  • Extend UsageMenuCardView.Model.Metric and any shared row structs so they can carry:
    • raw forecast percent for display
    • overflow state
    • preformatted or format-ready forecast text
  • Add forecast text formatting helpers only.
  • Consume the projection contract produced by #6; do not derive forecast from RateWindow here.
  • Keep forecast semantics clearly separate from existing pace labels (On pace, X% in deficit, Runs out in ...).

Non-goals

  • No forecast math from RateWindow.
  • No provider gating or row visibility policy.
  • No end-to-end wiring into live usage rows.

Files likely involved

  • Sources/CodexBar/MenuCardView.swift
  • Sources/CodexBar/PreferencesProviderDetailView.swift
  • Sources/CodexBar/UsagePaceText.swift or a nearby formatter helper

Acceptance Criteria

  • Shared metric/view-model code can represent forecast independently of pace.
  • Forecast formatting preserves values over 100% in text.
  • This issue does not compute forecast math from RateWindow.
  • This issue does not decide when forecast appears on a real row; that remains in #3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions