Files
openidea/src/ui/Chip.tsx
T
SunZhiQiang 5712a5373d feat(agents): show a task's project, checkout and branch as chips (#3020)
The session status line packed provider, project, checkout, branch and state into one string, while the New Task composer showed them as separate controls. Both now use one Chip primitive (also a chip variant of Select), so project, checkout and branch read as separate facts, and the project is named for a plain project too. The changed-files and commits buttons move to the right of the status line, above the context meter, time and terminal.

Co-authored-by: panda-student <71381346+panda-student@users.noreply.github.com>
2026-11-13 10:04:50 +08:00

25 lines
647 B
TypeScript

import clsx from "clsx";
import type { ReactNode } from "react";
import { Icon, type IconName } from "./icons";
import styles from "./Chip.module.css";
/** A read-only fact in a row of controls (the project, checkout and branch an agent works in). */
export function Chip({
icon,
children,
title,
className,
}: {
icon?: IconName | (string & {});
children: ReactNode;
title?: string;
className?: string;
}) {
return (
<span className={clsx(styles.chip, className)} title={title}>
{icon && <Icon name={icon} size={14} className={styles.icon} />}
<span className={styles.label}>{children}</span>
</span>
);
}