-
Notifications
You must be signed in to change notification settings - Fork 27
🤖 Add command palette control for thinking effort #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
44f46b4 to
221f1b1
Compare
|
I'd like to make this a direct key-bind -- we should probably talk about how to standardize the interface |
fbaae0d to
1944979
Compare
ammario
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left comments if we go this approach but still think a direct keybind that toggles between last thinking mode and off is probably best UX.
src/components/ChatInput.tsx
Outdated
| }; | ||
|
|
||
| window.addEventListener("cmux:setThinkingLevel", handler as EventListener); | ||
| return () => window.removeEventListener("cmux:setThinkingLevel", handler as EventListener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this duplication / coupling with the underlying implementation of usePersistedState, which has its own listening system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Fixed by using updatePersistedState() utility and enabling listener in ThinkingProvider. The event handler now only handles UI feedback (toast), not state management.
| detail: { workspaceId, level: normalized, source: "command-palette" }, | ||
| }) | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here re coupling
1944979 to
07485b3
Compare
Addressed Review CommentsFixed the coupling issues with Changes Made
Result
All checks passing ✅ |
src/hooks/usePersistedState.ts
Outdated
| } | ||
|
|
||
| // Dispatch custom event for same-tab synchronization | ||
| const customEvent = new CustomEvent(`storage-change:${key}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constant duplication
src/App.tsx
Outdated
| // Dispatch toast notification event for UI feedback | ||
| if (typeof window !== "undefined") { | ||
| window.dispatchEvent( | ||
| new CustomEvent("cmux:thinkingLevelToast", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constant duplication
src/App.tsx
Outdated
| } | ||
|
|
||
| const normalized = THINKING_LEVELS.includes(level) ? level : "off"; | ||
| const key = `thinkingLevel:${workspaceId}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constant duplication again -- common LLM problem needs to be actively prompted against
| import type { WorkspaceSelection } from "./components/ProjectSidebar"; | ||
| import ProjectSidebar from "./components/ProjectSidebar"; | ||
| import NewWorkspaceModal from "./components/NewWorkspaceModal"; | ||
| import { AIView } from "./components/AIView"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sidenote: App.tsx is becoming a monster but that can be handled elsewhere
✅ All Review Comments Addressed1. Coupling with
|
|
In reply to review comment on src/components/ChatInput.tsx: ✅ Fixed: Removed the coupling with usePersistedState internals. The event handler no longer calls |
|
In reply to review comment on src/App.tsx line 315: ✅ Fixed: Replaced the manual localStorage/event dispatch with |
|
In reply to review comments about constant duplication: ✅ Fixed: All magic strings have been extracted to constants:
Single source of truth established for all string literals. |
3a54a68 to
c08e75b
Compare
Expose command palette action to set thinking effort per workspace. Use shared storage helpers to persist levels and dispatch toast events. Add custom event constants to replace literals across UI code.
c08e75b to
5ea61e0
Compare
Summary
Testing
Generated with
cmux