Skip to content

fix(web): hoist favorited legacy models to the top of the model picker - #11933

Open
TonybynMp4 wants to merge 3 commits into
pingdotgg:mainfrom
TonybynMp4:fix/web-hoist-favorited-legacy-models
Open

TonybynMp4 wants to merge 3 commits into
pingdotgg:mainfrom
TonybynMp4:fix/web-hoist-favorited-legacy-models

Conversation

@TonybynMp4

@TonybynMp4 TonybynMp4 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Problem

Favoriting a legacy model (e.g. Claude Opus 4.8) was supposed to hoist it to the top of the model picker, but it stayed buried in the collapsed "Legacy models" section. The favorites-first sort was correct, but the picker then re-split the list on isLegacy alone, so any favorited legacy model was pulled back down into the legacy group — defeating the hoist.

Closes #11925

Fix

  • Extract a pure, tested partitionLegacyModels helper in modelOrdering.ts that splits an already-sorted list into the main list and the collapsed legacy group, but keeps a favorited legacy model in the main list. Unfavoriting returns it to the legacy group.
  • Use that helper in ModelPickerContent so the favorite hoist wins over the legacy split.
  • Don't auto-expand the legacy group when the active model is a favorite — it's hoisted into the main list, so expanding the legacy section for it would open an unrelated group.

Scope: web/desktop only. Mobile has no model favorites, and native iOS was already fixed separately.

Before/After:
image

image

Tests

vp test run apps/web/src/modelOrdering.test.ts — 7 passed, covering: favorited legacy model stays in the main list, unfavoriting returns it to legacy, empty list, explicit isLegacy: false, and all-legacy-favorited.

Summary by CodeRabbit

  • New Features

    • Favorited legacy models now remain in the main model list instead of the legacy section.
    • Legacy models are automatically expanded only when the active model is not favorited.
  • Bug Fixes

    • Improved model grouping so favorite status is consistently respected.
  • Tests

    • Added coverage for legacy model partitioning, favorites, empty lists, and non-legacy models.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 15, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at ae4ddbc

Macroscope's review found this PR approvable — This is a narrowly scoped model-picker bug fix that keeps favorited legacy models in the existing main list while preserving collapsed handling for other legacy models. The implementation is small, focused, and covered by targeted tests, with no schema, deployment, security, billing, default-setting, or static-analysis changes.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 0a3867fb-bcee-4d78-902d-23cef3b922ff

📥 Commits

Reviewing files that changed from the base of the PR and between 7235701 and ae4ddbc.

📒 Files selected for processing (3)
  • apps/web/src/components/chat/ModelPickerContent.tsx
  • apps/web/src/modelOrdering.test.ts
  • apps/web/src/modelOrdering.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The model picker now keeps favorited legacy models in the main favorites-sorted list. Unfavorited legacy models remain in the Legacy section. A new partition utility implements this behavior, with tests covering its cases.

Changes

Legacy favorite partitioning

Layer / File(s) Summary
Legacy partition utility and tests
apps/web/src/modelOrdering.ts, apps/web/src/modelOrdering.test.ts
Adds partitionLegacyModels and its LegacyPartitionItem type. Tests cover favorite status, empty input, and explicit legacy flags.
Model picker integration
apps/web/src/components/chat/ModelPickerContent.tsx
Uses favorite-aware partitioning for the Legacy section. The active legacy model expands that section only when it is not favorited.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to ae4dd

The legacy favorite partitioning change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change meets the coding requirements in #11925. partitionLegacyModels keeps a favorited legacy model in current and moves an unfavorited legacy model to legacy. ModelPickerContent uses thi…
Out of Scope Changes check ✅ Passed The changes stay within the linked issue scope. They modify the web model picker and its web ordering tests. The helper is supporting implementation for the legacy and favorites behavior. No mobile or…
Title check ✅ Passed The title clearly and concisely describes the main change: favorited legacy models are moved to the top of the model picker.
Description check ✅ Passed The description clearly explains the problem, fix, scope, UI impact, screenshots, linked issue, and test coverage. It does not use every template heading and omits the checklist, but it provides the r…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

TonybynMp4 and others added 3 commits September 15, 2026 23:51
@TonybynMp4
TonybynMp4 force-pushed the fix/web-hoist-favorited-legacy-models branch from ae4ddbc to 723ccff Compare September 15, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Favorited legacy models stay buried in the Legacy section instead of hoisting to the top (web)

1 participant