Skip to content

Reopen closed pane, Usage provider filter, custom model prices (#1531) - #1538

Merged
currentbits merged 3 commits into
mainfrom
coder/1531-misc-reopen-pane-usage-filter-price-31d439
Oct 9, 2026
Merged

currentbits merged 3 commits into
mainfrom
coder/1531-misc-reopen-pane-usage-filter-price-31d439

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Part of #1531 (the Misc item).

  • Reopen the last closed pane: Cmd/Ctrl+Shift+T, or the command palette entry. It keeps an in-memory stack of up to 10 closed panes per thread.
  • Usage page: a provider filter that narrows the totals, charts and rows.
  • Custom model prices: a per-model editor in the Spending settings, in USD per million tokens, with input, output and optional cache read/write prices. Solenta has no built-in price table, so these prices only fill usage cells that have tokens but no reported cost. Costs the provider reports itself, such as Claude's total_cost_usd, are never overridden. Prices apply when the report is read, so editing a price re-prices past usage too.

There is one commit per part. Tests are in test/paneLayout.test.ts, test/usageView.test.tsx, test/settingsModal.test.tsx and electron/test/model-prices.test.js.

Note: this PR and the merge-niceties PR both add a setting on the same lines of electron/test/budget-spend.test.js, so whichever lands second needs a small rebase.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T12:08:42.124681Z b96e0c2 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b96e0c2133

ℹ️ 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".

Comment thread electron/modelPrices.js
Comment on lines +99 to +100
function unmetered(cell) {
if (!cell || typeof cell !== "object" || Number(cell.costUsd) > 0) return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Track metered and unmetered usage separately

When the same provider/model/day contains both a turn with reported cost and a turn without it, recordUsage has already aggregated both turns into one cell, so the positive aggregate costUsd makes unmetered reject the entire cell. The custom price is therefore never applied to the unmetered turn's tokens, undercounting usage for providers that report cost inconsistently or across a CLI upgrade. Preserve the unmetered token portion during aggregation rather than using the aggregate cost as the reported-cost signal.

Useful? React with 👍 / 👎.

Willem and others added 3 commits October 9, 2026 14:28
Keeps an in-memory stack of the last 10 closed panes, scoped per thread,
fed from the one place every close goes through (applyLayout). Mod+Shift+T
and a command palette action reopen the newest one not already open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
"All providers" plus every provider in the loaded report. Narrowing the
report before summarizing filters totals, chart, provider rows and every
breakdown. Thread rows match on the thread's recorded provider.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Solenta has no built-in price table: every cost is what the provider CLI
reported. Settings > Spending gets a per-model USD-per-million editor
(input, output, optional cache read/write; non-negative; × clears a row).
usage:byDay prices only cells that carry tokens and no reported cost, at
read time, so the ledger stays raw and a price edit re-prices history.
A provider's own cost (Claude's total_cost_usd) is never replaced, and
budget caps still count reported spend only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@currentbits
currentbits force-pushed the coder/1531-misc-reopen-pane-usage-filter-price-31d439 branch from b96e0c2 to 08c15e0 Compare October 9, 2026 12:29
@currentbits
currentbits merged commit 634beae into main Oct 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant