Compare commits

..
2 Commits
Author SHA1 Message Date
tben 15a74cacde v0.28.5
CI / check (push) Canceled after 0s
Release image / image (release) Canceled after 0s
Release image / computer-image (release) Canceled after 0s
2026-11-25 04:52:19 +01:00
tben 67395500b5 Show a person's and a bot's picture at the size it is set up at
A picture preview was drawn whatever the size asked for, so setting up a
photo meant judging a thumbnail. BotAvatar passes its size through to the
image, UserAvatar gains xl and xxl, and the profile photo and the bot form's
preview use them.
2026-11-25 04:52:19 +01:00
6 changed files with 54 additions and 13 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cobble",
"version": "0.28.4",
"version": "0.28.5",
"module": "index.ts",
"type": "module",
"private": true,
+6 -1
View File
@@ -31,7 +31,11 @@ type Props = ComponentProps<typeof BotStone> & {
* never a circle, so it isn't mistaken for a person), else its stone. Its
* colour still marks it everywhere else, e.g. the unread dot.
*/
export default function BotAvatar({ image_media_id, src: picked, ...stone }: Props) {
export default function BotAvatar({
image_media_id,
src: picked,
...stone
}: Props) {
const saved = profileImageUrls({ media_id: image_media_id });
const thumbnail_src = picked || saved.thumbnail_src;
const src = picked || saved.src;
@@ -49,6 +53,7 @@ export default function BotAvatar({ image_media_id, src: picked, ...stone }: Pro
BotAvatarSizeClasses[size] || BotAvatarSizeClasses[32],
stone.className,
)}
size={size}
/>
);
}
+5 -1
View File
@@ -12,6 +12,8 @@ const UserAvatarSizeClasses = {
sm: "size-6 text-[11px]",
md: "size-8 text-xs",
lg: "size-16 text-lg",
xl: "size-24 text-xl",
xxl: "size-32 text-2xl",
} as const;
type Props = {
@@ -47,7 +49,9 @@ export default function UserAvatar({
size = "md",
className,
}: Props) {
const photo = person?.profile_media_id ? grabMediaURL({ user: person }) : {};
const photo = person?.profile_media_id
? grabMediaURL({ user: person })
: {};
const src = passed_src || photo.media_thumbnail_url || photo.media_url;
const img_err_src = passed_src ? passed_err_src : photo.media_url;
const initials = passed_initials || userInitials(person || {});
+1 -1
View File
@@ -165,7 +165,7 @@ export default function BotForm({ bot, onCancel, onSaved }: Props) {
stone={stone}
image_media_id={image.image_media_id}
picked_src={image.data_url}
avatar_size={100}
avatar_size={120}
/>
}
has_image={image.has_image}
@@ -54,7 +54,13 @@ type PanelTab = "settings" | "tools";
* without a conversation has nobody listening). The tab's data loads when it
* opens, and Escape, the backdrop or the X closes it.
*/
export default function BotPanel({ bot, workspace, open, on_open, on_close }: Props) {
export default function BotPanel({
bot,
workspace,
open,
on_open,
on_close,
}: Props) {
const { pageProps } = useContext(AppContext);
const name = bot.name || "This bot";
const can_edit = canManageCrew({ user_types: pageProps?.user_types });
@@ -109,7 +115,11 @@ export default function BotPanel({ bot, workspace, open, on_open, on_close }: Pr
<Stack className="shrink-0">
<BotAvatar
image_media_id={bot.image_media_id}
{...botStoneProps({ color: bot.color, stone: bot.stone, hue: bot.hue })}
{...botStoneProps({
color: bot.color,
stone: bot.stone,
hue: bot.hue,
})}
face={(bot.face || "idle") as BotFace}
size={35}
/>
@@ -134,8 +144,16 @@ export default function BotPanel({ bot, workspace, open, on_open, on_close }: Pr
aria-label={`Edit ${name}`}
className="shrink-0 gap-1! flex-nowrap items-center px-3 py-2 border-0 border-b border-solid border-hairline"
>
<TabButton title="Settings" active={tab == "settings"} onPick={() => setTab("settings")} />
<TabButton title="Tools" active={tab == "tools"} onPick={() => setTab("tools")} />
<TabButton
title="Settings"
active={tab == "settings"}
onPick={() => setTab("settings")}
/>
<TabButton
title="Tools"
active={tab == "tools"}
onPick={() => setTab("tools")}
/>
</Row>
<Stack className="grow min-h-0 overflow-y-auto gap-4! items-stretch px-4 pt-4 pb-6 [&>*]:shrink-0">
{open && tab == "settings" ? (
@@ -161,13 +179,22 @@ export default function BotPanel({ bot, workspace, open, on_open, on_close }: Pr
bot_id={Number(bot.id) || 0}
bot_name={name}
memory={memory || ""}
workspace_id={workspace_id || undefined}
workspace_id={
workspace_id || undefined
}
workspace_name={workspace?.name}
workspace_memory={workspace_instructions.instructions?.memory || ""}
workspace_memory={
workspace_instructions
.instructions?.memory ||
""
}
onCancel={on_close}
/>
<Divider className="my-2 border-hairline dark:border-hairline" />
<BotUserMemory bot_name={name} memory={user_memory || ""} />
<BotUserMemory
bot_name={name}
memory={user_memory || ""}
/>
</>
) : loaded_error ? (
<Span className="py-6 text-[13px] leading-[18px] text-ink-secondary">
@@ -203,4 +230,4 @@ export default function BotPanel({ bot, workspace, open, on_open, on_close }: Pr
</SidePanel>
</>
);
}
}
@@ -32,7 +32,12 @@ export default function ProfilePhotoField({
return (
<Row className="w-full gap-4! flex-nowrap items-center">
<UserAvatar src={preview_src} initials={initials} alt="Your photo" size="lg" />
<UserAvatar
src={preview_src}
initials={initials}
alt="Your photo"
size="xxl"
/>
<Stack className="gap-2! min-w-0">
<Row className="gap-2!">
<Button