Repository navigation
Fix mobile chat navigation and AI credit options - #1615
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening a resource link in mobile AI chat dismisses the full-screen panel, including when that resource is already open behind it. Desktop chat stays open and reopening mobile chat retains the conversation. The mobile history guard checks the URL to avoid navigating back from the destination.
AI credits now appear only inside AI Chat options, alongside a Get more credits link to the configured portal. The balance shows fractional credits and distinguishes monthly allowance from purchased credits. Opening options refreshes the account balance without caching.
Hosted stream completion, cancellation and errors notify the balance hook. This fixes the missed refresh when the AI SDK cancels its response reader. One delayed refresh allows server metering to settle, without ongoing polling.
Validation: all 8 Chromium mobile-chat tests passed with zero retries; 7 focused credit/stream/hook unit tests passed; app and E2E typechecks and full workspace lint/format checks passed. The earlier resource-link change also passed 6 focused component/history tests. Account/provider responses are mocked; live billing and physical mobile keyboards were not exercised.