Skip to content

Extract slash model suggestion filtering into app settings helper#160

Merged
juliusmarminge merged 1 commit intomainfrom
feature/slash-model-options-filter
Mar 3, 2026
Merged

Extract slash model suggestion filtering into app settings helper#160
juliusmarminge merged 1 commit intomainfrom
feature/slash-model-options-filter

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Mar 3, 2026

Summary

  • Move /model suggestion filtering logic into a shared getSlashModelOptions helper in appSettings.
  • Update ChatView to consume pre-filtered slash model options instead of in-component filtering.
  • Add tests covering slash model option inclusion for custom models and query-based filtering across built-in/custom entries.

Testing

  • Added unit tests in apps/web/src/appSettings.test.ts for getSlashModelOptions:
  • Confirms saved custom model slugs appear in /model suggestions.
  • Confirms query filtering matches by slug/name and returns expected model(s).
  • Not run: bun lint
  • Not run: bun typecheck

Note

Low Risk
Low risk refactor that centralizes /model suggestion filtering logic and adds unit coverage; behavior should remain the same aside from any subtle query-matching differences.

Overview
Moves /model slash-command model suggestion generation/filtering out of ChatView into a new getSlashModelOptions helper in appSettings, reusing getAppModelOptions and applying query-based filtering there.

Updates ChatView to memoize and consume these pre-filtered options instead of performing inline slug/name filtering, and adds vitest coverage ensuring saved custom models appear in suggestions and that query filtering works across built-in and custom entries.

Written by Cursor Bugbot for commit cdc856f. This will update automatically on new commits. Configure here.

Note

Extract filtering for /model composer suggestions into apps/web/src/appSettings.ts:getSlashModelOptions to include custom slugs and query matching

Add getSlashModelOptions that returns query-filtered model options, and update ChatView to use it for /model suggestions; add tests for custom model inclusion and filtering in appSettings.test.ts.

📍Where to Start

Start with getSlashModelOptions in appSettings.ts, then review its use in ChatView in ChatView.tsx, and finally the tests in appSettings.test.ts.

Macroscope summarized cdc856f.

- add `getSlashModelOptions` to centralize `/model` suggestion filtering
- include custom saved model slugs in slash-command suggestions
- update ChatView to consume shared helper and add focused tests
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 3, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/slash-model-options-filter

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

@juliusmarminge juliusmarminge merged commit 09b32ac into main Mar 3, 2026
4 checks passed
@juliusmarminge juliusmarminge deleted the feature/slash-model-options-filter branch March 3, 2026 17:31
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