Skip to content

Fix model menu - #2157

Merged
qdaxb merged 2 commits into
mainfrom
fix_model_menu
Jul 23, 2026
Merged

qdaxb merged 2 commits into
mainfrom
fix_model_menu

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Updated the desktop model selector to show models from all families directly in a single submenu, grouped by family.
  • Bug Fixes

    • Improved model selector navigation by removing the separate family submenu step.
    • Preserved visibility of the currently selected reasoning/controls while browsing models.
  • Tests

    • Updated Chat input and model selector tests to match the revised shared submenu behavior and validate options for multiple families.
  • Chores

    • Reformatted the desktop app’s Tauri configuration arrays for consistency (no functional change).

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d7f616a-8ab7-4737-9ac3-8c3a8725ab04

📥 Commits

Reviewing files that changed from the base of the PR and between acd5772 and 5f80d7d.

📒 Files selected for processing (4)
  • wework/src-tauri/tauri.conf.json
  • wework/src/components/chat/ChatInput.test.tsx
  • wework/src/components/chat/composer/ModelSelector.test.tsx
  • wework/src/components/chat/composer/ModelSelector.tsx

📝 Walkthrough

Walkthrough

The desktop model selector now renders all model families and their options in one submenu, removing family submenu state and positioning logic. Related tests were updated, and Tauri configuration arrays were reformatted without changing their values.

Changes

Desktop model selector

Layer / File(s) Summary
Inline model submenu rendering
wework/src/components/chat/composer/ModelSelector.tsx
Removes desktop family submenu state and positioning logic, adds a minimum panel height, and renders grouped models from all families inline.
Model submenu test coverage
wework/src/components/chat/ChatInput.test.tsx, wework/src/components/chat/composer/ModelSelector.test.tsx
Updates assertions to verify family labels and model options appear directly in the second-level submenu.

Tauri configuration formatting

Layer / File(s) Summary
Compact Tauri array formatting
wework/src-tauri/tauri.conf.json
Reformats asset protocol, external binary, and resource arrays without changing their entries.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the changes, but it is too generic to clearly describe the submenu behavior update. Rename it to something more specific, like "Simplify desktop model submenu to show all families".
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_model_menu

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
wework/src-tauri/tauri.conf.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@qdaxb
qdaxb merged commit 5af2ddf into main Jul 23, 2026
6 of 8 checks passed
@qdaxb
qdaxb deleted the fix_model_menu branch July 23, 2026 14:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
wework/src/components/chat/composer/ModelSelector.tsx (1)

315-330: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Recompute model submenu layout when model content can change.

updateSubmenuLayout only re-runs when activeDesktopSubmenu, open, or updateSubmenuLayout changes, so a models refresh while the submenu is already open keeps using the old submenuHeight/submenuScrollHeight. Include the model-content values that affect the submenu size, or split the effect into one that watches that content separately.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/chat/composer/ModelSelector.tsx` around lines 315 -
330, Update the useLayoutEffect that positions the model submenu so it also
re-runs when model content affecting its dimensions changes, such as the model
list or related loading/refresh state. Preserve the existing
activeDesktopSubmenu, open, and updateSubmenuLayout handling while ensuring an
open models submenu recalculates its height and scroll height after refreshes.
🧹 Nitpick comments (1)
wework/src/components/chat/composer/ModelSelector.test.tsx (1)

175-196: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Good coverage of inline grouping; consider re-adding viewport-clamping coverage for the (now larger) unified submenu.

The removed test previously verified that the family submenu stays above the viewport bottom when content grows. Now that the "models" submenu inlines every family's model list (larger/variable content), that clamping behavior is exercised by the same updateSubmenuLayout code path but is no longer covered by a test.

Do you want me to draft a regression test that mocks getBoundingClientRect/scrollHeight for the multi-family submenu to confirm it stays clamped within the viewport?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/chat/composer/ModelSelector.test.tsx` around lines 175
- 196, Add regression coverage alongside the “shows models from every family in
the second-level menu” test by mocking the unified submenu’s
getBoundingClientRect and scrollHeight with content extending past the viewport.
Assert the updateSubmenuLayout behavior clamps the submenu’s bottom position
within the viewport, while preserving the existing multi-family model
assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@wework/src/components/chat/composer/ModelSelector.tsx`:
- Around line 315-330: Update the useLayoutEffect that positions the model
submenu so it also re-runs when model content affecting its dimensions changes,
such as the model list or related loading/refresh state. Preserve the existing
activeDesktopSubmenu, open, and updateSubmenuLayout handling while ensuring an
open models submenu recalculates its height and scroll height after refreshes.

---

Nitpick comments:
In `@wework/src/components/chat/composer/ModelSelector.test.tsx`:
- Around line 175-196: Add regression coverage alongside the “shows models from
every family in the second-level menu” test by mocking the unified submenu’s
getBoundingClientRect and scrollHeight with content extending past the viewport.
Assert the updateSubmenuLayout behavior clamps the submenu’s bottom position
within the viewport, while preserving the existing multi-family model
assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8729f1ab-8500-426e-83ee-76d453452449

📥 Commits

Reviewing files that changed from the base of the PR and between 1dd65a1 and acd5772.

📒 Files selected for processing (4)
  • wework/src-tauri/tauri.conf.json
  • wework/src/components/chat/ChatInput.test.tsx
  • wework/src/components/chat/composer/ModelSelector.test.tsx
  • wework/src/components/chat/composer/ModelSelector.tsx

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.

1 participant