@estiva-app/ui 0.122.0 → 0.123.1
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/ErrorBoundary.d.ts +6 -0
- package/dist/ErrorBoundary.d.ts.map +1 -1
- package/dist/Select.d.ts +2 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +2 -2
- package/dist/linked.d.ts +6 -0
- package/dist/linked.d.ts.map +1 -1
- package/dist/linkedFrom.d.ts +5 -0
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +21 -2
- package/src/ErrorBoundary.test.tsx +21 -1
- package/src/ErrorBoundary.tsx +16 -0
- package/src/LinkParts.tsx +1 -1
- package/src/Select.stories.tsx +11 -0
- package/src/Select.test.tsx +16 -0
- package/src/Select.tsx +6 -2
- package/src/index.ts +1 -1
- package/src/linked.ts +6 -0
- package/src/linkedFrom.test.tsx +25 -1
- package/src/linkedFrom.ts +15 -4
- package/src/registry/registry.test.ts +3 -3
package/dist/linked.d.ts
CHANGED
|
@@ -31,6 +31,12 @@ export interface PickerOption {
|
|
|
31
31
|
picture?: string;
|
|
32
32
|
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
33
33
|
bot?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Shown but not offered: the current value when the picker cannot offer it,
|
|
36
|
+
* a status no listing names. Greyed, above the rest; picking another replaces
|
|
37
|
+
* it (Miky, 30 Oct, EAC-2).
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
34
40
|
}
|
|
35
41
|
/**
|
|
36
42
|
* 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,KAA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AAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,SAAS,GAAG,SAAS,CAAA;IAC3D,2FAA2F;IAC3F,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;IAC5C,gBAAgB;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAoBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;CAAO,GAAG,eAAe,CA4C5J;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IAC5B,gFAAgF;IAChF,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,gBAAgB;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,oHAAoH;AACpH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,iBAAiB,CAuCpF"}
|
package/dist/linkedFrom.d.ts
CHANGED
|
@@ -47,6 +47,11 @@ export interface LinkedSource {
|
|
|
47
47
|
archived?: unknown;
|
|
48
48
|
/** When it last changed, in seconds (interop 0.64). */
|
|
49
49
|
changedAt?: number;
|
|
50
|
+
/** How far along it is, as interop counts it for every app (interop 0.102): done over every child not dropped. */
|
|
51
|
+
progress?: {
|
|
52
|
+
done: number;
|
|
53
|
+
total: number;
|
|
54
|
+
};
|
|
50
55
|
}
|
|
51
56
|
/** `T` is the app's own object type (interop's `ForeignObject`), so `hrefOf` takes it as it is. */
|
|
52
57
|
export interface LinkedFromOptions<T extends LinkedSource = LinkedSource> {
|
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;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;IACb,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC9D;AAED,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,C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AAM,EAAE,MAAM,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;AAoLD,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,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7F,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,SAAS,CAkBX"}
|
package/package.json
CHANGED
package/registry.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"kind": "package",
|
|
5
5
|
"repo": "estiva-ui",
|
|
6
6
|
"package": "@estiva-app/ui",
|
|
7
|
-
"packageVersion": "0.
|
|
8
|
-
"exports":
|
|
7
|
+
"packageVersion": "0.123.1",
|
|
8
|
+
"exports": 257,
|
|
9
9
|
"typeExports": 270,
|
|
10
10
|
"files": null
|
|
11
11
|
},
|
|
@@ -10160,6 +10160,25 @@
|
|
|
10160
10160
|
"app": null,
|
|
10161
10161
|
"looks": []
|
|
10162
10162
|
},
|
|
10163
|
+
{
|
|
10164
|
+
"name": "reportCrashesTo",
|
|
10165
|
+
"repo": "estiva-ui",
|
|
10166
|
+
"kind": "helper",
|
|
10167
|
+
"importPath": "@estiva-app/ui",
|
|
10168
|
+
"sourceFile": "src/ErrorBoundary.tsx",
|
|
10169
|
+
"purpose": "Where every ErrorBoundary sends the crash it caught, set once by the app at start (Peek passes its error reporter, `@estiva-app/platform`).",
|
|
10170
|
+
"purposeFrom": "comment",
|
|
10171
|
+
"props": [],
|
|
10172
|
+
"variants": [],
|
|
10173
|
+
"ownsBehaviours": [],
|
|
10174
|
+
"status": "stable",
|
|
10175
|
+
"migrationStage": null,
|
|
10176
|
+
"docsId": "status-feedback-errorboundary--docs",
|
|
10177
|
+
"storyId": "status-feedback-errorboundary--in-a-panel",
|
|
10178
|
+
"docPage": null,
|
|
10179
|
+
"app": null,
|
|
10180
|
+
"looks": []
|
|
10181
|
+
},
|
|
10163
10182
|
{
|
|
10164
10183
|
"name": "ResolveDialog",
|
|
10165
10184
|
"repo": "estiva-ui",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
4
4
|
import { cleanup, fireEvent, render, screen } from '@testing-library/react'
|
|
5
5
|
import { useState } from 'react'
|
|
6
|
-
import { ErrorBoundary } from './ErrorBoundary'
|
|
6
|
+
import { ErrorBoundary, reportCrashesTo } from './ErrorBoundary'
|
|
7
7
|
|
|
8
8
|
afterEach(cleanup)
|
|
9
9
|
|
|
@@ -76,4 +76,24 @@ describe('ErrorBoundary', () => {
|
|
|
76
76
|
render(<Harness />)
|
|
77
77
|
expect(vi.mocked(console.error).mock.calls.some((call) => String(call[0]).startsWith('test panel crashed:'))).toBe(true)
|
|
78
78
|
})
|
|
79
|
+
|
|
80
|
+
describe('reporting the crash', () => {
|
|
81
|
+
afterEach(() => reportCrashesTo(undefined))
|
|
82
|
+
|
|
83
|
+
it('hands the error it caught to the reporter the app set', () => {
|
|
84
|
+
const reported: unknown[] = []
|
|
85
|
+
reportCrashesTo((error) => reported.push(error))
|
|
86
|
+
render(<Harness />)
|
|
87
|
+
expect(reported).toHaveLength(1)
|
|
88
|
+
expect((reported[0] as Error).message).toBe('boom')
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it('still shows the message when the reporter itself throws', () => {
|
|
92
|
+
reportCrashesTo(() => {
|
|
93
|
+
throw new Error('reporter broke')
|
|
94
|
+
})
|
|
95
|
+
render(<Harness />)
|
|
96
|
+
expect(screen.getByText(/Something went wrong in the test panel/)).toBeTruthy()
|
|
97
|
+
})
|
|
98
|
+
})
|
|
79
99
|
})
|
package/src/ErrorBoundary.tsx
CHANGED
|
@@ -24,6 +24,17 @@ interface ErrorBoundaryState {
|
|
|
24
24
|
hasError: boolean
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
let crashReporter: ((error: unknown) => void) | undefined
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Where every ErrorBoundary sends the crash it caught, set once by the app at
|
|
31
|
+
* start (Peek passes its error reporter, `@estiva-app/platform`). Pass nothing
|
|
32
|
+
* to stop. A reporter that throws never breaks the message on screen.
|
|
33
|
+
*/
|
|
34
|
+
export function reportCrashesTo(reporter: ((error: unknown) => void) | undefined): void {
|
|
35
|
+
crashReporter = reporter
|
|
36
|
+
}
|
|
37
|
+
|
|
27
38
|
/** Keeps a crash inside what it holds: the rest of the page keeps working, and Try again draws it again. */
|
|
28
39
|
export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
29
40
|
state: ErrorBoundaryState = { hasError: false }
|
|
@@ -34,6 +45,11 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
|
|
|
34
45
|
|
|
35
46
|
componentDidCatch(error: unknown, info: { componentStack?: string | null }) {
|
|
36
47
|
console.error(`${this.props.label ?? 'part of the page'} crashed:`, error, info.componentStack ?? '')
|
|
48
|
+
try {
|
|
49
|
+
crashReporter?.(error)
|
|
50
|
+
} catch {
|
|
51
|
+
// Reporting a crash must never become a second one.
|
|
52
|
+
}
|
|
37
53
|
}
|
|
38
54
|
|
|
39
55
|
render() {
|
package/src/LinkParts.tsx
CHANGED
|
@@ -193,7 +193,7 @@ export function LinkPickers({ status, owner, ownerLabel = 'Owner', readOnly = fa
|
|
|
193
193
|
onChange={(value) => status.onChange?.(value)}
|
|
194
194
|
ariaLabel="Status"
|
|
195
195
|
disabledReason={disabledReason}
|
|
196
|
-
options={status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && <StatusIcon colour={option.colour}
|
|
196
|
+
options={status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && <StatusIcon colour={option.colour} />, ...(option.disabled ? { disabled: true } : {}) }))}
|
|
197
197
|
/>
|
|
198
198
|
))}
|
|
199
199
|
{owner &&
|
package/src/Select.stories.tsx
CHANGED
|
@@ -85,6 +85,17 @@ export const WithLeading: Story = {
|
|
|
85
85
|
),
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/** A current value the select cannot offer: shown first and greyed, as a shut menu row; picking another replaces it. */
|
|
89
|
+
export const ACurrentValueNotOffered: Story = {
|
|
90
|
+
render: (args) => (
|
|
91
|
+
<Demo
|
|
92
|
+
{...args}
|
|
93
|
+
initial="blocked"
|
|
94
|
+
options={[{ value: 'blocked', label: 'blocked', disabled: true }, ...args.options]}
|
|
95
|
+
/>
|
|
96
|
+
),
|
|
97
|
+
}
|
|
98
|
+
|
|
88
99
|
/** In a `Field`, which is how a select appears in a form. */
|
|
89
100
|
export const InAField: Story = {
|
|
90
101
|
render: (args) => (
|
package/src/Select.test.tsx
CHANGED
|
@@ -57,6 +57,22 @@ describe('Select', () => {
|
|
|
57
57
|
expect(trigger.getAttribute('aria-expanded')).toBe('false')
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
+
it('a disabled option is shown as the current value but cannot be picked; another one can', async () => {
|
|
61
|
+
const user = userEvent.setup()
|
|
62
|
+
const onChange = vi.fn()
|
|
63
|
+
const options = [{ value: 'item', label: 'Item one', disabled: true }, ...STATUSES]
|
|
64
|
+
render(<Select value="item" onChange={onChange} options={options} ariaLabel="Status" />)
|
|
65
|
+
const trigger = screen.getByRole('combobox', { name: 'Status' })
|
|
66
|
+
expect(trigger.textContent).toContain('Item one')
|
|
67
|
+
await user.click(trigger)
|
|
68
|
+
const shut = await screen.findByRole('option', { name: /Item one/ })
|
|
69
|
+
expect(shut.getAttribute('aria-disabled')).toBe('true')
|
|
70
|
+
await user.click(shut)
|
|
71
|
+
expect(onChange).not.toHaveBeenCalled()
|
|
72
|
+
await user.click(screen.getByRole('option', { name: 'Done' }))
|
|
73
|
+
expect(onChange).toHaveBeenCalledWith('done')
|
|
74
|
+
})
|
|
75
|
+
|
|
60
76
|
it('disabledReason: held shut, reachable by Tab, and it says why', async () => {
|
|
61
77
|
const user = userEvent.setup()
|
|
62
78
|
const onChange = vi.fn()
|
package/src/Select.tsx
CHANGED
|
@@ -40,6 +40,8 @@ export interface SelectOption {
|
|
|
40
40
|
label: string
|
|
41
41
|
/** Drawn before the label, 16px — an Avatar, an icon. */
|
|
42
42
|
leading?: ReactNode
|
|
43
|
+
/** Shown, greyed, and not pickable: a current value the select cannot offer (a status no listing names). */
|
|
44
|
+
disabled?: boolean
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
export interface SelectProps {
|
|
@@ -201,6 +203,7 @@ export function Select({ value, onChange, options, size = 'default', fill = 'fie
|
|
|
201
203
|
<BaseSelect.Item
|
|
202
204
|
key={option.value}
|
|
203
205
|
value={option.value}
|
|
206
|
+
disabled={option.disabled}
|
|
204
207
|
/* The highlight is Base UI's `data-highlighted` — pointer and
|
|
205
208
|
keyboard set the same attribute, so what the DOM says and
|
|
206
209
|
what the row looks like cannot disagree. It used to be an
|
|
@@ -211,11 +214,12 @@ export function Select({ value, onChange, options, size = 'default', fill = 'fie
|
|
|
211
214
|
Select adds is its own: the ✓ at the end, and the chosen
|
|
212
215
|
row in medium weight. No fade on the highlight, as in every
|
|
213
216
|
menu (Katerina, 2026-09-05). */
|
|
214
|
-
|
|
217
|
+
// A disabled option is a shut row, as a MenuItem with its reason: the arrow, no fill, its words and icon greyed.
|
|
218
|
+
className={cn(menuItemClassName({ size: 'default', shut: option.disabled }), 'justify-between data-[selected]:font-medium')}
|
|
215
219
|
>
|
|
216
220
|
<span className="flex min-w-0 items-center gap-2">
|
|
217
221
|
{option.leading && <span className="flex shrink-0 items-center">{option.leading}</span>}
|
|
218
|
-
<BaseSelect.ItemText className=
|
|
222
|
+
<BaseSelect.ItemText className={cn('truncate text-body-2', option.disabled ? 'text-text-disabled' : 'text-text-primary')}>{option.label}</BaseSelect.ItemText>
|
|
219
223
|
</span>
|
|
220
224
|
<BaseSelect.ItemIndicator
|
|
221
225
|
render={<IconCheck size={16} stroke={1.5} className="shrink-0 text-text-secondary" />}
|
package/src/index.ts
CHANGED
|
@@ -76,7 +76,7 @@ export { Divider, type DividerProps } from './Divider'
|
|
|
76
76
|
export { EditableText, type EditableTextAnswer, type EditableTextOutcome, type EditableTextProps } from './EditableText'
|
|
77
77
|
export { EmptyState, type EmptyStateProps } from './EmptyState'
|
|
78
78
|
export { EntryShell, type EntryShellProps } from './EntryShell'
|
|
79
|
-
export { ErrorBoundary, type ErrorBoundaryProps } from './ErrorBoundary'
|
|
79
|
+
export { ErrorBoundary, reportCrashesTo, type ErrorBoundaryProps } from './ErrorBoundary'
|
|
80
80
|
export { ProgressBar, type ProgressBarProps, type ProgressBarVariant } from './ProgressBar'
|
|
81
81
|
export { SkeletonBar, SkeletonConversation, SkeletonList, SkeletonRow } from './Skeleton'
|
|
82
82
|
export { Breadcrumb, type BreadcrumbProps, type Crumb } from './Breadcrumb'
|
package/src/linked.ts
CHANGED
|
@@ -48,6 +48,12 @@ export interface PickerOption {
|
|
|
48
48
|
picture?: string
|
|
49
49
|
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
50
50
|
bot?: boolean
|
|
51
|
+
/**
|
|
52
|
+
* Shown but not offered: the current value when the picker cannot offer it,
|
|
53
|
+
* a status no listing names. Greyed, above the rest; picking another replaces
|
|
54
|
+
* it (Miky, 30 Oct, EAC-2).
|
|
55
|
+
*/
|
|
56
|
+
disabled?: boolean
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
/**
|
package/src/linkedFrom.test.tsx
CHANGED
|
@@ -109,11 +109,35 @@ describe('a card built from interop’s projection', () => {
|
|
|
109
109
|
expect(rows).toEqual(['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6', 'Item 7'])
|
|
110
110
|
})
|
|
111
111
|
|
|
112
|
-
it('counts every item in its ring, listed or not, a dropped one in the total and not as done', () => {
|
|
112
|
+
it('counts every item in its ring, listed or not, a dropped one in the total and not as done, from an interop that does not count', () => {
|
|
113
113
|
render(<LinkCard link={linkStateFrom(GROUP, UNREAD, options())} />)
|
|
114
114
|
expect(screen.getByText('3/9')).toBeTruthy()
|
|
115
115
|
})
|
|
116
116
|
|
|
117
|
+
it('draws the progress interop counts, the one every app draws: a dropped item out of both numbers', () => {
|
|
118
|
+
render(<LinkCard link={linkStateFrom({ ...GROUP, progress: { done: 3, total: 8 } }, UNREAD, options())} />)
|
|
119
|
+
expect(screen.getByText('3/8')).toBeTruthy()
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it('shows a status no listing names as the current value, by its id, greyed and not pickable, above the rest', async () => {
|
|
123
|
+
const user = userEvent.setup()
|
|
124
|
+
const onAct = vi.fn()
|
|
125
|
+
const blocked = { ...GROUP, actions: [{ ...GROUP.actions[0], current: 'blocked' }, GROUP.actions[1]] }
|
|
126
|
+
render(<LinkCard link={linkStateFrom(blocked, UNREAD, options({ onAct }))} />)
|
|
127
|
+
const status = screen.getByRole('combobox', { name: 'Status' })
|
|
128
|
+
expect(status.textContent).toContain('blocked')
|
|
129
|
+
await user.click(status)
|
|
130
|
+
const listed = await screen.findAllByRole('option')
|
|
131
|
+
// The first is the current value, so it carries the chosen row's ✓.
|
|
132
|
+
expect(listed[0].textContent).toMatch(/^blocked/)
|
|
133
|
+
expect(listed.slice(1).map((option) => option.textContent)).toEqual(['Todo', 'Doing', 'Done', 'Dropped'])
|
|
134
|
+
expect(listed[0].getAttribute('aria-disabled')).toBe('true')
|
|
135
|
+
await user.click(listed[0])
|
|
136
|
+
expect(onAct).not.toHaveBeenCalled()
|
|
137
|
+
await user.click(screen.getByRole('option', { name: /Doing/ }))
|
|
138
|
+
expect(onAct).toHaveBeenCalledWith('set-status', 'doing')
|
|
139
|
+
})
|
|
140
|
+
|
|
117
141
|
it('shows its key before its title, in the card and in the chip', () => {
|
|
118
142
|
render(<LinkCard link={linkStateFrom(GROUP, UNREAD, options())} />)
|
|
119
143
|
expect(screen.getByText('ABC')).toBeTruthy()
|
package/src/linkedFrom.ts
CHANGED
|
@@ -59,6 +59,8 @@ export interface LinkedSource {
|
|
|
59
59
|
archived?: unknown
|
|
60
60
|
/** When it last changed, in seconds (interop 0.64). */
|
|
61
61
|
changedAt?: number
|
|
62
|
+
/** How far along it is, as interop counts it for every app (interop 0.102): done over every child not dropped. */
|
|
63
|
+
progress?: { done: number; total: number }
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
/** `T` is the app's own object type (interop's `ForeignObject`), so `hrefOf` takes it as it is. */
|
|
@@ -186,11 +188,13 @@ function childrenOf<T extends LinkedSource>(object: T, options: LinkedFromOption
|
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
/**
|
|
189
|
-
* How far along it is, when every item has a status:
|
|
190
|
-
*
|
|
191
|
-
*
|
|
191
|
+
* How far along it is, when every item has a status: interop's count, the one
|
|
192
|
+
* every app draws — done over every item not cancelled, so a finished project
|
|
193
|
+
* reads full (Miky, 17 Nov; interop 0.102's `progress`). From an older interop,
|
|
194
|
+
* the green ones over all of them, as before.
|
|
192
195
|
*/
|
|
193
196
|
function doneOf(object: LinkedSource): { done: number; total: number } | undefined {
|
|
197
|
+
if (object.progress) return object.progress
|
|
194
198
|
const children = object.children
|
|
195
199
|
if (!children?.length || children.some((child) => !child.slots.status)) return undefined
|
|
196
200
|
return { done: children.filter((child) => child.slots.status?.colour === 'green').length, total: children.length }
|
|
@@ -200,9 +204,16 @@ function statusOf(object: LinkedSource, onAct: LinkedFromOptions['onAct']): Link
|
|
|
200
204
|
const { slots } = object
|
|
201
205
|
const action = object.actions.find((one) => one.control === 'select' && one.field && one.field === slots.status?.field)
|
|
202
206
|
if (action) {
|
|
207
|
+
const offered = (action.options ?? []).map((option) => ({ value: option.value, label: option.label, colour: colourOf(option.colour) }))
|
|
208
|
+
// A status no listing names (a company's own, another app's) is the current value all the same: shown by its id,
|
|
209
|
+
// greyed and not offered, above the statuses on offer (Miky, 30 Oct), in the neutral grey (Katerina, 30 Oct).
|
|
210
|
+
const unlisted =
|
|
211
|
+
action.current && !offered.some((option) => option.value === action.current)
|
|
212
|
+
? [{ value: action.current, label: action.current, colour: 'neutral' as const, disabled: true }]
|
|
213
|
+
: []
|
|
203
214
|
return {
|
|
204
215
|
value: action.current,
|
|
205
|
-
options:
|
|
216
|
+
options: [...unlisted, ...offered],
|
|
206
217
|
...(onAct ? { onChange: (value: string) => onAct(action.id, value) } : {}),
|
|
207
218
|
}
|
|
208
219
|
}
|
|
@@ -48,20 +48,20 @@ describe('the registry builds', () => {
|
|
|
48
48
|
expect(registry.entries.map((one) => one.name).sort()).toEqual(values.map((one) => one.name).sort())
|
|
49
49
|
})
|
|
50
50
|
|
|
51
|
-
it('counts
|
|
51
|
+
it('counts 257 names over 131 files: 170 components, 79 helpers and 8 hooks (reportCrashesTo, where every ErrorBoundary sends the crash it caught (PROD-2), on 18 November; ListTable and ListTableRow, a list of things on a page under column headings, and ActivityLine, one thing that happened in a list of what is new, from the navigation prototype, on 16 November; useShortcut, a key that works from anywhere on the page, for Peek’s Ctrl/Cmd+O to Add to Open work (TOPI-7), on 10 November; CornerMenu, the "…" over a row’s or a card’s corner with Show as and Remove (TOPI-5), on 10 November; ConversationHeading, which place a comment is on in a list mixing several places (TOPI-2), on 9 November; FollowSwitch, LevelIcon and WhoFollowsDialog, how you follow a place and who follows it (TEA-6), on 6 November; goneWords and GONE_CLOSED, what stands in a gone comment’s place and under its thread in every app (ONE-9), on 6 November; DeletedNotice and NoAccessNotice, the cards on a deleted file and on one you cannot open (ALO-4), on 3 November; useFormBusy, whether a Form around it is sending, read by the editor’s DocumentField from the main entry, in the review of 2 November; useLeftAt, sendsInLayout, useSeenOnScreen, showInConversation and showInConversationWhenDrawn, where a conversation scrolls, what was seen and a link landing on a comment, moved from Peek for every app, on 2 November; useRememberedOpen, the fold a section remembers, read by the app, and NAV_TREE_PENDING_MS and isPlainClick, Peek’s Folder timer and plain-click check, moved in, on 2 November; FormDialog, MoveDialog and ArchiveDialog, the dialogs Peek wired by hand, on 2 November; ConversationPlace, the line saying where a comment was said, and DocumentField, a rich-text field of a form, moved from Peek, on 2 November; ArchivedNotice, the card on an archived file, from Peek, Ship and Leaf, on 31 October; caretOnOpen, the box at a thread’s foot taking the caret when a ConversationLayout opens it, without scrolling, on 31 October; the conversation from Peek for every app, with PageHeader and PinnedComment, on 31 October, and ResolutionNote and ResolutionHistory gone with the resolved looks not picked, on 1 November; useSidebarFold, a folded sidebar kept folded in every app, on 31 October; cardShapeMemory, a card’s last shape on this device, lifted from Peek and Ship for Leaf, and ReferenceCards and useReferenceCards gone with their deprecated page, in the widget review, on 30 October; inTheBox, a card or part in a box being written in, on the files’ fill and in words, on 29 October; archivedLine, the line on an archived file in every app (PEEKM-2), on 23 October; keepCommentBoxWarm, a box built ahead, exported as 0.84.0 promised (PEEKM-1), on 21 October;linkedFrom and linkStateFrom, one card for a file in every app (5ebf2756), on 21 October; ComposeBox, ComposeKeys and COMPOSE_EDITOR_CLASSES gone into CommentBox’s own frame (one box), on 21 October; LinkPlaces with linkPlaceAt and staysChip, a link in a document drawn where it sits (WBD-4), on 20 October; DocumentEditor, one document editor for every app, and PersonReference, `@` in a document (WBD-3), on 20 October; toggleTableHeaderRow, a table’s header row on and off (LEAF-12), on 19 October;EntryShell, the screen while nobody is signed in, moved from Peek (AUT-3), on 17 October; CommentBox with commentBoxRows, and ReactionRow with AddReactionButton and whoReacted, the shared comment box and reaction row (COMM-2), on 17 October; the link widgets — LinkChip, LinkRow, LinkCard, CardUnder, PartCard, LinkPreview and their parts, with useCanHover, chosenOf, loadingShapeOf and unavailableMemory — from the Widgets 2 prototype, on 16 October; InlineText, a title or the line under it edited where it stands (SUM-4), on 16 October; ComposeBox with ComposeKeys and its classes, CommentHighlights with its five helpers, and keepSelection and releaseSelection, from the Leaf prototype (LEAF-4), on 16 October;NavTree, NavTreeSection, the composer triggers and UnreadDot joined on 2 October; BlockHandle and EditorBlockHandle (RIC-18) on 2 October, moveBlock and blockDropCursor, the drop in the gutter, on 5 October, MembersPill and MembersDialog, moved from Peek (SHI-31), on 6 October, ShowMore on 7 October, AppProvider on 8 October, and KindIcon, thingKindOf and PastedImages with its two helpers, moved from Peek, on 8 October; CodeBlockColours, the coloured code block of the editor, on 9 October; Checklist, Callout, isChecklistTick and calloutLook (RIC-19) on 13 October; EditorTableControls and its four actions (RIC-21) on 13 October; ReferenceCards, useReferenceCards and its three helpers, the card a chip in a document asks for, on 14 October; LinkChips and its two helpers, a URL in a document read as its chip, on 14 October; ReferenceMenu, ReferenceMenuView and three helpers, the menu of a chip while writing, on 14 October; PastedMarkdown, markdown pasted as the blocks it spells (LEAF-10), on 15 October; turnIntoRows, turnListInto and turnQuoteInto, the block menu’s Turn into for a list and a quote (LEAF-11), on 15 October)', () => {
|
|
52
52
|
// The reconciliation GATES.md §24 explains. If this changes, that changes.
|
|
53
53
|
// The `EDITOR_EXTENSIONS` count as components by their names; they are
|
|
54
54
|
// editor extensions, documented on SelectionToolbar's, BlockNodes' and
|
|
55
55
|
// ComposerTriggers' pages.
|
|
56
56
|
const kinds = registry.entries.reduce<Record<string, number>>((all, one) => ({ ...all, [one.kind]: (all[one.kind] ?? 0) + 1 }), {})
|
|
57
|
-
expect(kinds).toEqual({ component: 170, helper:
|
|
57
|
+
expect(kinds).toEqual({ component: 170, helper: 79, hook: 8 })
|
|
58
58
|
expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(131)
|
|
59
59
|
})
|
|
60
60
|
|
|
61
61
|
it('gives every entry a purpose, from its own page or from the comment above it', () => {
|
|
62
62
|
expect(registry.entries.filter((one) => one.purpose.trim() === '')).toEqual([])
|
|
63
63
|
expect(registry.entries.filter((one) => one.purposeFrom === 'page').length).toBe(118)
|
|
64
|
-
expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(
|
|
64
|
+
expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(139)
|
|
65
65
|
})
|
|
66
66
|
|
|
67
67
|
it('takes a name with a page of its own from the page, and a name without one from the code', () => {
|