@estiva-app/ui 0.96.0 → 0.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar.d.ts +6 -1
- package/dist/Avatar.d.ts.map +1 -1
- package/dist/AvatarGroup.d.ts +2 -0
- package/dist/AvatarGroup.d.ts.map +1 -1
- package/dist/ComposerTriggers.d.ts +2 -0
- package/dist/ComposerTriggers.d.ts.map +1 -1
- package/dist/ConversationCard.d.ts +2 -0
- package/dist/ConversationCard.d.ts.map +1 -1
- package/dist/LinkParts.d.ts +1 -0
- package/dist/LinkParts.d.ts.map +1 -1
- package/dist/MembersDialog.d.ts +4 -0
- package/dist/MembersDialog.d.ts.map +1 -1
- package/dist/Person.d.ts +3 -1
- package/dist/Person.d.ts.map +1 -1
- package/dist/PersonTrigger.d.ts +1 -1
- package/dist/PersonTrigger.d.ts.map +1 -1
- package/dist/RepliesRow.d.ts +1 -0
- package/dist/RepliesRow.d.ts.map +1 -1
- package/dist/editor.js +1 -1
- package/dist/editor.js.map +2 -2
- package/dist/index.js +47 -26
- package/dist/index.js.map +2 -2
- package/dist/linked.d.ts +4 -0
- package/dist/linked.d.ts.map +1 -1
- package/dist/linkedFrom.d.ts +2 -0
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +20 -2
- package/src/Avatar.agent.test.tsx +63 -0
- package/src/Avatar.mdx +25 -0
- package/src/Avatar.stories.tsx +13 -0
- package/src/Avatar.tsx +51 -3
- package/src/AvatarGroup.tsx +3 -1
- package/src/ComposerTriggers.stories.tsx +2 -0
- package/src/ComposerTriggers.tsx +3 -1
- package/src/ConversationCard.tsx +4 -2
- package/src/LinkCard.tsx +3 -3
- package/src/LinkChip.tsx +1 -1
- package/src/LinkParts.tsx +4 -4
- package/src/LinkRow.tsx +1 -1
- package/src/MembersDialog.stories.tsx +11 -0
- package/src/MembersDialog.tsx +7 -3
- package/src/Person.tsx +4 -2
- package/src/PersonTrigger.tsx +3 -3
- package/src/PinnedComment.tsx +1 -1
- package/src/RepliesRow.tsx +2 -2
- package/src/linked.ts +4 -0
- package/src/linkedFrom.ts +5 -3
- package/src/registry/registry.test.ts +2 -1
package/dist/linked.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface LinkedStatus {
|
|
|
18
18
|
export interface LinkedPerson {
|
|
19
19
|
name: string;
|
|
20
20
|
picture?: string;
|
|
21
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
22
|
+
bot?: boolean;
|
|
21
23
|
}
|
|
22
24
|
/** One choice a picker offers. */
|
|
23
25
|
export interface PickerOption {
|
|
@@ -27,6 +29,8 @@ export interface PickerOption {
|
|
|
27
29
|
colour?: StatusColour;
|
|
28
30
|
/** A person's picture: the option draws their face. */
|
|
29
31
|
picture?: string;
|
|
32
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
33
|
+
bot?: boolean;
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
36
|
* A value the reader may be able to change from the card: a status, or who
|
package/dist/linked.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linked.d.ts","sourceRoot":"","sources":["../src/linked.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,kCAAuB,CAAA;AAE5C,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;AAE3C,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC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ked, LinkedConversation, LinkedKind } from './linked
|
|
|
3
3
|
export interface LinkedProfile {
|
|
4
4
|
displayName?: string;
|
|
5
5
|
picture?: string;
|
|
6
|
+
/** NIP-24's `bot`: the profile is an agent's. */
|
|
7
|
+
bot?: boolean;
|
|
6
8
|
}
|
|
7
9
|
/** One of interop's resolved slots. */
|
|
8
10
|
export interface LinkedSlot {
|
package/dist/linkedFrom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkedFrom.d.ts","sourceRoot":"","sources":["../src/linkedFrom.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAe,kBAAkB,EAAE,UAAU,EAA4C,MAAM,UAAU,CAAA;AAExI,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"linkedFrom.d.ts","sourceRoot":"","sources":["../src/linkedFrom.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAe,kBAAkB,EAAE,UAAU,EAA4C,MAAM,UAAU,CAAA;AAExI,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED,uCAAuC;AACvC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,uFAAuF;AACvF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;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AM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS,KAAK,MAAM,CAAA;IACxF,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACzC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjD,0DAA0D;IAC1D,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;CACrC;AA2KD,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,MAAM,CAkDnG;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,YAAY,EAClD,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC5B,MAAM,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3E,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,SAAS,CAeX"}
|
package/package.json
CHANGED
package/registry.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"kind": "package",
|
|
5
5
|
"repo": "estiva-ui",
|
|
6
6
|
"package": "@estiva-app/ui",
|
|
7
|
-
"packageVersion": "0.
|
|
7
|
+
"packageVersion": "0.97.0",
|
|
8
8
|
"exports": 229,
|
|
9
9
|
"typeExports": 234,
|
|
10
10
|
"files": null
|
|
@@ -615,6 +615,12 @@
|
|
|
615
615
|
"required": false,
|
|
616
616
|
"note": "Say the person's name out loud, for a face that stands on its own — `PersonTrigger`'s compact shape, a stack of members."
|
|
617
617
|
},
|
|
618
|
+
{
|
|
619
|
+
"name": "bot",
|
|
620
|
+
"takes": "true/false",
|
|
621
|
+
"required": false,
|
|
622
|
+
"note": "An agent's face: a robot in place of the initials, for a profile that says it is an agent (NIP-24's `bot`)."
|
|
623
|
+
},
|
|
618
624
|
{
|
|
619
625
|
"name": "className",
|
|
620
626
|
"takes": "text",
|
|
@@ -7210,6 +7216,12 @@
|
|
|
7210
7216
|
"required": false,
|
|
7211
7217
|
"note": null
|
|
7212
7218
|
},
|
|
7219
|
+
{
|
|
7220
|
+
"name": "bot",
|
|
7221
|
+
"takes": "true/false",
|
|
7222
|
+
"required": false,
|
|
7223
|
+
"note": "An agent: its face is a robot, as Avatar's `bot`."
|
|
7224
|
+
},
|
|
7213
7225
|
{
|
|
7214
7226
|
"name": "fallback",
|
|
7215
7227
|
"takes": "text",
|
|
@@ -7310,6 +7322,12 @@
|
|
|
7310
7322
|
"required": false,
|
|
7311
7323
|
"note": null
|
|
7312
7324
|
},
|
|
7325
|
+
{
|
|
7326
|
+
"name": "bot",
|
|
7327
|
+
"takes": "true/false",
|
|
7328
|
+
"required": false,
|
|
7329
|
+
"note": "An agent: its face is a robot, as Avatar's `bot`."
|
|
7330
|
+
},
|
|
7313
7331
|
{
|
|
7314
7332
|
"name": "fallback",
|
|
7315
7333
|
"takes": "text",
|
|
@@ -8438,7 +8456,7 @@
|
|
|
8438
8456
|
},
|
|
8439
8457
|
{
|
|
8440
8458
|
"name": "faces",
|
|
8441
|
-
"takes": "readonly { name: string; picture?: string }[]",
|
|
8459
|
+
"takes": "readonly { name: string; picture?: string; bot?: boolean }[]",
|
|
8442
8460
|
"required": false,
|
|
8443
8461
|
"note": "Who replied: their faces."
|
|
8444
8462
|
},
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
/**
|
|
3
|
+
* An agent's face (Katerina, 1 November): a robot where a person's initials would be, wherever a face is drawn, and
|
|
4
|
+
* its picture when it has one. Before, every agent showed "C" for "Claude (steered by …)", like a person.
|
|
5
|
+
*
|
|
6
|
+
* jsdom never loads an image, so the picture tests fire the `<img>`'s own events.
|
|
7
|
+
*/
|
|
8
|
+
import { afterEach, describe, expect, it } from 'vitest'
|
|
9
|
+
import { cleanup, fireEvent, render, screen } from '@testing-library/react'
|
|
10
|
+
import { Avatar } from './Avatar'
|
|
11
|
+
import { MembersDialog } from './MembersDialog'
|
|
12
|
+
import { Person } from './Person'
|
|
13
|
+
|
|
14
|
+
afterEach(cleanup)
|
|
15
|
+
|
|
16
|
+
const AGENT = 'Agent (steered by Ana Duarte)'
|
|
17
|
+
const tile = (container: HTMLElement) => container.firstElementChild as HTMLElement
|
|
18
|
+
|
|
19
|
+
describe('an agent’s face', () => {
|
|
20
|
+
it('is a robot, not its initials', () => {
|
|
21
|
+
const { container } = render(<Avatar name={AGENT} bot />)
|
|
22
|
+
expect(tile(container).textContent).toBe('')
|
|
23
|
+
expect(tile(container).querySelector('svg path')).not.toBeNull()
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('a person with the same kind of name still gets initials', () => {
|
|
27
|
+
const { container } = render(<Avatar name={AGENT} />)
|
|
28
|
+
expect(tile(container).textContent).toBe('A')
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('its picture still wins, and the robot shows if the picture fails', () => {
|
|
32
|
+
const { container } = render(<Avatar name={AGENT} bot src="https://example.test/agent.png" />)
|
|
33
|
+
const img = tile(container).querySelector('img')!
|
|
34
|
+
fireEvent.load(img)
|
|
35
|
+
expect(tile(container).querySelector('svg')).toBeNull()
|
|
36
|
+
cleanup()
|
|
37
|
+
const failed = render(<Avatar name={AGENT} bot src="https://example.test/agent.png" />)
|
|
38
|
+
fireEvent.error(tile(failed.container).querySelector('img')!)
|
|
39
|
+
expect(tile(failed.container).querySelector('svg path')).not.toBeNull()
|
|
40
|
+
expect(tile(failed.container).textContent).toBe('')
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('beside its name in a Person, the name is said once and no letter is drawn', () => {
|
|
44
|
+
const { container } = render(<Person name={AGENT} bot />)
|
|
45
|
+
expect(container.textContent).toBe(AGENT)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('in the members list, the agent’s row has the robot and the person’s row their initials', () => {
|
|
49
|
+
render(
|
|
50
|
+
<MembersDialog
|
|
51
|
+
members={[
|
|
52
|
+
{ id: 'ana', name: 'Ana Duarte' },
|
|
53
|
+
{ id: 'agent', name: AGENT, bot: true },
|
|
54
|
+
]}
|
|
55
|
+
onClose={() => {}}
|
|
56
|
+
/>,
|
|
57
|
+
)
|
|
58
|
+
const rowOf = (name: string) => screen.getByText(name).closest('div.flex.h-12') as HTMLElement
|
|
59
|
+
expect(rowOf('Ana Duarte').textContent).toBe('ADAna Duarte')
|
|
60
|
+
expect(rowOf(AGENT).textContent).toBe(AGENT)
|
|
61
|
+
expect(rowOf(AGENT).querySelector('svg path')).not.toBeNull()
|
|
62
|
+
})
|
|
63
|
+
})
|
package/src/Avatar.mdx
CHANGED
|
@@ -7,6 +7,7 @@ import * as AvatarStories from './Avatar.stories'
|
|
|
7
7
|
|
|
8
8
|
A person's face: their picture, or their initials on a colour that is
|
|
9
9
|
theirs, or — when there is no name to take initials from — a silhouette.
|
|
10
|
+
An agent's face is a robot on lime.
|
|
10
11
|
|
|
11
12
|
<Canvas of={AvatarStories.Sizes} />
|
|
12
13
|
|
|
@@ -68,6 +69,29 @@ a stack of members — and the tile becomes one image with one name.
|
|
|
68
69
|
|
|
69
70
|
<Canvas of={AvatarStories.Palette} />
|
|
70
71
|
|
|
72
|
+
### An agent
|
|
73
|
+
|
|
74
|
+
**`bot` draws a robot on lime** in place of the initials, for a profile that
|
|
75
|
+
says it is an agent (NIP-24's `bot: true`, which Estiva ID publishes for every
|
|
76
|
+
agent). Its picture still wins when it has one.
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
<Avatar name={profile.name} src={profile.picture} bot={profile.bot} />
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- Take `bot` from the profile, **never from the name**: "steered by" is a
|
|
83
|
+
name, not a marker.
|
|
84
|
+
- Lime is the same in every theme, on the initials' light and shade. No
|
|
85
|
+
person's colour is near it, so an agent never reads as a person, nor as the
|
|
86
|
+
yellow urgent mark.
|
|
87
|
+
- The robot is drawn at 5/8 of the tile, larger than the silhouette, so it
|
|
88
|
+
still reads at 16px.
|
|
89
|
+
- Every part that draws a face takes `bot` with the person: `Person`,
|
|
90
|
+
`PersonTrigger`, `AvatarGroup`, `MembersPill`, `MembersDialog`, the mention
|
|
91
|
+
menu, a comment's and a reply's author, and the link parts.
|
|
92
|
+
|
|
93
|
+
<Canvas of={AvatarStories.Agent} />
|
|
94
|
+
|
|
71
95
|
- **Planned:** a Byline part — face · name · time — in migration stage 7.
|
|
72
96
|
|
|
73
97
|
- `initialsFor(name)` and `hueFor(name)` give the same initials and colour where
|
|
@@ -80,6 +104,7 @@ It does these by itself. Write none of them around it.
|
|
|
80
104
|
| It does | So you never write | Refused when written by hand |
|
|
81
105
|
|---|---|---|
|
|
82
106
|
| Shows initials from the name when there is no picture, or when it fails to load | an `onError`, or initials of your own | |
|
|
107
|
+
| Shows a robot for an agent (`bot`) when there is no picture | a robot icon of your own, or a check of the name | |
|
|
83
108
|
|
|
84
109
|
## Props
|
|
85
110
|
|
package/src/Avatar.stories.tsx
CHANGED
|
@@ -17,6 +17,19 @@ export const Initials: Story = {}
|
|
|
17
17
|
/** No name, no picture: the silhouette. Never a key, never a `?`. */
|
|
18
18
|
export const Unnamed: Story = { args: { name: undefined } }
|
|
19
19
|
|
|
20
|
+
/** An agent (its profile says `bot`): a robot on lime in place of its initials, at every size. */
|
|
21
|
+
export const Agent: Story = {
|
|
22
|
+
args: { name: 'Agent (steered by Ana Duarte)', bot: true },
|
|
23
|
+
parameters: { controls: { disable: true } },
|
|
24
|
+
render: (args) => (
|
|
25
|
+
<div className="flex items-end gap-3">
|
|
26
|
+
{[16, 20, 24, 32, 36].map((size) => (
|
|
27
|
+
<Avatar key={size} {...args} size={size} />
|
|
28
|
+
))}
|
|
29
|
+
</div>
|
|
30
|
+
),
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
/** A picture — here an inline SVG, so the story needs nothing from anywhere. */
|
|
21
34
|
export const WithPicture: Story = {
|
|
22
35
|
args: {
|
package/src/Avatar.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { cn } from './cn'
|
|
|
6
6
|
/**
|
|
7
7
|
* A person's face: their picture, or their initials on a colour that is
|
|
8
8
|
* theirs, or — when there is no name to take initials from — a silhouette.
|
|
9
|
+
* An agent's is a robot on lime (`bot`), unless it has a picture.
|
|
9
10
|
*
|
|
10
11
|
* Peek's Avatar (2026-08-28), made self-contained: Peek's version found the
|
|
11
12
|
* picture itself, by name, from Peek's data (an upload in Convex, else the
|
|
@@ -39,6 +40,9 @@ export const hueFor = (key: string) => {
|
|
|
39
40
|
return HUES[Math.abs(h) % HUES.length]
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
/** The tile's ground from its hue: lighter at the top left, darker at the foot. An agent's lime takes it too. */
|
|
44
|
+
const groundFor = (hue: string) => `linear-gradient(160deg, color-mix(in srgb, ${hue} 92%, #fff) 0%, color-mix(in srgb, ${hue} 70%, #0b0d11) 100%)`
|
|
45
|
+
|
|
42
46
|
/**
|
|
43
47
|
* Peek's rule, sharpened: the first letter of the first two words — counting
|
|
44
48
|
* only words that begin with a letter or digit, so "Claude (steered by
|
|
@@ -72,10 +76,52 @@ export interface AvatarProps {
|
|
|
72
76
|
* of a name, not text, and a screen reader was reading them as text.
|
|
73
77
|
*/
|
|
74
78
|
label?: string
|
|
79
|
+
/**
|
|
80
|
+
* **An agent's face**: a robot in place of the initials, for a profile that says it is an agent (NIP-24's `bot`).
|
|
81
|
+
* Its picture still wins when it has one. Never worked out from the name: "steered by" is a name, not a marker.
|
|
82
|
+
*/
|
|
83
|
+
bot?: boolean
|
|
75
84
|
className?: string
|
|
76
85
|
}
|
|
77
86
|
|
|
78
|
-
|
|
87
|
+
/**
|
|
88
|
+
* An agent's robot: Remix Icon's `robot-2-fill`, copied as its one path rather than a second icon package, because
|
|
89
|
+
* Tabler has no solid robot (Katerina, 1 November, from six drawings in four open sets).
|
|
90
|
+
* Remix Icon License v1.0, Copyright (c) 2017–2026 Remix Design: use in a product is allowed; not as a logo, and
|
|
91
|
+
* not resold as icons.
|
|
92
|
+
*/
|
|
93
|
+
const ROBOT_PATH =
|
|
94
|
+
'M13.5 2C13.5 2.44425 13.3069 2.84339 13 3.11805V5H18C19.6569 5 21 6.34315 21 8V18C21 19.6569 19.6569 21 18 21H6C4.34315 21 3 19.6569 3 18V8C3 6.34315 4.34315 5 6 5H11V3.11805C10.6931 2.84339 10.5 2.44425 10.5 2C10.5 1.17157 11.1716 0.5 12 0.5C12.8284 0.5 13.5 1.17157 13.5 2ZM0 10H2V16H0V10ZM24 10H22V16H24V10ZM9 14.5C9.82843 14.5 10.5 13.8284 10.5 13C10.5 12.1716 9.82843 11.5 9 11.5C8.17157 11.5 7.5 12.1716 7.5 13C7.5 13.8284 8.17157 14.5 9 14.5ZM16.5 13C16.5 12.1716 15.8284 11.5 15 11.5C14.1716 11.5 13.5 12.1716 13.5 13C13.5 13.8284 14.1716 14.5 15 14.5C15.8284 14.5 16.5 13.8284 16.5 13Z'
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* An agent's colour: lime, the same in every theme and on the initials' light and shade (Katerina, 1 November). No
|
|
98
|
+
* person's hue is near it, so an agent never reads as a person, nor as the yellow urgent mark.
|
|
99
|
+
*/
|
|
100
|
+
const AGENT_HUE = '#d4ee4a'
|
|
101
|
+
|
|
102
|
+
/** An agent's face: the robot, larger than the silhouette (5/8 of the tile), so it still reads at 16px. */
|
|
103
|
+
function AgentFace({ size }: { size: number }) {
|
|
104
|
+
const glyph = Math.round(size * 0.625)
|
|
105
|
+
return (
|
|
106
|
+
<BaseAvatar.Fallback
|
|
107
|
+
render={<div />}
|
|
108
|
+
className="w-full h-full flex items-center justify-center"
|
|
109
|
+
style={{
|
|
110
|
+
/* eslint-disable no-restricted-syntax -- @estiva-escape: one colour in every theme, on the initials' light
|
|
111
|
+
and shade, and their ink: a palette, as HUES, so none of it can be a token. */
|
|
112
|
+
background: groundFor(AGENT_HUE),
|
|
113
|
+
color: '#08121c',
|
|
114
|
+
/* eslint-enable no-restricted-syntax */
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<svg width={glyph} height={glyph} viewBox="0 0 24 24" fill="currentColor" aria-hidden>
|
|
118
|
+
<path d={ROBOT_PATH} />
|
|
119
|
+
</svg>
|
|
120
|
+
</BaseAvatar.Fallback>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function Avatar({ src, name, alt = '', size = 36, label: spoken, bot = false, className }: AvatarProps) {
|
|
79
125
|
const label = name || alt
|
|
80
126
|
// No picture handed in: the app's own, when it has said where pictures live (`AppProvider`).
|
|
81
127
|
const pictureFor = usePictureFor()
|
|
@@ -107,7 +153,9 @@ export function Avatar({ src, name, alt = '', size = 36, label: spoken, classNam
|
|
|
107
153
|
className="w-full h-full object-cover data-[error]:hidden"
|
|
108
154
|
/>
|
|
109
155
|
)}
|
|
110
|
-
{
|
|
156
|
+
{bot ? (
|
|
157
|
+
<AgentFace size={size} />
|
|
158
|
+
) : label ? (
|
|
111
159
|
<BaseAvatar.Fallback
|
|
112
160
|
render={<div />}
|
|
113
161
|
/*
|
|
@@ -133,7 +181,7 @@ export function Avatar({ src, name, alt = '', size = 36, label: spoken, classNam
|
|
|
133
181
|
// ink cannot be a token either.
|
|
134
182
|
color: '#08121c',
|
|
135
183
|
fontSize: Math.round(size * 0.36),
|
|
136
|
-
background:
|
|
184
|
+
background: groundFor(hueFor(label)),
|
|
137
185
|
/* eslint-enable no-restricted-syntax */
|
|
138
186
|
}}
|
|
139
187
|
>
|
package/src/AvatarGroup.tsx
CHANGED
|
@@ -20,6 +20,8 @@ export interface AvatarGroupMember {
|
|
|
20
20
|
name: string
|
|
21
21
|
/** Resolved by the caller. Absent draws the initials. */
|
|
22
22
|
picture?: string
|
|
23
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
24
|
+
bot?: boolean
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export interface AvatarGroupProps {
|
|
@@ -67,7 +69,7 @@ export function AvatarGroup({ members, size = 24, on = 'surface' }: AvatarGroupP
|
|
|
67
69
|
{/* Each face says whose it is: a stack stands on its own, with no
|
|
68
70
|
name beside it to borrow. It read as its initials before —
|
|
69
71
|
"AD BC CD" — which is the drawing, not the person. */}
|
|
70
|
-
<Avatar size={size} name={member.name} src={member.picture} label={member.name} />
|
|
72
|
+
<Avatar size={size} name={member.name} src={member.picture} bot={member.bot} label={member.name} />
|
|
71
73
|
</span>
|
|
72
74
|
))}
|
|
73
75
|
</div>
|
|
@@ -36,6 +36,8 @@ const PEOPLE: MentionPerson[] = ['one', 'two', 'three', 'four', 'five', 'six', '
|
|
|
36
36
|
description: i % 2 === 0 ? 'Label' : undefined,
|
|
37
37
|
pubkey: null,
|
|
38
38
|
}))
|
|
39
|
+
// An agent among them, second, so `@` shows its robot face at once.
|
|
40
|
+
PEOPLE.splice(1, 0, { id: 'agent', name: 'Agent (steered by Person one)', description: 'Agent', pubkey: null, bot: true })
|
|
39
41
|
|
|
40
42
|
const ITEMS: CaptionedItem[] = ['one', 'two', 'three'].map((n) => ({
|
|
41
43
|
id: `item-${n}`,
|
package/src/ComposerTriggers.tsx
CHANGED
|
@@ -40,6 +40,8 @@ export interface MentionPerson {
|
|
|
40
40
|
pubkey?: string | null
|
|
41
41
|
/** The face at the row's start. Default: the package `Avatar` for the name. */
|
|
42
42
|
avatar?: ReactNode
|
|
43
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
44
|
+
bot?: boolean
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/** How many people the list shows. */
|
|
@@ -67,7 +69,7 @@ export function peopleMenu(urgent: boolean): SuggestionPopupOptions<MentionPerso
|
|
|
67
69
|
row: (person) => ({
|
|
68
70
|
label: person.name,
|
|
69
71
|
description: person.description,
|
|
70
|
-
leading: person.avatar ?? <Avatar size={32} alt={person.name} />,
|
|
72
|
+
leading: person.avatar ?? <Avatar size={32} alt={person.name} bot={person.bot} />,
|
|
71
73
|
hint: <EnterHint />,
|
|
72
74
|
size: 'tall',
|
|
73
75
|
}),
|
package/src/ConversationCard.tsx
CHANGED
|
@@ -23,6 +23,8 @@ import { UrgentMark } from './UrgentMark'
|
|
|
23
23
|
export interface ConversationPerson {
|
|
24
24
|
name: string
|
|
25
25
|
picture?: string
|
|
26
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
27
|
+
bot?: boolean
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
/** What a comment and a reply share. */
|
|
@@ -98,7 +100,7 @@ function Head({ author, time, timeHref, edited, isNew, urgent, meta }: Pick<Conv
|
|
|
98
100
|
<div className="flex w-full items-center gap-2">
|
|
99
101
|
<div className="flex min-w-0 flex-1 items-center gap-2">
|
|
100
102
|
<span data-face className="relative flex shrink-0">
|
|
101
|
-
<Avatar size={24} src={author.picture} alt={author.name} />
|
|
103
|
+
<Avatar size={24} src={author.picture} alt={author.name} bot={author.bot} />
|
|
102
104
|
</span>
|
|
103
105
|
<span className="min-w-0 truncate text-body-2-strong text-text-primary">{author.name}</span>
|
|
104
106
|
{timeHref ? (
|
|
@@ -195,7 +197,7 @@ function Editing({ author, children }: { author: ConversationPerson; children: R
|
|
|
195
197
|
return (
|
|
196
198
|
<div className="p-2">
|
|
197
199
|
<div className="flex items-start gap-2">
|
|
198
|
-
<Avatar size={24} src={author.picture} alt={author.name} className="mt-1 shrink-0" />
|
|
200
|
+
<Avatar size={24} src={author.picture} alt={author.name} bot={author.bot} className="mt-1 shrink-0" />
|
|
199
201
|
<div className="min-w-0 flex-1">{children}</div>
|
|
200
202
|
</div>
|
|
201
203
|
</div>
|
package/src/LinkCard.tsx
CHANGED
|
@@ -115,7 +115,7 @@ function CardBody({ linked, readOnly }: { linked: Linked; readOnly: boolean }) {
|
|
|
115
115
|
</Link>
|
|
116
116
|
)}
|
|
117
117
|
</span>
|
|
118
|
-
{child.owner ? <Avatar name={child.owner.name} src={child.owner.picture} size={16} /> : <span className="size-4 shrink-0" aria-hidden />}
|
|
118
|
+
{child.owner ? <Avatar name={child.owner.name} src={child.owner.picture} bot={child.owner.bot} size={16} /> : <span className="size-4 shrink-0" aria-hidden />}
|
|
119
119
|
</div>
|
|
120
120
|
))}
|
|
121
121
|
</div>
|
|
@@ -127,7 +127,7 @@ function CardBody({ linked, readOnly }: { linked: Linked; readOnly: boolean }) {
|
|
|
127
127
|
<span className="text-caption text-text-muted">Latest conversation</span>
|
|
128
128
|
<div className={cn('flex flex-col gap-1', QUOTE_BAR_CLASSES)}>
|
|
129
129
|
<span className="flex items-center gap-2 text-caption">
|
|
130
|
-
<Avatar name={linked.latest.author.name} src={linked.latest.author.picture} size={16} />
|
|
130
|
+
<Avatar name={linked.latest.author.name} src={linked.latest.author.picture} bot={linked.latest.author.bot} size={16} />
|
|
131
131
|
<span className="text-text-primary">{linked.latest.author.name}</span>
|
|
132
132
|
<span className={cn('text-text-muted', TIME_CLASSES)}>{linked.latest.at}</span>
|
|
133
133
|
</span>
|
|
@@ -160,7 +160,7 @@ function SaidBody({ linked }: { linked: Linked }) {
|
|
|
160
160
|
return (
|
|
161
161
|
<>
|
|
162
162
|
<div className="flex items-center gap-2">
|
|
163
|
-
<Avatar name={author.name} src={author.picture} size={24} />
|
|
163
|
+
<Avatar name={author.name} src={author.picture} bot={author.bot} size={24} />
|
|
164
164
|
{/* No "Open" in a missing time's place (Katerina, 30 Oct): the name is the link then. */}
|
|
165
165
|
<span className="text-body-2-strong text-text-primary">
|
|
166
166
|
{linked.updated ? author.name : <CardLink href={linked.href}>{author.name}</CardLink>}
|
package/src/LinkChip.tsx
CHANGED
|
@@ -45,7 +45,7 @@ export function LinkChip({ link, preview = true }: LinkChipProps) {
|
|
|
45
45
|
const said = linked.kind === 'message' && linked.author
|
|
46
46
|
const chip = (
|
|
47
47
|
<InlineChip
|
|
48
|
-
icon={said ? <Avatar name={said.name} src={said.picture} size={14} /> : <LinkedIcon kind={linked.kind} size={14} tone="inherit" />}
|
|
48
|
+
icon={said ? <Avatar name={said.name} src={said.picture} bot={said.bot} size={14} /> : <LinkedIcon kind={linked.kind} size={14} tone="inherit" />}
|
|
49
49
|
// No address to open (another app's file with none over https): a label, not a link to nowhere.
|
|
50
50
|
href={linked.href || undefined}
|
|
51
51
|
// Never wider than its line. With its hover card, the card's wrapper holds it to the line (max-w-full): a share of the
|
package/src/LinkParts.tsx
CHANGED
|
@@ -62,8 +62,8 @@ export function kindNounOf(linked: Pick<Linked, 'kind' | 'noun'>): string | unde
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/** The 36px tile a link's kind sits in, as a file's type does in AttachmentCard; words a person wrote show their face. */
|
|
65
|
-
export function LinkTile({ kind, author }: { kind: LinkedKind; author?: { name: string; picture?: string } }) {
|
|
66
|
-
if (author) return <Avatar name={author.name} src={author.picture} size={36} />
|
|
65
|
+
export function LinkTile({ kind, author }: { kind: LinkedKind; author?: { name: string; picture?: string; bot?: boolean } }) {
|
|
66
|
+
if (author) return <Avatar name={author.name} src={author.picture} bot={author.bot} size={36} />
|
|
67
67
|
return (
|
|
68
68
|
<span className={TYPE_TILE_CLASSES}>
|
|
69
69
|
<LinkedIcon kind={kind} />
|
|
@@ -159,9 +159,9 @@ export interface LinkPickersProps {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
/** The face for an owner option: nobody (value `''`, "Unassigned") is the silhouette, never a letter (Katerina, 30 Oct). */
|
|
162
|
-
function OwnerFace({ option }: { option: { value: string; label: string; picture?: string } | undefined }) {
|
|
162
|
+
function OwnerFace({ option }: { option: { value: string; label: string; picture?: string; bot?: boolean } | undefined }) {
|
|
163
163
|
const nobody = !option || option.value === ''
|
|
164
|
-
return <Avatar name={nobody ? undefined : option.label} src={nobody ? undefined : option.picture} size={16} />
|
|
164
|
+
return <Avatar name={nobody ? undefined : option.label} src={nobody ? undefined : option.picture} bot={!nobody && option.bot} size={16} />
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/**
|
package/src/LinkRow.tsx
CHANGED
|
@@ -170,7 +170,7 @@ export function LinkRow({ link, preview = true }: LinkRowProps) {
|
|
|
170
170
|
{/* A ring already says how far along it is. */}
|
|
171
171
|
{linked.done ? <ProgressRing done={linked.done.done} total={linked.done.total} /> : status?.colour && <StatusMark status={{ label: status.label, colour: status.colour }} />}
|
|
172
172
|
{linked.conversation && <CommentCount conversation={linked.conversation} noun={linked.conversation.noun} />}
|
|
173
|
-
{owner && <Avatar name={owner.label} src={owner.picture} size={16} />}
|
|
173
|
+
{owner && <Avatar name={owner.label} src={owner.picture} bot={owner.bot} size={16} />}
|
|
174
174
|
{linked.members && <AvatarGroup members={linked.members} size={16} on="inset" />}
|
|
175
175
|
{linked.authors && <AvatarGroup members={linked.authors} size={16} on="inset" />}
|
|
176
176
|
</span>
|
|
@@ -77,3 +77,14 @@ export const Long: Story = {
|
|
|
77
77
|
export const AddLayer: Story = {
|
|
78
78
|
args: { initialView: 'add' },
|
|
79
79
|
}
|
|
80
|
+
|
|
81
|
+
/** An agent among the members: its face is a robot (`bot`). */
|
|
82
|
+
export const WithAnAgent: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
members: [
|
|
85
|
+
{ id: 'me', name: 'You', caption: 'Product designer' },
|
|
86
|
+
{ id: 'ana', name: 'Ana Duarte', caption: 'Assignee' },
|
|
87
|
+
{ id: 'agent', name: 'Agent (steered by Ana Duarte)', caption: 'Agent', bot: true },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
}
|
package/src/MembersDialog.tsx
CHANGED
|
@@ -16,6 +16,8 @@ export interface MembersDialogMember {
|
|
|
16
16
|
name: string
|
|
17
17
|
/** A picture URL, resolved by the caller, as `Avatar` takes its `src`. */
|
|
18
18
|
picture?: string
|
|
19
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
20
|
+
bot?: boolean
|
|
19
21
|
/** The line under the name: a role, a relation ("Assignee"), or a state. */
|
|
20
22
|
caption?: string
|
|
21
23
|
}
|
|
@@ -23,6 +25,8 @@ export interface MembersDialogMember {
|
|
|
23
25
|
/** Somebody who can be added: a `ChipInput` option with a face. */
|
|
24
26
|
export interface MembersDialogCandidate extends ChipInputOption {
|
|
25
27
|
picture?: string
|
|
28
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
29
|
+
bot?: boolean
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
/** What the viewer's own row offers: in when they are out, out when they are in. */
|
|
@@ -132,8 +136,8 @@ export function MembersDialog({ members, count, self, candidates = [], onAdd, no
|
|
|
132
136
|
options={candidates}
|
|
133
137
|
placeholder="Search people..."
|
|
134
138
|
excludeIds={members.map((m) => m.id)}
|
|
135
|
-
chipLeading={(o) => <Avatar name={o.label} src={o.picture} size={16} />}
|
|
136
|
-
rowLeading={(o) => <Avatar name={o.label} src={o.picture} size={32} />}
|
|
139
|
+
chipLeading={(o) => <Avatar name={o.label} src={o.picture} bot={o.bot} size={16} />}
|
|
140
|
+
rowLeading={(o) => <Avatar name={o.label} src={o.picture} bot={o.bot} size={32} />}
|
|
137
141
|
autoFocus
|
|
138
142
|
/>
|
|
139
143
|
</Field>
|
|
@@ -182,7 +186,7 @@ export function MembersDialog({ members, count, self, candidates = [], onAdd, no
|
|
|
182
186
|
)}
|
|
183
187
|
{roster.map((member) => (
|
|
184
188
|
<div key={member.id} className="flex h-12 items-center gap-3 px-5">
|
|
185
|
-
<Avatar size={32} name={member.name} src={member.picture} />
|
|
189
|
+
<Avatar size={32} name={member.name} src={member.picture} bot={member.bot} />
|
|
186
190
|
<div className="flex min-w-0 flex-1 flex-col justify-center gap-[2px]">
|
|
187
191
|
<div className="truncate text-body-2 text-text-primary">{member.name}</div>
|
|
188
192
|
{member.caption && <div className="truncate text-caption text-text-secondary">{member.caption}</div>}
|
package/src/Person.tsx
CHANGED
|
@@ -20,19 +20,21 @@ import { Avatar } from './Avatar'
|
|
|
20
20
|
export interface PersonProps {
|
|
21
21
|
name?: string
|
|
22
22
|
picture?: string
|
|
23
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
24
|
+
bot?: boolean
|
|
23
25
|
/** Shown in place of a missing name. */
|
|
24
26
|
fallback?: string
|
|
25
27
|
size?: number
|
|
26
28
|
className?: string
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
export function Person({ name, picture, fallback = '—', size = 20, className }: PersonProps) {
|
|
31
|
+
export function Person({ name, picture, bot, fallback = '—', size = 20, className }: PersonProps) {
|
|
30
32
|
return (
|
|
31
33
|
// gap-2: the face-to-name distance is one rule (8px) wherever a person
|
|
32
34
|
// appears — Katerina, 2026-09-01, set on Person so PersonTrigger and every
|
|
33
35
|
// row agree by construction.
|
|
34
36
|
<span className={cn('flex min-w-0 items-center gap-2', className)}>
|
|
35
|
-
<Avatar name={name} src={picture} size={size} />
|
|
37
|
+
<Avatar name={name} src={picture} bot={bot} size={size} />
|
|
36
38
|
<span className={cn('truncate', !name && 'text-text-muted')}>{name ?? fallback}</span>
|
|
37
39
|
</span>
|
|
38
40
|
)
|
package/src/PersonTrigger.tsx
CHANGED
|
@@ -29,7 +29,7 @@ export interface PersonTriggerProps
|
|
|
29
29
|
compact?: boolean
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export function PersonTrigger({ name, picture, fallback, size, open = false, compact = false, className, ...props }: PersonTriggerProps) {
|
|
32
|
+
export function PersonTrigger({ name, picture, bot, fallback, size, open = false, compact = false, className, ...props }: PersonTriggerProps) {
|
|
33
33
|
if (compact) {
|
|
34
34
|
return (
|
|
35
35
|
<BaseButton
|
|
@@ -56,7 +56,7 @@ export function PersonTrigger({ name, picture, fallback, size, open = false, com
|
|
|
56
56
|
className={cn('cursor-pointer rounded-full', className)}
|
|
57
57
|
{...props}
|
|
58
58
|
>
|
|
59
|
-
<Avatar name={name} src={picture} size={size ?? 36} />
|
|
59
|
+
<Avatar name={name} src={picture} bot={bot} size={size ?? 36} />
|
|
60
60
|
</BaseButton>
|
|
61
61
|
)
|
|
62
62
|
}
|
|
@@ -78,7 +78,7 @@ export function PersonTrigger({ name, picture, fallback, size, open = false, com
|
|
|
78
78
|
)}
|
|
79
79
|
{...props}
|
|
80
80
|
>
|
|
81
|
-
<Person name={name} picture={picture} fallback={fallback} size={size ?? 22} />
|
|
81
|
+
<Person name={name} picture={picture} bot={bot} fallback={fallback} size={size ?? 22} />
|
|
82
82
|
<IconChevronDown size={14} stroke={1.5} className="shrink-0 text-text-muted" />
|
|
83
83
|
</BaseButton>
|
|
84
84
|
)
|
package/src/PinnedComment.tsx
CHANGED
|
@@ -26,7 +26,7 @@ export function PinnedComment({ author, time, words, deleted = false }: PinnedCo
|
|
|
26
26
|
) : (
|
|
27
27
|
<div className="flex flex-col p-2">
|
|
28
28
|
<div className="flex items-center gap-2">
|
|
29
|
-
<Avatar size={24} src={author.picture} alt={author.name} />
|
|
29
|
+
<Avatar size={24} src={author.picture} alt={author.name} bot={author.bot} />
|
|
30
30
|
<span className="min-w-0 truncate text-body-2-strong text-text-primary">{author.name}</span>
|
|
31
31
|
<MetaText className="shrink-0">{time}</MetaText>
|
|
32
32
|
</div>
|
package/src/RepliesRow.tsx
CHANGED
|
@@ -8,7 +8,7 @@ export interface RepliesRowProps {
|
|
|
8
8
|
/** How many replies. */
|
|
9
9
|
count: number
|
|
10
10
|
/** Who replied: their faces. */
|
|
11
|
-
faces?: readonly { name: string; picture?: string }[]
|
|
11
|
+
faces?: readonly { name: string; picture?: string; bot?: boolean }[]
|
|
12
12
|
/** The last reply's time, in the app's words. */
|
|
13
13
|
last?: string
|
|
14
14
|
/** "1 new": a reply you have not read. */
|
|
@@ -39,7 +39,7 @@ export function RepliesRow({ count, faces, last, isNew = false, urgent = false,
|
|
|
39
39
|
<>
|
|
40
40
|
{withFaces && (
|
|
41
41
|
<span className="flex shrink-0 items-center">
|
|
42
|
-
<AvatarGroup size={18} members={faces.map((f) => ({ name: f.name, picture: f.picture }))} />
|
|
42
|
+
<AvatarGroup size={18} members={faces.map((f) => ({ name: f.name, picture: f.picture, bot: f.bot }))} />
|
|
43
43
|
</span>
|
|
44
44
|
)}
|
|
45
45
|
<IconMessage2
|