Skip to content

fix: show favorites above recent models in the model picker#81

Merged
yuga-hashimoto merged 1 commit into
mainfrom
claude/model-list-favorites-display-h1b12q
Jul 25, 2026
Merged

fix: show favorites above recent models in the model picker#81
yuga-hashimoto merged 1 commit into
mainfrom
claude/model-list-favorites-display-h1b12q

Conversation

@yuga-hashimoto

Copy link
Copy Markdown
Owner

Summary

  • The model picker's "お気に入り" (favorites) section never rendered because the filter built its lookup key as "$provider.id/${it.id}" — Kotlin only interpolates the identifier immediately after $, so this evaluated provider.toString() and appended the literal text .id/... instead of provider.id. That key never matched anything in favoriteModelKeys, so favorited models fell through to the "最近利用" (recent) list or the full provider list instead of appearing in their own section above recent.
  • Fixed the key to "${provider.id}/${it.id}", matching the correct pattern already used elsewhere in the same file (hidden models, recent-entries dedup, and the star toggle state).
  • Also defensively capped the rendered recent list at 3 entries (MAX_RECENT_MODELS), matching the existing storage-side cap (SecureSettingsRepository.MAX_RECENT_MODELS / AppPreferencesRepository.selectModel's .take(3)), so any previously-stored longer list can't display more than 3.
  • Section order was already favorites-then-recent in the code; with the bug fixed, favorites now actually appear above recent as intended.

Test plan

  • Manual: star a model that is not in the recent list, reopen the model picker, confirm it appears under "お気に入り" above "最近利用".
  • Manual: select more than 3 distinct models in sequence, confirm only the 3 most recent appear under "最近利用".
  • Could not run a full Gradle build in this sandbox (no Android SDK available); change is a minimal, isolated fix to ModelAndRuntimePickerSheet.kt.

Generated by Claude Code

The favorites filter built its key as "$provider.id/..." without
brace-wrapping provider.id, so it interpolated Provider.toString()
instead of the id and never matched favoriteModelKeys, hiding the
favorites section entirely. Also cap the recent list at 3 entries
when rendering, matching the storage-side limit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPgh5Ax2U4XfUzysSPKcgH
@yuga-hashimoto
yuga-hashimoto marked this pull request as ready for review July 25, 2026 05:14
@yuga-hashimoto
yuga-hashimoto merged commit b05f03e into main Jul 25, 2026
1 of 3 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

API 34 emulator screenshot failure

Diagnostic logs were uploaded as the emulator-ui-diagnostics-30145319713 workflow artifact.

> Task :app:validateSigningDebug
> Task :app:writeDebugAppMetadata
> Task :app:writeDebugSigningConfigVersions
> Task :app:preDebugAndroidTestBuild SKIPPED
> Task :app:processDebugAndroidTestManifest
> Task :app:generateDebugAndroidTestBuildConfig
> Task :app:checkDebugAndroidTestAarMetadata
> Task :app:generateDebugAndroidTestResValues
> Task :app:mapDebugAndroidTestSourceSetPaths
> Task :app:generateDebugAndroidTestResources
> Task :app:javaPreCompileDebugAndroidTest
> Task :app:mergeDebugAndroidTestShaders
> Task :app:compileDebugAndroidTestShaders NO-SOURCE
> Task :app:generateDebugAndroidTestAssets UP-TO-DATE
> Task :app:mergeDebugAndroidTestResources
> Task :app:mergeDebugAndroidTestAssets
> Task :app:compressDebugAndroidTestAssets
> Task :app:desugarDebugAndroidTestFileDependencies
> Task :app:processDebugAndroidTestResources
> Task :app:checkDebugAndroidTestDuplicateClasses
> Task :app:mergeDebugAndroidTestJniLibFolders
> Task :app:kspDebugKotlin
> Task :app:mergeExtDexDebugAndroidTest
> Task :app:mergeLibDexDebugAndroidTest
> Task :app:mergeDebugAndroidTestNativeLibs NO-SOURCE
> Task :app:stripDebugAndroidTestDebugSymbols NO-SOURCE
> Task :app:validateSigningDebugAndroidTest
> Task :app:writeDebugAndroidTestSigningConfigVersions
> Task :app:mergeExtDexDebug
> Task :app:compileDebugKotlin
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/feature/chat/LiveTranscriptOverlay.kt:107:44 'val Icons.Filled.Send: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.Send.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/feature/chat/OpenCodeChatScreen.kt:678:5 'fun ClickableText(text: AnnotatedString, modifier: Modifier = ..., style: TextStyle = ..., softWrap: Boolean = ..., overflow: TextOverflow = ..., maxLines: Int = ..., onTextLayout: (TextLayoutResult) -> Unit = ..., onClick: (Int) -> Unit): Unit' is deprecated. Use Text or BasicText and pass an AnnotatedString that contains a LinkAnnotation.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/feature/search/CommandPalette.kt:103:46 'val Icons.Filled.Chat: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.Chat.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/feature/settings/SettingsScreen.kt:132:34 'fun Modifier.menuAnchor(): Modifier' is deprecated. Use overload that takes MenuAnchorType and enabled parameters.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/feature/settings/SettingsScreenV2.kt:191:42 'val Icons.Filled.Chat: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.Chat.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/feature/settings/SettingsScreenV2.kt:207:42 'val Icons.Filled.Chat: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.Chat.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/feature/settings/SettingsScreenV2.kt:214:42 'val Icons.Filled.Chat: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.Chat.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/ui/components/FileTypeIcon.kt:82:52 'val Icons.Filled.InsertDriveFile: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.InsertDriveFile.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/ui/theme/Theme.kt:145:20 'var statusBarColor: Int' is deprecated. Deprecated in Java.
w: file:///home/runner/work/opencode-android/opencode-android/app/src/main/java/com/opencode/android/ui/theme/Theme.kt:146:20 'var navigationBarColor: Int' is deprecated. Deprecated in Java.

> Task :app:compileDebugJavaWithJavac
> Task :app:dexBuilderDebug
> Task :app:mergeDebugGlobalSynthetics
> Task :app:processDebugJavaRes
> Task :app:bundleDebugClassesToCompileJar
> Task :app:mergeProjectDexDebug
> Task :app:mergeDebugJavaResource
> Task :app:kspDebugAndroidTestKotlin
> Task :app:packageDebug
> Task :app:createDebugApkListingFileRedirect
> Task :app:assembleDebug

> Task :app:compileDebugAndroidTestKotlin FAILED
e: file:///home/runner/work/opencode-android/opencode-android/app/src/androidTest/java/com/opencode/android/ui/UiScreenshotInstrumentedTest.kt:139:29 No value passed for parameter 'workspaces'.
e: file:///home/runner/work/opencode-android/opencode-android/app/src/androidTest/java/com/opencode/android/ui/UiScreenshotInstrumentedTest.kt:139:29 No value passed for parameter 'selectedWorkspacePath'.
e: file:///home/runner/work/opencode-android/opencode-android/app/src/androidTest/java/com/opencode/android/ui/UiScreenshotInstrumentedTest.kt:139:29 No value passed for parameter 'onSelectProject'.
e: file:///home/runner/work/opencode-android/opencode-android/app/src/androidTest/java/com/opencode/android/ui/UiScreenshotInstrumentedTest.kt:276:17 No value passed for parameter 'wakeWordEnabled'.
e: file:///home/runner/work/opencode-android/opencode-android/app/src/androidTest/java/com/opencode/android/ui/UiScreenshotInstrumentedTest.kt:276:17 No value passed for parameter 'onWakeWordChange'.
gradle/actions: Writing build results to /home/runner/work/_temp/.gradle-actions/build-results/emulator-1784956393203.json

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugAndroidTestKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 14m 35s
63 actionable tasks: 63 executed
OK: killing emulator, bye bye

OK

yuga-hashimoto pushed a commit that referenced this pull request Jul 25, 2026
`captureReviewedScreens` asserted that a node with the text "project" — the
composer's workspace chip — was displayed on the empty chat screen. The paseo
composer redesign (5e290b1) narrowed that button row to attach / model /
thinking … mic / send and dropped the workspace chip; `CompactWorkspaceButton`
has been dead code ever since, so the assertion could never pass again. The
emulator screenshot job has failed identically on every PR since (#80, #81,
#82, #83 all show the same `UiScreenshotInstrumentedTest.kt:103` failure and
were merged anyway).

Assert the composer's own placeholder instead, which keeps the screen's intent
covered — 02-runtime-not-ready already asserts the same text is *absent* while
the runtime is not ready, so the two cases now check the same element from
both sides.

Verified `:app:compileDebugAndroidTestKotlin`. The emulator run itself could
not be reproduced locally (no emulator in this environment).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L3eN8AmoAcBDCTEeMTY3ba
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.

2 participants