Repository navigation
Add Fable quota and compact Codex/Claude dashboard - #44
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbdf2e1ba2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let Some(fable) = fable { | ||
| object.insert("fable".into(), fable); |
There was a problem hiding this comment.
Expose Fable in the usage JSON serializer
This stores the parsed Claude Fable allowance under details.windows.fable, but pickgauge usage --json still serializes UsageJsonWindows with only five_hour and week in src-tauri/src/usage_cli.rs, so the new Fable reading is silently dropped from the documented CLI JSON output. Add a fable field to the CLI window struct and populate it from detail_window(snapshot, "fable") so consumers can actually receive the allowance parsed here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f7923b2: usage --json now serializes windows.fable, with the golden fixture covering a populated allowance.
| const weeklyUsed = usedPercentFollowingLabel(text, /\ball\s+models\b/iu); | ||
| const fableUsed = usedPercentFollowingLabel(text, /\bfable(?:\s+5)?(?:\s+only)?\b/iu); | ||
| const fallback = visiblePercentages(text); | ||
| const usedPercent = labelIsPresent(text, sessionLabel) ? sessionUsed : fallback.usedPercent; |
There was a problem hiding this comment.
Preserve remaining-only Claude fallback readings
When the Claude page does not include the Current session label and exposes only an NN% remaining value, the generic fallback parser can still find fallback.remainingPercent, but this assignment keeps only fallback.usedPercent. In that UI variant the returned headline remains null, causing the backend to report missing data despite a valid visible quota; keep fallback.remainingPercent in the no-label path or derive usedPercent only when needed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f7923b2: the no-label fallback now preserves explicit remaining-only readings and avoids treating the generic word “usage” as a used-value label. Added a regression test.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7923b2192
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const remainingPercent = hasSessionLabel | ||
| ? sessionUsed === null | ||
| ? null | ||
| : 100 - sessionUsed | ||
| : fallback.remainingPercent; |
There was a problem hiding this comment.
Preserve weekly/Fable quotas when session is unavailable
When Claude shows the Current session label but no % used value (the added sidecar test covers this with “Temporarily unavailable”), this sets the headline percentages to null even if All models and Fable were parsed. The Rust handoff then returns missing_visible_percentage before copying weekly/fable into details.windows (parse_visible_usage requires a headline percentage first), so the valid weekly/Fable allowances are discarded instead of shown. Consider falling back the headline to a valid secondary window, as the Ollama path does, or allowing secondary-only Claude windows through.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f94c227: Claude secondary windows now provide a valid headline when the session meter is unavailable, while the windows detail omits the missing five-hour row so the UI does not mislabel or duplicate weekly usage. Added Rust and frontend regressions.
| ) { | ||
| return "bad"; | ||
| } | ||
| if (snapshot.remainingPercent !== null || status === "parsed") return "ok"; |
There was a problem hiding this comment.
Classify web fallback failures before marking gauges healthy
When a web refresh fails but a local/fake fallback still has a percentage (web_unavailable_fallback_snapshot sets details.webStatus while preserving remainingPercent), this branch returns ok for statuses such as network_unavailable, timed_out, unexpected_ui, or captcha_or_bot_check because the fallback percentage is non-null. The new status dot/state styling therefore marks the provider healthy while providerStatusMessage is showing an official-web failure; classify known failure webStatus values before the percentage shortcut.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f94c227: provider health now classifies official web failures before considering cached fallback percentages. Network/timeouts/unexpected UI render as failures; login/MFA/verification gates render as warnings. Added focused frontend tests.
| const used = percentNearLabel(text, /\b(used|consumed)\b/iu); | ||
|
|
||
| return { | ||
| remainingPercent: remaining ?? (used === null ? firstPercentValue(text) : null), |
There was a problem hiding this comment.
Keep Claude fallback usage percentages as used
If Claude serves an older/alternate page without the new Current session label and labels a value as % usage (for example 42% usage), this fallback no longer treats usage as a used-percent label. It then falls through to firstPercentValue as remainingPercent, so the app reports 42% remaining instead of deriving 58% remaining from 42% used; the generic parser handled usage as used before this Claude-specific path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f94c227: the Claude fallback recognizes the bounded legacy form “NN% usage” as used, while prose such as “plan usage … NN% remaining” remains a remaining value. Added a sidecar regression.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f94c22793f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .second_window | ||
| .as_ref() | ||
| .and_then(window_values) | ||
| .or_else(|| input.fable_window.as_ref().and_then(window_values)) |
There was a problem hiding this comment.
Keep Fable-only quota out of the headline
When Claude's current-session and all-models rows are unavailable but the Fable row is parseable, this fallback promotes the separate Fable allowance into snapshot.remaining_percent. That top-level field drives the tray icon and low-quota threshold cues, so users can see a model-specific Fable quota as overall Claude availability. Keep Fable only in details.windows.fable and leave the headline unknown unless current-session or all-models data is present.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in afb893a: Fable-only data remains in the Fable detail window with no top-level Claude percentage, so it cannot drive the tray or overall low-quota cues. Added a Rust regression.
| const fableUsed = usedPercentFollowingLabel(text, /\bfable(?:\s+5)?(?:\s+only)?\b/iu); | ||
| const fallback = claudeFallbackPercentages(text); | ||
| const hasSessionLabel = labelIsPresent(text, sessionLabel); | ||
| const usedPercent = hasSessionLabel ? sessionUsed : fallback.usedPercent; |
There was a problem hiding this comment.
Skip fallback when secondary Claude rows are present
If the Claude page lacks the Current session label but still contains labeled All models or Fable rows, this fallback reads the secondary row's % used as top-level Claude usage. The backend then converts that used-only value into a headline remaining percent and the dashboard renders it as the 5-hour/current-session bar, duplicating weekly usage or treating Fable as the primary quota. Suppress the generic fallback when those secondary labels are present, or strip those sections before falling back to legacy text parsing.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in afb893a: generic Claude fallback parsing is suppressed whenever labeled All models or Fable rows are present, preventing secondary rows from being duplicated as session usage. Added a sidecar regression.
| ? `Grok Build ${Math.round(grokBuildUsage(snapshot) ?? 0)}% used` | ||
| : ""))} | ||
| </span> | ||
| {#if loginPromptVisible(snapshot)} |
There was a problem hiding this comment.
Hide unusable Grok CLI login action
When Grok is using the CLI provider and web readings are disabled, a login_required snapshot now satisfies this condition, so the card shows a disabled Start login action under the Sign in with the Grok CLI message. The previous footer was guarded by snapshot.service !== "grok" || config.providers.webEnabled, so this confusing desktop-web login action did not appear for the CLI-only Grok flow; keep the action hidden unless a managed web login can actually be started.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in afb893a: the login action remains hidden for Grok CLI snapshots unless managed web readings are enabled.
| {providerStatusMessage(snapshot) ?? | ||
| (snapshotIsStale(snapshot) | ||
| ? "Stale data" |
There was a problem hiding this comment.
Keep stale status visible with provider errors
When a stale snapshot also has a provider status message (for example a local fallback with a failed web refresh), this expression chooses the provider message first and no longer renders Stale data; the previous layout showed both notes. Users can then see only the login/network error and miss that the displayed quota itself is older than the refresh interval, so render stale separately or combine the messages.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in afb893a: stale state is now combined with the provider error instead of being replaced by it.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afb893a26d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .as_ref() | ||
| .and_then(window_values) | ||
| .is_some(); | ||
| if headline.is_none() && !(input.service == Service::Claude && has_fable_window) { |
There was a problem hiding this comment.
Preserve Fable-only web readings during display merge
When Claude exposes only the Fable row, this new exception produces a parsed web snapshot with details.windows.fable but no top-level remaining_percent/used_percent. The display merge still treats any web snapshot without a top-level percent as unavailable and replaces it with the local/fake fallback (merge_service_snapshots), which drops the Fable window, so users with local Claude activity never see a Fable-only official reading. Treat a valid window as usable for merge purposes or carry the web windows into the fallback snapshot.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 5e0a83e: parsed window-only web snapshots now bypass unavailable fallback merging, preserve the Fable detail window, and keep the top-level Claude percentage unknown. Added a merge regression with local Claude activity.
| status === "network_unavailable" || | ||
| status === "timed_out" || | ||
| status === "unexpected_ui" || | ||
| status === "unsafe_path" || | ||
| status === "internal" |
There was a problem hiding this comment.
Mark unavailable providers as bad
When a snapshot reports status/webStatus: "unavailable", the dashboard now shows the Provider unavailable state text but this new status classifier falls through to idle, so the status dot and state row are rendered neutral instead of as an outage. Add unavailable to the bad-status branch so provider outages are not visually downgraded in the compact board.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 5e0a83e: unavailable now maps to the bad provider status, with a frontend regression.
Ship the Fable dashboard as a focused Codex and Claude experience while keeping legacy provider config inert.\n\nRefs #43
Changed
Validated
bun run checkbun run test— 71 frontend tests and 18 Playwright sidecar testsbun run test:browser-preview— two-provider dashboard/settings at 1000px, 820px, 680px, and 390px plus exact 168×56 capsule geometrycargo test --manifest-path src-tauri/Cargo.toml --locked --all-targets— 252 passedgrok=trueandollama=truestill deserialize but emit only Codex and ClaudeNot tested
cargo fmt --checkbecauserustfmtis not installed in the current toolchainCloses #43
Leave this PR draft and unmerged until manual app testing is complete.