Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions apps/desktop/src/ui/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,19 @@ export function CopyButton({
const icon = copied ? <Check size={iconSize} className="text-success" /> : <Copy size={iconSize} />;
if (iconOnly)
return (
<button
type="button"
aria-label={said}
onClick={copy}
className={cx(
"inline-flex items-center justify-center rounded-md text-fg-muted hover:bg-fill hover:text-fg",
size === "md" ? "size-7" : "size-[22px]",
)}
>
{icon}
</button>
<Tooltip label={label}>
<button
type="button"
aria-label={said}
onClick={copy}
className={cx(
"inline-flex items-center justify-center rounded-md text-fg-muted hover:bg-fill hover:text-fg",
size === "md" ? "size-7" : "size-[22px]",
)}
>
{icon}
</button>
</Tooltip>
);
return (
<Pill quiet size="sm" aria-label={said} onClick={copy}>
Expand Down
8 changes: 5 additions & 3 deletions apps/desktop/src/ui/Rows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// printed is only ever in the card it opens, labelled as an output.

import { describe, expect, test } from "bun:test";
import { createElement } from "react";
import { Tooltip } from "radix-ui";
import { createElement, type ReactElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { parseSessionUpdate } from "../acp/types";
import { applyUpdate, beginTurn, emptyThread, finishTurn, type TranscriptItem } from "../state/thread";
Expand Down Expand Up @@ -42,8 +43,9 @@ const call = (bodies: Record<string, unknown>[], end = true): ToolItem => {
return item;
};

const drawn = (item: ToolItem) => renderToStaticMarkup(createElement(ToolRow, { item, cwd: "/p" }));
const detail = (item: ToolItem) => renderToStaticMarkup(createElement(ToolDetail, { item }));
const render = (el: ReactElement) => renderToStaticMarkup(createElement(Tooltip.Provider, null, el));
const drawn = (item: ToolItem) => render(createElement(ToolRow, { item, cwd: "/p" }));
const detail = (item: ToolItem) => render(createElement(ToolDetail, { item }));
const spinners = (markup: string) => markup.split("rc-spin").length - 1;

const backgrounded = {
Expand Down
Loading