Skip to content

Let the Thinking section be collapsed while the model is still thinking#828

Open
salmanmkc wants to merge 363 commits into
google-ai-edge:mainfrom
salmanmkc:salmanmkc/collapsible-thinking
Open

Let the Thinking section be collapsed while the model is still thinking#828
salmanmkc wants to merge 363 commits into
google-ai-edge:mainfrom
salmanmkc:salmanmkc/collapsible-thinking

Conversation

@salmanmkc

@salmanmkc salmanmkc commented May 12, 2026

Copy link
Copy Markdown

Fixes #534.

The Thinking expander was forcing isExpanded = true on every recomposition while inProgress was true, so tapping the header to collapse it had no visible effect until the model stopped thinking. Initialize the state from inProgress once with remember instead, the section still auto-opens when the thinking message first appears, but the user can collapse it whenever.

Test plan

  • ./gradlew :app:compileDebugKotlin passes.
  • Logic check: first composition runs with inProgress = true, so remember { mutableStateOf(inProgress) } starts expanded. Subsequent recompositions don't re-init the state, so user taps stick.

Tested like this:

This is with the fix (Verified locally on an emulator using a temporary debug injection that adds a ChatMessageThinking(inProgress = true) on chat open (not part of this PR, used only for repro). With the fix applied, tapping the "Show thinking" header while inProgress is still true correctly collapses the section. Without the fix, the tap had no effect until streaming finished.)

ChatMessageThinking(
        content = "Hmm, let me think about this. The user is asking about a copy button...",
        inProgress = true,
      ),

Before the fix, the behavior is broken, we couldn't collapse:

CleanShot.2026-05-12.at.03.40.44.mp4

After the fix, now we can collapse:

CleanShot.2026-05-12.at.03.35.13.mp4

jinjingforever and others added 30 commits August 20, 2025 16:03
PiperOrigin-RevId: 798305739
PiperOrigin-RevId: 798306012
PiperOrigin-RevId: 799245337
PiperOrigin-RevId: 800107395
PiperOrigin-RevId: 800516780
PiperOrigin-RevId: 800638495
PiperOrigin-RevId: 802190892
…d allowlist" dialog dismissable.

PiperOrigin-RevId: 803496612
PiperOrigin-RevId: 805432594
- Hide keyboard after sending a prompt.
- Scroll to bottom when a new prompt is sent.
- Show warning when user tries to import a web model.

PiperOrigin-RevId: 805909987
PiperOrigin-RevId: 807856963
yishuangP and others added 29 commits May 5, 2026 13:15
PiperOrigin-RevId: 907029492
…y using deterministic short IDs.

PiperOrigin-RevId: 907072316
PiperOrigin-RevId: 907086171
PiperOrigin-RevId: 907174331
PiperOrigin-RevId: 907388189
PiperOrigin-RevId: 908801411
PiperOrigin-RevId: 910146658
- Added `SystemPromptRepository` to persist custom prompts via DataStore.
- Added `SystemPromptHelper` to resolve the effective prompt (custom override vs. default fallback)

PiperOrigin-RevId: 910346906
PiperOrigin-RevId: 910995322
PiperOrigin-RevId: 911749453
…iongemma-typo

fix: correct FunctionGemma typo in README
…mini app experience.

Key Changes:
- **Smoother Token Streaming**: Replaced the token-by-token display with a fade-in effect that reveals buffered chunks of tokens during model response streaming.
- **Updated Scrolling Behavior**: Disabled auto-scrolling. Introduced a "Jump to bottom" button that appears whenever the content area is scrollable.
- **Cleaner Model Response**: Remove the "bubble" around the model response text and make text full width.
- **Optimized Screen Space (Chat Only)**: When a new user prompt is sent, the view now automatically scrolls to align the prompt with the top edge of the screen, maximizing the visible area for the incoming response.

PiperOrigin-RevId: 912129993
…_current_date_and_time" intents.

PiperOrigin-RevId: 912136923
PiperOrigin-RevId: 913067368
PiperOrigin-RevId: 913755747
…hat. Introduces a new `schedule_notification` action in IntentHandler.

PiperOrigin-RevId: 913782888
…fications in Agent Chat.

PiperOrigin-RevId: 913888328
…cations scheduled via the "schedule-notification" skill to open the LLM Agent Chat screen with a pre-filled query.

PiperOrigin-RevId: 913949881
The Thinking expander auto-expanded on every recomposition while the
model was still streaming its thoughts, so tapping the header to
collapse it had no effect until streaming finished. Initialize the
expanded state from inProgress once via remember instead of forcing it
true on every recomposition, so the section still auto-opens when the
message first shows up but the user can collapse it at any time.
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.

Thinking should stay collapsed or be collapsible