Skip to content

Commit 3456c67

Browse files
author
ci-bot
committed
fix context menu and model selection menu
1 parent 50b39dd commit 3456c67

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

libs/remix-ui/remix-ai-assistant/src/components/contextOptMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface GroupListMenuProps {
66
choice: AiContextType | AiAssistantType | any
77
setShowOptions: Dispatch<React.SetStateAction<boolean>>
88
groupList: groupListType[]
9+
themeTracker?: any
910
}
1011

1112
export default function GroupListMenu(props: GroupListMenuProps) {
@@ -15,7 +16,7 @@ export default function GroupListMenu(props: GroupListMenuProps) {
1516
{props.groupList.map((item, index) => (
1617
<button
1718
key={`${item.label}-${index}`}
18-
className="btn btn-light"
19+
className={`btn btn-light ${props.themeTracker?.name === 'Dark' ? 'border border-dark' : ''}`}
1920
data-id={item.dataId}
2021
onClick={() => {
2122
props.setChoice(item.stateValue)

libs/remix-ui/remix-ai-assistant/src/components/prompt.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const PromptArea: React.FC<PromptAreaProps> = ({
118118
<div className="btn-group btn-group-sm" role="group">
119119
<button
120120
type="button"
121-
className={`btn ${aiMode === 'ask' ? 'btn-primary' : 'btn-outline-secondary'} px-2`}
121+
className={`btn btn-sm ${aiMode === 'ask' ? 'btn-primary' : 'btn-outline-secondary'} px-2`}
122122
onClick={() => {
123123
setAiMode('ask')
124124
_paq.push(['trackEvent', 'remixAI', 'ModeSwitch', 'ask'])
@@ -129,7 +129,7 @@ export const PromptArea: React.FC<PromptAreaProps> = ({
129129
</button>
130130
<button
131131
type="button"
132-
className={`btn ${aiMode === 'edit' ? 'btn-primary' : 'btn-outline-secondary'} px-2`}
132+
className={`btn btn-sm ${aiMode === 'edit' ? 'btn-primary' : 'btn-outline-secondary'} px-2`}
133133
onClick={() => {
134134
setAiMode('edit')
135135
_paq.push(['trackEvent', 'remixAI', 'ModeSwitch', 'edit'])

libs/remix-ui/remix-ai-assistant/src/components/remix-ui-remix-ai-assistant.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export const RemixUiRemixAiAssistant = React.forwardRef<
5252
const [selectedModel, setSelectedModel] = useState<string | null>(null)
5353
const [isOllamaFailureFallback, setIsOllamaFailureFallback] = useState(false)
5454
const [aiMode, setAiMode] = useState<'ask' | 'edit'>('ask')
55+
const [themeTracker, setThemeTracker] = useState(null)
5556

5657
const historyRef = useRef<HTMLDivElement | null>(null)
5758
const modelBtnRef = useRef(null)
@@ -205,6 +206,15 @@ export const RemixUiRemixAiAssistant = React.forwardRef<
205206
// fetchAssistantChoice()
206207
// }, [props.plugin])
207208

209+
useEffect(() => {
210+
props.plugin.on('theme', 'themeChanged', (theme) => {
211+
setThemeTracker(theme)
212+
})
213+
return () => {
214+
props.plugin.off('theme', 'themeChanged')
215+
}
216+
})
217+
208218
// bubble messages up to parent
209219
useEffect(() => {
210220
props.onMessagesChange?.(messages)
@@ -705,6 +715,7 @@ export const RemixUiRemixAiAssistant = React.forwardRef<
705715
setChoice={handleModelSelection}
706716
setShowOptions={setShowModelOptions}
707717
choice={selectedModel}
718+
themeTracker={themeTracker}
708719
groupList={availableModels.map(model => ({
709720
label: model,
710721
bodyText: `Use ${model} model`,

0 commit comments

Comments
 (0)