Skip to content

Commit

Permalink
[extension] Update sparkle (#9646)
Browse files Browse the repository at this point in the history
* [extension] Update to latest sparkle

* restore input bar
  • Loading branch information
tdraier authored Dec 30, 2024
1 parent 9db5af7 commit aeceabc
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 32 deletions.
10 changes: 4 additions & 6 deletions extension/app/src/components/assistants/AssistantFavorites.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AssistantPreview, Button, Page } from "@dust-tt/sparkle";
import { AssistantCard, Button, CardGrid, Page } from "@dust-tt/sparkle";
import { usePublicAgentConfigurations } from "@extension/components/assistants/usePublicAgentConfigurations";
import { InputBarContext } from "@extension/components/input_bar/InputBarContext";
import { useCallback, useContext } from "react";
Expand Down Expand Up @@ -40,22 +40,20 @@ export function AssistantFavorites() {
<div className="h-full w-full pt-2 pb-12">
<Page.SectionHeader title="Favorites" />
{hasFavorites ? (
<div className="relative grid w-full grid-cols-2 gap-2">
<CardGrid className="mb-12">
{agentConfigurations.map(
({ sId, name, pictureUrl, lastAuthors, description }) => (
<AssistantPreview
<AssistantCard
key={sId}
title={name}
pictureUrl={pictureUrl}
subtitle={lastAuthors?.join(", ") ?? ""}
description={description}
variant="minimal"
onClick={() => handleAssistantClick(sId)}
hasAction={false}
/>
)
)}
</div>
</CardGrid>
) : (
<div className="flex flex-col items-center pt-20 gap-4">
<p className="text-slate-400">
Expand Down
27 changes: 12 additions & 15 deletions extension/app/src/components/conversation/AgentMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -543,22 +543,19 @@ export function AgentMessage({

return (
<div className="flex flex-col gap-y-4">
<AgentMessageActions
agentMessage={agentMessage}
size={size}
owner={owner}
/>

{agentMessage.chainOfThought?.length ? (
<ContentMessage
title="Assistant thoughts"
variant="slate"
icon={ChatBubbleThoughtIcon}
>
{agentMessage.chainOfThought}
</ContentMessage>
) : null}
<div className="flex flex-col gap-2">
<AgentMessageActions
agentMessage={agentMessage}
size={size}
owner={owner}
/>

{agentMessage.chainOfThought?.length ? (
<ContentMessage title="Assistant thoughts" variant="slate">
{agentMessage.chainOfThought}
</ContentMessage>
) : null}
</div>
{agentMessage.content !== null && (
<div>
{lastTokenClassification !== "chain_of_thought" &&
Expand Down
11 changes: 5 additions & 6 deletions extension/app/src/components/conversation/AgentSuggestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type {
UserMessageType,
} from "@dust-tt/client";
import {
AssistantPreview,
AssistantCard,
Button,
CardGrid,
RobotIcon,
Spinner,
useSendNotification,
Expand Down Expand Up @@ -101,20 +102,18 @@ export function AgentSuggestion({
<Spinner />
</div>
) : (
<div className="mt-3 grid gap-2 md:grid-cols-3">
<CardGrid className="mb-12">
{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}
hasAction={false}
onClick={() => handleSelectSuggestion(agent)}
/>
))}
</div>
</CardGrid>
)}
</div>
</>
Expand Down
1 change: 1 addition & 0 deletions extension/app/src/lib/dust_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const useDustAPI = () => {
return new DustAPI(
{
url: process.env.DUST_DOMAIN,
nodeEnv: process.env.NODE_ENV,
},
{
apiKey: () => getAccessToken(),
Expand Down
8 changes: 4 additions & 4 deletions extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"dependencies": {
"@dust-tt/client": "^1.0.15",
"@dust-tt/sparkle": "^0.2.343-rc5",
"@dust-tt/sparkle": "^0.2.348",
"@tailwindcss/forms": "^0.5.9",
"@tiptap/extension-character-count": "^2.9.1",
"@tiptap/extension-mention": "^2.9.1",
Expand Down

0 comments on commit aeceabc

Please sign in to comment.