Every bot message gets an info button that opens its details: the provider and model behind it, tokens and cost, the job that ran it, each model used and every call in order. Each model call now records how it was made in token_usages.settings (generation settings sent, whose settings they were, pinned or automatic model, fallbacks), shown per model in the modal. Live replies now carry their token usage, from the job's push and the live relay alike, so it shows without a reload. Co-Authored-By: Claude Opus 5.5 <[email protected]>
33 lines
956 B
TypeScript
33 lines
956 B
TypeScript
import Button from "@moduletrace/twui/layout/Button";
|
|
import type { ReactNode } from "react";
|
|
|
|
type Props = {
|
|
title: string;
|
|
aria_label: string;
|
|
/**
|
|
* Left out when a wrapper (a modal's target) handles the click.
|
|
*/
|
|
onClick?: () => void;
|
|
children: ReactNode;
|
|
};
|
|
|
|
/**
|
|
* A small ghost icon button under a message, for its reply and reaction
|
|
* actions. Quiet until hovered, and readable in both themes.
|
|
*/
|
|
export default function MessageActionButton({ title, aria_label, onClick, children }: Props) {
|
|
return (
|
|
<Button
|
|
title={title}
|
|
aria-label={aria_label}
|
|
type="button"
|
|
variant="ghost"
|
|
color="text"
|
|
onClick={onClick}
|
|
className="shrink-0 p-1! -mx-1 text-ink-secondary dark:text-ink-secondary hover:text-ink rounded-default-xs focus-visible:ring-2 focus-visible:ring-ink"
|
|
>
|
|
{children}
|
|
</Button>
|
|
);
|
|
}
|