Skip to content

Commit

Permalink
quick nit
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Jan 19, 2025
1 parent 183edaf commit 36483e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion backend/onyx/auth/noauth_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def load_no_auth_user_preferences(store: KeyValueStore) -> UserPreferences:
preferences_data = cast(
Mapping[str, Any], store.load(KV_NO_AUTH_USER_PREFERENCES_KEY)
)
print("preferences_data", preferences_data)
return UserPreferences(**preferences_data)
except KvKeyNotFoundError:
return UserPreferences(
Expand Down
21 changes: 15 additions & 6 deletions web/src/app/assistants/mine/AssistantCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,24 @@ import {
import { PencilIcon } from "lucide-react";
import { SettingsContext } from "@/components/settings/SettingsProvider";
import { usePaidEnterpriseFeaturesEnabled } from "@/components/settings/usePaidEnterpriseFeaturesEnabled";
import { truncateString } from "@/lib/utils";

export const AssistantBadge = ({
text,
className,
maxLength,
}: {
text: string;
className?: string;
maxLength?: number;
}) => {
return (
<div
className={`h-4 px-1.5 py-1 text-[10px] flex-none bg-[#e6e3dd]/50 rounded-lg justify-center items-center gap-1 inline-flex ${className}`}
>
<div className="text-[#4a4a4a] font-normal leading-[8px]">{text}</div>
<div className="text-[#4a4a4a] font-normal leading-[8px]">
{maxLength ? truncateString(text, maxLength) : text}
</div>
</div>
);
};
Expand Down Expand Up @@ -109,7 +114,7 @@ const AssistantCard: React.FC<{
<TooltipTrigger asChild>
<h3
ref={nameRef}
className="text-black line-clamp-1 text-ellipsis leading-none font-semibold text-base lg-normal max-w-full"
className={` text-black line-clamp-1 break-all text-ellipsis leading-none font-semibold text-base lg-normal w-full overflow-hidden`}
>
{persona.name}
</h3>
Expand All @@ -128,12 +133,16 @@ const AssistantCard: React.FC<{
</span>
{persona.labels && persona.labels.length > 0 && (
<>
{persona.labels.slice(0, 3).map((label, index) => (
<AssistantBadge key={index} text={label.name} />
{persona.labels.slice(0, 2).map((label, index) => (
<AssistantBadge
key={index}
text={label.name}
maxLength={10}
/>
))}
{persona.labels.length > 3 && (
{persona.labels.length > 2 && (
<AssistantBadge
text={`+${persona.labels.length - 3} more`}
text={`+${persona.labels.length - 2} more`}
/>
)}
</>
Expand Down

0 comments on commit 36483e9

Please sign in to comment.