Skip to content

Commit 255dc06

Browse files
UN-1725 [FIX] Remove CheckableTag enabled/disabled toggle from LLM profiles (#1704)
Remove the enabled/disabled toggle feature from prompt card LLM profiles as it caused newly added profiles to appear disabled by default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent e25029d commit 255dc06

File tree

3 files changed

+47
-106
lines changed

3 files changed

+47
-106
lines changed

frontend/src/components/custom-tools/prompt-card/PromptCard.css

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
.prompt-info {
167167
display: flex;
168168
align-items: center;
169-
justify-content: space-between;
169+
justify-content: flex-end;
170170
}
171171

172172
.prompt-card-llm-container {
@@ -252,16 +252,6 @@
252252
font-size: 18px;
253253
}
254254

255-
.prompt-output-icon-enabled {
256-
color: #52c41a;
257-
margin-left: 5px;
258-
}
259-
260-
.prompt-output-icon-disabled {
261-
color: #babbbc;
262-
margin-left: 5px;
263-
}
264-
265255
.chunk-highlight {
266256
background-color: yellow;
267257
}

frontend/src/components/custom-tools/prompt-card/PromptCardItems.jsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ function PromptCardItems({
7676
const [expandCard, setExpandCard] = useState(true);
7777
const [llmProfileDetails, setLlmProfileDetails] = useState([]);
7878
const [openIndexProfile, setOpenIndexProfile] = useState(null);
79-
const [enabledProfiles, setEnabledProfiles] = useState(
80-
llmProfiles.map((profile) => profile.profile_id)
81-
);
8279
const [isIndexOpen, setIsIndexOpen] = useState(false);
8380
const isNotSingleLlmProfile = llmProfiles.length > 1;
8481
const divRef = useRef(null);
@@ -163,13 +160,10 @@ function PromptCardItems({
163160
.map((profile) => ({
164161
...profile,
165162
isDefault: profile?.profile_id === selectedLlmProfileId,
166-
isEnabled: enabledProfiles.includes(profile?.profile_id),
167163
}))
168164
.sort((a, b) => {
169165
if (a?.isDefault) return -1; // Default profile comes first
170166
if (b?.isDefault) return 1;
171-
if (a?.isEnabled && !b?.isEnabled) return -1; // Enabled profiles come before disabled
172-
if (!a?.isEnabled && b?.isEnabled) return 1;
173167
return 0;
174168
})
175169
);
@@ -181,7 +175,7 @@ function PromptCardItems({
181175

182176
useEffect(() => {
183177
getAdapterInfo(adapters);
184-
}, [llmProfiles, selectedLlmProfileId, enabledProfiles]);
178+
}, [llmProfiles, selectedLlmProfileId]);
185179

186180
return (
187181
<Card
@@ -208,7 +202,6 @@ function PromptCardItems({
208202
setIsEditingTitle={setIsEditingTitle}
209203
expandCard={expandCard}
210204
setExpandCard={setExpandCard}
211-
enabledProfiles={enabledProfiles}
212205
spsLoading={spsLoading}
213206
handleSpsLoading={handleSpsLoading}
214207
enforceType={enforceType}
@@ -315,8 +308,6 @@ function PromptCardItems({
315308
spsLoading={spsLoading}
316309
llmProfileDetails={llmProfileDetails}
317310
setOpenIndexProfile={setOpenIndexProfile}
318-
enabledProfiles={enabledProfiles}
319-
setEnabledProfiles={setEnabledProfiles}
320311
isNotSingleLlmProfile={isNotSingleLlmProfile}
321312
setIsIndexOpen={setIsIndexOpen}
322313
enforceType={enforceType}

frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx

Lines changed: 45 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import {
2-
CheckCircleOutlined,
32
DatabaseOutlined,
4-
ExclamationCircleFilled,
53
InfoCircleOutlined,
64
PlayCircleFilled,
75
PlayCircleOutlined,
@@ -18,7 +16,6 @@ import {
1816
Typography,
1917
} from "antd";
2018
import { motion, AnimatePresence } from "framer-motion";
21-
import CheckableTag from "antd/es/tag/CheckableTag";
2219
import { useState } from "react";
2320

2421
import {
@@ -60,8 +57,6 @@ function PromptOutput({
6057
handleSelectDefaultLLM,
6158
llmProfileDetails,
6259
setOpenIndexProfile,
63-
enabledProfiles,
64-
setEnabledProfiles,
6560
isNotSingleLlmProfile,
6661
setIsIndexOpen,
6762
enforceType,
@@ -97,14 +92,6 @@ function PromptOutput({
9792
</div>
9893
);
9994

100-
const handleTagChange = (checked, profileId) => {
101-
setEnabledProfiles((prevState) =>
102-
checked
103-
? [...prevState, profileId]
104-
: prevState.filter((id) => id !== profileId)
105-
);
106-
};
107-
10895
const handleTable = (profileId, promptOutputData) => {
10996
if (tableSettings?.document_type !== "rent_rolls")
11097
return <TableOutput output={promptOutputData?.output} />;
@@ -254,7 +241,6 @@ function PromptOutput({
254241
const promptId = promptDetails?.prompt_id;
255242
const docId = selectedDoc?.document_id;
256243
const profileId = profile?.profile_id;
257-
const isChecked = enabledProfiles.includes(profileId);
258244
const tokenUsageId = promptId + "__" + docId + "__" + profileId;
259245
let promptOutputData = {};
260246
if (promptOutputs && Object.keys(promptOutputs)) {
@@ -383,77 +369,53 @@ function PromptOutput({
383369
</Typography.Text>
384370
</div>
385371
<div className="prompt-info">
386-
<div>
387-
<CheckableTag
388-
checked={isChecked}
389-
onChange={(checked) =>
390-
handleTagChange(checked, profileId)
372+
<Tooltip title="Run LLM for current document">
373+
<Button
374+
size="small"
375+
type="text"
376+
className="prompt-card-action-button"
377+
onClick={() =>
378+
handleRun(
379+
PROMPT_RUN_TYPES.RUN_ONE_PROMPT_ONE_LLM_ONE_DOC,
380+
promptDetails?.prompt_id,
381+
profileId,
382+
selectedDoc?.document_id
383+
)
391384
}
392-
disabled={isPublicSource}
393-
className={isChecked ? "checked" : "unchecked"}
385+
disabled={isPromptLoading || isPublicSource}
394386
>
395-
{isChecked ? (
396-
<span>
397-
Enabled
398-
<CheckCircleOutlined className="prompt-output-icon-enabled" />
399-
</span>
400-
) : (
401-
<span>
402-
Disabled
403-
<ExclamationCircleFilled className="prompt-output-icon-disabled" />
404-
</span>
405-
)}
406-
</CheckableTag>
407-
</div>
408-
<div>
409-
<Tooltip title="Run LLM for current document">
410-
<Button
411-
size="small"
412-
type="text"
413-
className="prompt-card-action-button"
414-
onClick={() =>
415-
handleRun(
416-
PROMPT_RUN_TYPES.RUN_ONE_PROMPT_ONE_LLM_ONE_DOC,
417-
promptDetails?.prompt_id,
418-
profileId,
419-
selectedDoc?.document_id
420-
)
421-
}
422-
disabled={isPromptLoading || isPublicSource}
423-
>
424-
<PlayCircleOutlined className="prompt-card-actions-head" />
425-
</Button>
426-
</Tooltip>
427-
<Tooltip title="Run LLM for all documents">
428-
<Button
429-
size="small"
430-
type="text"
431-
className="prompt-card-action-button"
432-
onClick={() =>
433-
handleRun(
434-
PROMPT_RUN_TYPES.RUN_ONE_PROMPT_ONE_LLM_ALL_DOCS,
435-
promptDetails?.prompt_id,
436-
profileId,
437-
null
438-
)
439-
}
440-
disabled={isPromptLoading || isPublicSource}
441-
>
442-
<PlayCircleFilled className="prompt-card-actions-head" />
443-
</Button>
444-
</Tooltip>
445-
<PromptOutputExpandBtn
446-
promptId={promptDetails?.prompt_id}
447-
llmProfiles={llmProfileDetails}
448-
enforceType={enforceType}
449-
tableSettings={tableSettings}
450-
displayLlmProfile={true}
451-
promptOutputs={promptOutputs}
452-
promptRunStatus={promptRunStatus}
453-
openExpandModal={openExpandModal}
454-
setOpenExpandModal={setOpenExpandModal}
455-
/>
456-
</div>
387+
<PlayCircleOutlined className="prompt-card-actions-head" />
388+
</Button>
389+
</Tooltip>
390+
<Tooltip title="Run LLM for all documents">
391+
<Button
392+
size="small"
393+
type="text"
394+
className="prompt-card-action-button"
395+
onClick={() =>
396+
handleRun(
397+
PROMPT_RUN_TYPES.RUN_ONE_PROMPT_ONE_LLM_ALL_DOCS,
398+
promptDetails?.prompt_id,
399+
profileId,
400+
null
401+
)
402+
}
403+
disabled={isPromptLoading || isPublicSource}
404+
>
405+
<PlayCircleFilled className="prompt-card-actions-head" />
406+
</Button>
407+
</Tooltip>
408+
<PromptOutputExpandBtn
409+
promptId={promptDetails?.prompt_id}
410+
llmProfiles={llmProfileDetails}
411+
enforceType={enforceType}
412+
tableSettings={tableSettings}
413+
displayLlmProfile={true}
414+
promptOutputs={promptOutputs}
415+
promptRunStatus={promptRunStatus}
416+
openExpandModal={openExpandModal}
417+
setOpenExpandModal={setOpenExpandModal}
418+
/>
457419
</div>
458420
</Space>
459421
<>
@@ -508,8 +470,6 @@ PromptOutput.propTypes = {
508470
selectedLlmProfileId: PropTypes.string,
509471
llmProfileDetails: PropTypes.array.isRequired,
510472
setOpenIndexProfile: PropTypes.func.isRequired,
511-
enabledProfiles: PropTypes.array.isRequired,
512-
setEnabledProfiles: PropTypes.func.isRequired,
513473
isNotSingleLlmProfile: PropTypes.bool.isRequired,
514474
setIsIndexOpen: PropTypes.func.isRequired,
515475
enforceType: PropTypes.string,

0 commit comments

Comments
 (0)