Skip to content

fix(ui): keep the model picker from vanishing - #4028

Merged
charlesvien merged 2 commits into
mainfrom
fix/model-picker-vanishing
Jul 31, 2026
Merged

fix(ui): keep the model picker from vanishing#4028
charlesvien merged 2 commits into
mainfrom
fix/model-picker-vanishing

Conversation

@charlesvien

Copy link
Copy Markdown
Member

Problem

Since #3821 the merged model/effort pill is the only model picker, and it hides itself whenever its thought-level option is missing. Two ways users lost it:

  • Selecting Kimi K3 (no reasoning levels) removes the thought option, so the pill vanishes with no way to switch back. lastUsedModel persists the pick, so every composer restores Kimi and hides itself, surviving restarts. Kimi sessions lose the pill too because SessionView only mounts it when a thought option exists.
  • A failed settings-store rehydration never sets _hasHydrated, so usePreviewConfig never fetches config and the pill never renders. Only clearing app storage fixed it.

Changes

  • ReasoningLevelSelector renders a model-only pill for effort-less models (Reasoning submenu and slider hidden, menu opens on Advanced) and shows a disabled Loading placeholder during first load instead of nothing.
  • SessionView mounts the pill when either the thought or model option exists.
  • settingsStore.onRehydrateStorage handles the error argument (same pattern as pendingTaskPromptStore) so a failed rehydrate cannot wedge _hasHydrated.

How did you test this?

  • New unit tests: effort-less model keeps the model picker and hides reasoning UI, stale effort label drops when switching to Kimi, loading placeholder renders, settings store marks hydrated on both success and failure.
  • pnpm --filter @posthog/ui test (285 files, 2419 tests) and tsc --noEmit pass.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@trunk-io

trunk-io Bot commented Jul 31, 2026

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 2fa37c4.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "mark settings hydrated after failed rehy..." | Re-trigger Greptile

@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 31, 2026
@stamphog

stamphog Bot commented Jul 31, 2026

Copy link
Copy Markdown

--

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 31, 2026
@charlesvien
charlesvien force-pushed the fix/model-picker-vanishing branch from cdb0eb6 to 1569527 Compare July 31, 2026 01:59
@charlesvien
charlesvien force-pushed the fix/model-picker-vanishing branch from 1569527 to 2fa37c4 Compare July 31, 2026 02:30
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 31, 2026

@github-actions github-actions 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.

Contained UI bug fix (model picker visibility + rehydration flag) with new unit tests covering every stated scenario; no risky-territory surface touched, and the author has STRONG familiarity with these exact files.

  • Author wrote 87% of the modified lines and has 25 merged PRs in these paths (familiarity STRONG).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 138L, 3F substantive, 260L/5F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1c-medium (260L, 5F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ d8556a9 · reviewed head 2fa37c4

@charlesvien
charlesvien merged commit d74080f into main Jul 31, 2026
37 of 38 checks passed
@charlesvien
charlesvien deleted the fix/model-picker-vanishing branch July 31, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant