Skip to content

Commit

Permalink
Deploying new cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncid committed Dec 17, 2024
1 parent 6f458f4 commit 608028d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 26 deletions.
6 changes: 5 additions & 1 deletion front/components/actions/browse/BrowseActionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export function BrowseActionDetails({
</span>

{r.responseCode === "200" ? (
<Citation key={idx} href={r.browsedUrl}>
<Citation
key={idx}
href={r.browsedUrl}
className="w-48 min-w-48 max-w-48"
>
<CitationIcons>
<Icon visual={GlobeAltIcon} />
</CitationIcons>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {
Citation,
CitationIcons,
CitationTitle,
Collapsible,
ContentMessage,
Icon,
InformationCircleIcon,
TableIcon,
useSendNotification,
Expand Down Expand Up @@ -144,7 +146,10 @@ function QueryTablesResults({
<div>
<span className="text-sm font-bold text-slate-900">Results</span>
<div onClick={handleDownload} className="py-2">
<Citation>
<Citation className="w-48 min-w-48 max-w-48">
<CitationIcons>
<Icon visual={TableIcon} />
</CitationIcons>
<CitationTitle>{title}</CitationTitle>
</Citation>
</div>
Expand Down
14 changes: 5 additions & 9 deletions front/components/assistant/AssistantBrowser.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
AssistantPreview,
AssistantCard,
AssistantCardMore,
Button,
CompanyIcon,
LockIcon,
MagnifyingGlassIcon,
MoreIcon,
PlusIcon,
RobotIcon,
RocketIcon,
Expand Down Expand Up @@ -203,19 +203,15 @@ export function AssistantBrowser({
{viewTab && (
<div className="relative grid w-full grid-cols-1 gap-2 px-4 md:grid-cols-3">
{agentsByTab[viewTab].map((agent) => (
<AssistantPreview
<AssistantCard
key={agent.sId}
title={agent.name}
pictureUrl={agent.pictureUrl}
subtitle={agent.lastAuthors?.join(", ") ?? ""}
description={agent.description}
variant="minimal"
onClick={() => handleAssistantClick(agent)}
actionElement={
<Button
icon={MoreIcon}
variant="outline"
size="sm"
action={
<AssistantCardMore
onClick={(e: Event) => {
e.stopPropagation();
setQueryParam(router, "assistantDetails", agent.sId);
Expand Down
17 changes: 11 additions & 6 deletions front/components/assistant/conversation/AgentSuggestion.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
AssistantPreview,
AssistantCard,
AssistantCardMore,
Button,
CardGrid,
RobotIcon,
Spinner,
useSendNotification,
Expand Down Expand Up @@ -121,20 +123,23 @@ export function AgentSuggestion({
<Spinner />
</div>
) : (
<div className="mt-3 grid gap-2 md:grid-cols-3">
<CardGrid>
{topAgents.map((agent, id) => (
<AssistantPreview
<AssistantCard
key={`${agent.sId}-${id}`}
variant="minimal"
description={agent.description}
subtitle={agent.lastAuthors?.join(", ") ?? ""}
title={agent.name}
pictureUrl={agent.pictureUrl}
onClick={() => handleSelectSuggestion(agent)}
onActionClick={() => showAssistantDetails(agent)}
action={
<AssistantCardMore
onClick={() => showAssistantDetails(agent)}
/>
}
/>
))}
</div>
</CardGrid>
)}
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function InputBarCitations({
<>
<Citation
key={`cf-${blob.id}`}
className="w-48"
className="w-40"
isLoading={blob.isUploading}
>
{isImage ? (
Expand Down Expand Up @@ -59,7 +59,7 @@ export function InputBarCitations({
}

return (
<div className="mr-4 flex gap-2 overflow-auto border-b border-structure-300/50 pb-3 pt-4">
<div className="border-boder-dark mr-4 flex gap-1 overflow-auto border-b pb-3 pt-4">
{processContentFragments()}
</div>
);
Expand Down
9 changes: 4 additions & 5 deletions front/components/assistant_builder/TemplateGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AssistantPreview } from "@dust-tt/sparkle";
import { AssistantCard, CardGrid } from "@dust-tt/sparkle";

import type { AssistantTemplateListType } from "@app/pages/api/w/[wId]/assistant/builder/templates";

Expand All @@ -15,17 +15,16 @@ export function TemplateGrid({
return null;
}
return (
<div className="grid grid-cols-2 gap-2">
<CardGrid>
{templates.map((t) => (
<AssistantPreview
<AssistantCard
key={t.sId}
title={t.handle}
pictureUrl={t.pictureUrl}
description={t.description ?? ""}
variant="list"
onClick={() => openTemplateModal(t.sId)}
/>
))}
</div>
</CardGrid>
);
}
4 changes: 2 additions & 2 deletions front/pages/poke/templates/[tId].tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
AssistantPreview,
AssistantCard,
ColorPicker,
DropdownMenu,
DropdownMenuContent,
Expand Down Expand Up @@ -436,7 +436,7 @@ function PreviewDialog({ form }: { form: any }) {
<PokeDialogHeader>
<PokeDialogTitle>Preview</PokeDialogTitle>
</PokeDialogHeader>
<AssistantPreview
<AssistantCard
title={form.getValues("handle")}
pictureUrl={avatarVisual}
description={form.getValues("description") ?? ""}
Expand Down

0 comments on commit 608028d

Please sign in to comment.