Skip to content

feat(mobile): configurable pace colors for the composer meter - #51322

Open
gsxdsm wants to merge 115 commits into
stablyai:mainfrom
gsxdsm:feat/usage-pace-color-thresholds
Open

gsxdsm wants to merge 115 commits into
stablyai:mainfrom
gsxdsm:feat/usage-pace-color-thresholds

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #51321. GitHub's base is main because the parent branch is on the fork; review the last commit.

Settings steppers set how far over an even burn still reads green or yellow. The composer bar and the usage pop-up share that color.

🤖 Generated with Claude Code

gsxdsm and others added 30 commits November 5, 2026 22:03
…he bottom edge

Duo chats can run across the status column, with a composer toggle to
switch the width, a header that stays clear of the column, and a
bottom-edge composer fit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Adds the composer usage meter (used/remaining toggle, 5-hour and weekly
windows, run-out projection) on the shared provider usage sheet.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The usage slot was flex:1 (basis 0) beside the growing leading controls, so
they split the free space and the slot squeezed the window/percent labels.
Size the slot to the meter, stop the labels shrinking, and let the bar give way.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t-full-width

Keep full-width Duo chat on top of the moved mobile modules.
# Conflicts:
#	mobile/src/components/bottom-drawer/mounted-bottom-drawer.tsx
#	mobile/src/mobile-web-shell/MobileWebShellScreen.tsx
#	mobile/src/mobile-web-shell/bridge/bridge-rpc-client-frames.test.ts
#	mobile/src/mobile-web-shell/page-storage/page-storage-keys.ts
#	mobile/src/session/MobileSessionActiveContent.tsx
#	mobile/src/session/MobileSessionCommandDock.tsx
#	mobile/src/session/MobileSessionContentRow.tsx
#	mobile/src/session/MobileSessionSurface.tsx
#	mobile/src/session/mobile-prompt-controller.test.ts
#	mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts
#	mobile/src/session/native-chat/MobileNativeChatView.tsx
#	mobile/src/session/native-chat/composer/MobileNativeChatComposer.keyboard.web.test.tsx
#	mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx
#	mobile/src/session/native-chat/composer/field/mobile-native-chat-composer-styles.ts
#	mobile/src/session/use-mobile-session-presentation.ts
#	mobile/src/settings/native-chat-settings-screen.tsx
#	mobile/web-entry/index.tsx
…r-usage-meter

# Conflicts:
#	mobile/src/i18n/locales/en.json
… with no usage yet

The host samples each active provider window's used percent at every usage
reading into a bounded per-window buffer persisted to
userData/orca-usage-window-history.json, and streams it as
rateLimits.usageHistory on the accounts snapshot. It also persists each
provider's last displayed windows to userData/orca-usage-last-good.json and
seeds the rate-limit state from them at startup, so a failed first poll after
a restart falls back through the stale policy instead of blanking the meter.

Muse's server meters a window only once it is used; a
server_sent_no_usage answer now reads as an unused five-hour window with a
notice instead of a failure.
…nd usage pop-up

The composer meter's bar takes the window's pace colour, and labels the time
until reset with a countdown that ticks at each label change. When the
composer row has room the meter widens to one line of reset label, bar and
percent; in a tight row the label shortens, then drops, before the meter.

Tapping the meter opens the usage pop-up: provider tabs with logos, window
tabs, a pace headline, the bar with an even-burn tick, stat tiles (vs. pace,
budget, projection at reset, recent use) and a usage-over-time graph with an
even-pace line, drawn from the host's streamed window history. A host notice
(e.g. Muse before its first turn) shows in place of the pace description.
The sheet, its stat tiles, graph and tabs ride a React.lazy boundary like the
dock panels, so chats that never tap the meter never load them. The meter
latches the first open and keeps the pop-up mounted afterwards, preserving
the sheet's reselect-on-open behaviour.
Settings → Chat UI → Composer usage, and the usage pop-up, gain a Meter
position choice: Controls (the meter in the action row, as before) or
Above text (one full-width line, provider · time to reset · bar · percent,
over the message field). Stored per device like the other meter choices.

The three meter choices now share one persisted store and one labeled
segmented row instead of three copies of each.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… nits

Icon-only segments stay narrower than equal-share, the position key is on both page-storage lists, and a one-shot account list no longer drops a later stream. The open usage sheet survives a position change. History replays saved samples and drains writes that arrive while a save is in flight.
… open chat

A startup flush was replacing the history file before the saved samples loaded, and an open chat never heard a later change to the composer meter's window, display, or position.
The row already pads for the strip. The collapsed transcript keeps its own inset only when the row has not reserved it.
…nges

A later account with the same reset no longer appends onto the previous account's samples. A reading that names no account leaves the saved series alone.
A reading restored at startup (the last-good windows) could land before the
saved history loaded, and the load let that one-point series replace the saved
one, so restarts emptied the graph. Readings before the load now queue and
replay onto the saved history, and clients get a push once it loads.

History is stored per provider account (saved account id, Antigravity login,
or Grok's email) and the graph shows the account read last, so a switch or
re-sign never continues another account's line. Full series thin their older
half instead of dropping the window's start, the store caps at 128 series and
4 MB, a corrupt file starts fresh, and a version 1 file carries over to the
first account read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… whole window

The x-axis spanned the window from start to reset, so a few hours of history
in a weekly window drew as a sliver beside an empty future and read as no
history at all. The axis now covers the recorded history (at least six hours,
or the window when shorter) and ends at now, with the even-pace line clipped
to that range.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep the usage-history reading after Antigravity usage was removed upstream.
…e was removed

The upstream removal dropped metadata.account. History still splits Claude and Codex by readingAccount, and the bot-home callback keeps the types mobile typecheck requires.
Upstream renamed that copy to removeMessageSavedData. The Traditional Chinese catalog still had the old key, which the localization check rejects.
…e-meter-position

Bring the meter's upstream merge and per-account usage history into this stack.
Flush waits for the saved file, then writes, so an early reading is kept with the samples already on disk.
# Conflicts:
#	mobile/src/i18n/locales/zh-Hant.json
# Conflicts:
#	mobile/src/i18n/locales/en.json
# Conflicts:
#	mobile/src/i18n/locales/en.json
# Conflicts:
#	mobile/src/i18n/locales/en.json
# Conflicts:
#	mobile/src/i18n/locales/en.json
# Conflicts:
#	mobile/src/i18n/locales/en.json
The collapse height came from the bar alone, so the strip above it was clipped for the length of the animation.
Cursor and ZCode put a hash in auth provenance. Dropping identities without @ merged every account into one graph.
A cached snapshot blocked every later accounts.list on hosts that have no accounts stream.
persistMirrored resolves after the local write, so the revision guard was dropping before the shell echoed the latest choice.
# Conflicts:
#	mobile/src/session/native-chat/MobileBotFirstScreen.tsx
#	mobile/src/session/native-chat/MobileNativeChatView.tsx
Keep the Duo dock on the bottom edge while taking the phone key dock and the setup update notice.
…-meter

Keep the composer meter beside the Duo width toggle, and the phone key dock on the bottom edge.
…e-meter-position

Keep the meter position choice with the phone key dock, the setup update notice, and the shell echo hold.
The position branch already holds a shell echo in the shared choice store, and a streamed accounts snapshot stays newer than the one-shot list.
…age-pace-marker

Keep the pace tick with the meter position, and read a saved usage choice when the shell has no echo.
…mpact

Keep the compact usage bar with the pace tick, and echo a saved meter position when the shell has no page write.
…sholds

Keep the pace colors with the compact bar, and put a page write back when a local persist races over it.
Keep the Duo session content, and read the renamed session toast.

This branch has not been deployed

No deployments
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