mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-08 09:24:41 +00:00
fix(plugin): support icon-only composer pills
Composer pills use an omitted label to fall back to the accessible title, but rejected every explicit no-label value. Preserve that omission default while representing null and empty labels as icon-only controls.
This commit is contained in:
@@ -121,8 +121,9 @@ pill.remove();
|
||||
```
|
||||
|
||||
Move dynamic text from the former component into updates from your model or SDK subscription.
|
||||
Custom icon components may still use hooks. Composer pills always show icon and label and never
|
||||
show chevrons. See [buttons](./reference.md#button-descriptor) for menus, popovers, and visibility.
|
||||
Custom icon components may still use hooks. Composer pills use `title` when `label` is omitted;
|
||||
pass `null` or an empty string for icon-only. They never show chevrons. See
|
||||
[buttons](./reference.md#button-descriptor) for menus, popovers, and visibility.
|
||||
|
||||
## 4. Separate imports
|
||||
|
||||
|
||||
@@ -1335,8 +1335,9 @@ into a shared overflow menu. Placement and overflow are host decisions.
|
||||
|
||||
`client.addComposerPill({ id, workspaceId, agentId, button })` uses the same [button descriptor](#button-descriptor)
|
||||
and returns the same registration. It targets one agent's composer track alongside Tasks and
|
||||
Subagents. Composer pills always show the icon and `label` (or `title` when `label` is omitted).
|
||||
They never show a chevron, including for menus and popovers.
|
||||
Subagents. Composer pills show the icon and `label` (or `title` when `label` is omitted).
|
||||
Pass `null` or an empty string for an icon-only pill. Icon-only pills use a square button without
|
||||
text padding. They never show a chevron, including for menus and popovers.
|
||||
|
||||
```tsx
|
||||
const pill = client.addComposerPill({
|
||||
@@ -1361,14 +1362,14 @@ const pill = client.addComposerPill({
|
||||
|
||||
These contracts are exported from `@getpaseo/plugin/client`.
|
||||
|
||||
| Field | Required | Meaning |
|
||||
| ---------- | -------- | ----------------------------------------------------------------------- |
|
||||
| `title` | Yes | Non-empty accessible label, tooltip, and sheet title. |
|
||||
| `icon` | Yes | Lucide name or `ComponentType<PluginButtonIconProps>`. |
|
||||
| `label` | No | Non-empty display text. Omit to use the placement's default. |
|
||||
| `visible` | No | Defaults to `true`. False removes the trigger and its layout space. |
|
||||
| `disabled` | No | Defaults to `false`. Keeps the button visible and prevents interaction. |
|
||||
| `behavior` | Yes | One of the three shapes below. |
|
||||
| Field | Required | Meaning |
|
||||
| ---------- | -------- | -------------------------------------------------------------------------------- |
|
||||
| `title` | Yes | Non-empty accessible label, tooltip, and sheet title. |
|
||||
| `icon` | Yes | Lucide name or `ComponentType<PluginButtonIconProps>`. |
|
||||
| `label` | No | Display text. Omit for the placement default; pass `null` or `""` for icon-only. |
|
||||
| `visible` | No | Defaults to `true`. False removes the trigger and its layout space. |
|
||||
| `disabled` | No | Defaults to `false`. Keeps the button visible and prevents interaction. |
|
||||
| `behavior` | Yes | One of the three shapes below. |
|
||||
|
||||
```tsx
|
||||
type PluginButtonBehavior =
|
||||
|
||||
Reference in New Issue
Block a user