Skip to content

Commit

Permalink
FIX: Prompt Card UI Fixes (#323)
Browse files Browse the repository at this point in the history
* fixed color of run button when disabled

* UI fixes in prompt card

* Tag ellipsis implementation in document manager

---------

Co-authored-by: jagadeeswaran-zipstack <jagadeeswaran@zipstack.com>
Co-authored-by: Neha <115609453+nehabagdia@users.noreply.github.com>
  • Loading branch information
3 people committed May 8, 2024
1 parent d9fd735 commit c163a3f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ function ManageDocsModal({
return;
}

return <Tag color={color}>{indexMessage?.message}</Tag>;
return (
<Tooltip title={indexMessage?.message || ""}>
<Tag color={color}>
<div className="tag-max-width ellipsis">{indexMessage?.message}</div>
</Tag>
</Tooltip>
);
};

const failedSummary = (
Expand Down Expand Up @@ -384,7 +390,9 @@ function ManageDocsModal({
</Tooltip>
)}
</div>
<div>{infoIndex(indexMessages?.[item?.document_name])}</div>
<div className="center">
{infoIndex(indexMessages?.[item?.document_name])}
</div>
</Space>
),
delete: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@
.prompt-card-action-button.ant-btn-text:disabled > .assertion-icon > path {
fill: rgba(0, 0, 0, 0.25);
}

.tag-max-width {
max-width: 150px;
}
28 changes: 16 additions & 12 deletions frontend/src/components/custom-tools/prompt-card/PromptCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -647,15 +647,21 @@ function PromptCard({
</Col>
<Col span={12} className="display-flex-right">
{progressMsg?.message && (
<Tag
icon={isCoverageLoading && <LoadingOutlined spin />}
color={
progressMsg?.level === "ERROR" ? "error" : "processing"
}
className="display-flex-align-center"
>
{progressMsg?.message}
</Tag>
<Tooltip title={progressMsg?.message || ""}>
<Tag
icon={isCoverageLoading && <LoadingOutlined spin />}
color={
progressMsg?.level === "ERROR"
? "error"
: "processing"
}
className="display-flex-align-center"
>
<div className="tag-max-width ellipsis">
{progressMsg?.message}
</div>
</Tag>
</Tooltip>
)}
{updateStatus?.promptId === promptDetails?.prompt_id && (
<>
Expand Down Expand Up @@ -731,9 +737,7 @@ function PromptCard({
promptDetails?.prompt_id &&
updateStatus?.status ===
promptStudioUpdateStatus.isUpdating) ||
disableLlmOrDocChange.includes(
promptDetails?.prompt_id
) ||
disableLlmOrDocChange?.length > 0 ||
indexDocs.includes(selectedDoc?.document_id)
}
>
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ body {
font-size: 16px;
font-weight: bold;
}

.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

0 comments on commit c163a3f

Please sign in to comment.