@hanzo/app 0.3.94 → 0.3.95
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/Account.d.ts +9 -3
- package/dist/Account.js +142 -141
- package/dist/App.js +71 -37
- package/dist/Bar.js +1 -1
- package/dist/Betas.d.ts +1 -1
- package/dist/Betas.js +16 -22
- package/dist/Board.js +113 -47
- package/dist/CalScheduler.d.ts +1 -0
- package/dist/CalScheduler.js +223 -57
- package/dist/Chat.js +432 -153
- package/dist/Contacts.js +35 -31
- package/dist/ContextMenu.js +126 -42
- package/dist/Directory.js +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/Drive.js +351 -119
- package/dist/Gate.js +156 -13
- package/dist/Home.js +31 -53
- package/dist/Inbox.js +29 -15
- package/dist/InlineRename.d.ts +6 -0
- package/dist/InlineRename.js +41 -0
- package/dist/Learning.js +132 -13
- package/dist/Market.js +13 -9
- package/dist/Meet.d.ts +5 -0
- package/dist/Meet.js +75 -51
- package/dist/MoreMenu.d.ts +19 -0
- package/dist/MoreMenu.js +33 -0
- package/dist/NeedMoreUsage.js +2 -2
- package/dist/OrgSwitcher.js +6 -2
- package/dist/Rail.d.ts +73 -7
- package/dist/Rail.js +372 -111
- package/dist/Recents.js +77 -24
- package/dist/RightPane.js +2 -2
- package/dist/Search.d.ts +13 -1
- package/dist/Search.js +366 -50
- package/dist/Setup.js +34 -5
- package/dist/Shared.js +12 -12
- package/dist/Shell.js +210 -151
- package/dist/Sidebar.d.ts +14 -3
- package/dist/Sidebar.js +411 -129
- package/dist/SkipLink.d.ts +8 -0
- package/dist/SkipLink.js +11 -0
- package/dist/Start.js +51 -52
- package/dist/Terminals.js +159 -11
- package/dist/ToBottom.js +1 -1
- package/dist/Upgrade.d.ts +8 -3
- package/dist/Upgrade.js +194 -103
- package/dist/Usage.d.ts +1 -1
- package/dist/Usage.js +186 -82
- package/dist/WalletPill.js +8 -2
- package/dist/Work.js +162 -53
- package/dist/archive.d.ts +8 -0
- package/dist/archive.js +16 -0
- package/dist/bots/Bots.js +1 -1
- package/dist/bots/ComputerDialog.js +53 -26
- package/dist/bots/ConnectorsDialog.js +34 -15
- package/dist/bots/Make.js +5 -1
- package/dist/bots/Panel.js +37 -31
- package/dist/bots/Roster.js +18 -13
- package/dist/bots/Thread.js +54 -27
- package/dist/bots/face.js +6 -2
- package/dist/bots/kit.d.ts +1 -0
- package/dist/bots/kit.js +1 -1
- package/dist/chord.d.ts +13 -0
- package/dist/chord.js +30 -1
- package/dist/crew.js +47 -4
- package/dist/ground.d.ts +1 -1
- package/dist/ground.js +1 -1
- package/dist/help.d.ts +7 -3
- package/dist/help.js +19 -14
- package/dist/keys.d.ts +28 -0
- package/dist/keys.js +58 -0
- package/dist/lib/arrival.d.ts +5 -0
- package/dist/lib/arrival.js +10 -0
- package/dist/lib/betas.d.ts +2 -0
- package/dist/lib/betas.js +10 -0
- package/dist/lib/branch.d.ts +11 -0
- package/dist/lib/branch.js +11 -0
- package/dist/lib/chatPreferences.d.ts +1 -1
- package/dist/lib/chatPreferences.js +1 -1
- package/dist/lib/dev-mode.d.ts +18 -0
- package/dist/lib/dev-mode.js +102 -0
- package/dist/lib/info-hint.d.ts +7 -0
- package/dist/lib/info-hint.js +8 -0
- package/dist/lib/model-picker.d.ts +2 -0
- package/dist/lib/model-picker.js +12 -0
- package/dist/lib/owners.d.ts +5 -0
- package/dist/lib/owners.js +15 -0
- package/dist/lib/pay.d.ts +2 -0
- package/dist/lib/pay.js +4 -0
- package/dist/lib/todo.d.ts +6 -0
- package/dist/lib/todo.js +37 -25
- package/dist/look.js +39 -8
- package/dist/rail-open.d.ts +9 -0
- package/dist/rail-open.js +34 -0
- package/dist/renaming.d.ts +10 -0
- package/dist/renaming.js +25 -0
- package/dist/thread.d.ts +2 -1
- package/dist/thread.js +85 -44
- package/package.json +11 -11
package/dist/Board.js
CHANGED
|
@@ -29,18 +29,19 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
29
29
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
30
30
|
import { phrase } from '@hanzo/i18n';
|
|
31
31
|
import { useAgents, usePeople } from '@hanzo/ai/react';
|
|
32
|
-
import { Box, Text, View, XStack, YStack } from '@hanzo/ui';
|
|
32
|
+
import { Box, Button, DropdownMenu, Skeleton, Text, toast, View, XStack, YStack } from '@hanzo/ui';
|
|
33
33
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@hanzo/ui';
|
|
34
34
|
import { useIam, useOrganizations } from '@hanzo/iam/react';
|
|
35
|
-
import { Calendar, CalendarClock, Check, ChevronLeft, ChevronRight, Columns3, ListChecks, ListFilter, SquareTerminal, Plus, Tag, UserPlus, X, } from 'lucide-react';
|
|
35
|
+
import { ArrowRightLeft, Calendar, CalendarClock, Check, ChevronLeft, ChevronRight, Columns3, ListChecks, ListFilter, MoreHorizontal, SquareTerminal, Plus, Tag, UserPlus, X, } from 'lucide-react';
|
|
36
36
|
import { useOpen } from './open.js';
|
|
37
37
|
import { useI18n } from '@hanzo/i18n/react';
|
|
38
38
|
import { useAi } from './lib/ai.js';
|
|
39
39
|
import { Face } from './cast.js';
|
|
40
40
|
import { say } from './failure.js';
|
|
41
41
|
import { AGENT_QUEUE, AGENT_WORKFLOW, reads, runOf, start as startRun, } from './lib/durable.js';
|
|
42
|
-
import { COLUMNS, PRIORITIES, addStep, board as readBoard, claim, edit, open as openCard, projects as readProjects, sift, steps, tick, } from './lib/todo.js';
|
|
42
|
+
import { COLUMNS, PRIORITIES, addStep, board as readBoard, claim, edit, open as openCard, projects as readProjects, targetOf, sift, steps, tick, } from './lib/todo.js';
|
|
43
43
|
import { BAD } from './lib/mix.js';
|
|
44
|
+
import { useDevMode } from './lib/dev-mode.js';
|
|
44
45
|
const DAY = 86400;
|
|
45
46
|
/** Said when a write has no board to write to. It is the same event whichever
|
|
46
47
|
* write asked, so it is one sentence rather than two wordings of one. */
|
|
@@ -112,7 +113,7 @@ function Empty({ children }) {
|
|
|
112
113
|
}
|
|
113
114
|
/** A quiet control that says its verb. */
|
|
114
115
|
function Act({ icon: Icon, label, on, onPress, }) {
|
|
115
|
-
return (_jsx(Box, { render: "button", onClick: onPress, "aria-pressed": on, px: "$2.5", py: "$1.5", rounded: "$2", bg: on ? '$raised' : 'transparent', borderWidth: 1, borderColor: on ? '
|
|
116
|
+
return (_jsx(Box, { render: "button", onClick: onPress, "aria-pressed": on, px: "$2.5", py: "$1.5", rounded: "$2", bg: on ? '$raised' : 'transparent', borderWidth: 1, borderColor: on ? 'var(--border-strong)' : 'transparent', hoverStyle: { bg: '$hover' }, cursor: "pointer", $touchable: { minH: 44 }, children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [Icon ? _jsx(Icon, { size: 13, "aria-hidden": true }) : null, _jsx(Text, { fontSize: "$1", color: "$ink", children: label })] }) }));
|
|
116
117
|
}
|
|
117
118
|
/** A label: a neutral badge, so a board reads by its words, not a hue per name. */
|
|
118
119
|
function Label({ name }) {
|
|
@@ -168,12 +169,26 @@ const asInput = (unix) => unix ? new Date(unix * 1000).toISOString().slice(0, 10
|
|
|
168
169
|
* costs the one read that drew it. The checklist count is the description's own
|
|
169
170
|
* task items — the same ones the forge renders.
|
|
170
171
|
*/
|
|
171
|
-
function Tile({ card, who, onOpen, }) {
|
|
172
|
+
function Tile({ card, who, onOpen, onMove, }) {
|
|
172
173
|
const { t, locale } = useI18n();
|
|
173
174
|
const list = steps(card.description);
|
|
174
175
|
const done = list.filter((s) => s.done).length;
|
|
175
176
|
const late = card.dueAt ? card.dueAt * 1000 < Date.now() : false;
|
|
176
|
-
|
|
177
|
+
const primaryColumns = COLUMNS.filter((c) => c.id !== 'canceled');
|
|
178
|
+
const menuItems = [
|
|
179
|
+
{ type: 'label', key: 'move-label', label: t('Move to…') },
|
|
180
|
+
...primaryColumns.map((col) => ({
|
|
181
|
+
key: `move-${col.id}`,
|
|
182
|
+
label: columnName(col.id, t) ?? col.label,
|
|
183
|
+
icon: _jsx(ArrowRightLeft, { size: 14, "aria-hidden": true }),
|
|
184
|
+
selected: card.status === col.id,
|
|
185
|
+
onSelect: () => {
|
|
186
|
+
if (card.status !== col.id)
|
|
187
|
+
onMove(col.id);
|
|
188
|
+
},
|
|
189
|
+
})),
|
|
190
|
+
];
|
|
191
|
+
return (_jsx(View, { render: _jsx("div", { draggable: true }), onDragStart: (e) => e.dataTransfer.setData('text/plain', `${card.projectKey}#${card.number}`), display: "block", width: "100%", shrink: 0, cursor: "grab", children: _jsx(YStack, { "data-slot": "board-card", width: "100%", rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--surface-card-emphasis)", hoverStyle: { borderColor: '$ink' }, overflow: "hidden", children: _jsxs(XStack, { items: "flex-start", gap: "$1.5", px: "$3", pt: "$2.5", pb: "$2", children: [_jsx(Box, { render: _jsx("button", { type: "button" }), onClick: onOpen, flex: 1, minW: 0, p: 0, borderWidth: 0, bg: "transparent", cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsxs(YStack, { gap: "$2", width: "100%", items: "flex-start", children: [card.labels.length > 0 ? (_jsx(XStack, { gap: "$1", flexWrap: "wrap", children: card.labels.slice(0, 4).map((l) => (_jsx(Label, { name: l }, l))) })) : null, _jsx(Text, { fontSize: "$2", fontWeight: "500", color: "$ink", numberOfLines: 3, text: "left", width: "100%", children: card.title }), _jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", width: "100%", children: [card.dueAt ? (_jsxs(XStack, { items: "center", gap: "$1", children: [_jsx(CalendarClock, { size: 12, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: late ? BAD : '$soft', children: when(card.dueAt, locale) })] })) : null, list.length > 0 ? (_jsxs(XStack, { items: "center", gap: "$1", children: [_jsx(ListChecks, { size: 12, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: done === list.length ? '$ink' : '$soft', children: t('{done}/{total}', { done: done.toLocaleString(locale), total: list.length.toLocaleString(locale) }) })] })) : null, card.priority && card.priority !== 'none' ? (_jsx(XStack, { items: "center", gap: "$1", px: "$1.5", py: 1, rounded: "$2", bg: card.priority === 'urgent' ? 'var(--state-error)' : card.priority === 'high' ? '$raised' : 'transparent', borderWidth: card.priority === 'urgent' || card.priority === 'high' ? 1 : 0, borderColor: card.priority === 'urgent' ? 'var(--state-error)' : 'var(--border-strong)', children: _jsx(Text, { fontSize: "$1", fontWeight: card.priority === 'urgent' || card.priority === 'high' ? '600' : '400', color: card.priority === 'urgent' ? 'var(--background)' : card.priority === 'high' ? '$ink' : '$soft', children: priorityName(card.priority, t) }) })) : null, _jsx(YStack, { flex: 1 }), card.assignee ? (_jsx(Face, { src: who?.avatar, emoji: who?.emoji, name: who?.name ?? card.assignee, size: 20 })) : null] })] }) }), _jsx(DropdownMenu, { placement: "bottom-end", minWidth: 172, items: menuItems, trigger: _jsx(Box, { render: _jsx("button", { type: "button" }), "data-slot": "board-card-menu", "aria-label": t('Move {title}', { title: card.title }), width: 26, height: 26, "$max-sm": { minW: 44, minH: 44, width: 44, height: 44 }, shrink: 0, rounded: "$2", display: "flex", items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(MoreHorizontal, { size: 14, color: "var(--muted-foreground)", "aria-hidden": true }) }) })] }) }) }));
|
|
177
192
|
}
|
|
178
193
|
// ── the card, opened ────────────────────────────────────────────────────────
|
|
179
194
|
/**
|
|
@@ -185,6 +200,7 @@ function Tile({ card, who, onOpen, }) {
|
|
|
185
200
|
*/
|
|
186
201
|
function Detail({ card, people, agents, onClose, onSaved, }) {
|
|
187
202
|
const { t, locale } = useI18n();
|
|
203
|
+
const [devMode] = useDevMode();
|
|
188
204
|
const { client } = useAi();
|
|
189
205
|
const [panel, setPanel] = useState(null);
|
|
190
206
|
const [title, setTitle] = useState(card.title);
|
|
@@ -233,7 +249,7 @@ function Detail({ card, people, agents, onClose, onSaved, }) {
|
|
|
233
249
|
setWrong(null);
|
|
234
250
|
try {
|
|
235
251
|
await edit(client, card.projectKey, card.number, patch);
|
|
236
|
-
onSaved();
|
|
252
|
+
onSaved(patch);
|
|
237
253
|
}
|
|
238
254
|
catch (e) {
|
|
239
255
|
setWrong(e instanceof Error ? e.message : t('The change was refused'));
|
|
@@ -250,22 +266,22 @@ function Detail({ card, people, agents, onClose, onSaved, }) {
|
|
|
250
266
|
setBody(written);
|
|
251
267
|
void save({ description: written });
|
|
252
268
|
};
|
|
253
|
-
return (_jsxs(YStack, { position: "absolute", t: 0, r: 0, b: 0, width: 560, maxW: "100%", bg: "$panel", borderLeftWidth: 1, borderColor: "$borderColor", z: "var(--z-sheet)", children: [_jsxs(XStack, { items: "center", gap: "$2", px: "$4", py: "$3", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$1", color: "$soft", flex: 1, numberOfLines: 1, children: card.identifier }), _jsx(Box, { render: "button", onClick: onClose, p: "$1", rounded: "$2", "aria-label": t('Close'), children: _jsx(X, { size: 16, "aria-hidden": true }) })] }), _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", p: "$4", gap: "$4", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Box, { render: "button", onClick: () => void save({ status: finished ? 'todo' : 'done' }), "aria-label": t(finished ? 'Reopen this card' : 'Mark this card done'), "aria-pressed": finished, width: 22, height: 22, shrink: 0, rounded: 9999, borderWidth: finished ? 0 : 1.5, borderColor: "$soft", bg: finished ? '$ink' : 'transparent', items: "center", justify: "center", hoverStyle: { borderColor: '$ink' }, children: finished ? _jsx(Check, { size: 13, color: "var(--background)", "aria-hidden": true }) : null }), _jsx(Text, { render: _jsx("input", { value: title, onChange: (e) => setTitle(e.target.value), onBlur: () => title.trim() && title !== card.title && void save({ title: title.trim() }), "aria-label": t('Card title') }), flex: 1, minW: 0, bg: "transparent", borderWidth:
|
|
269
|
+
return (_jsxs(YStack, { position: "absolute", t: 0, r: 0, b: 0, width: 560, maxW: "100%", bg: "$panel", borderLeftWidth: 1, borderColor: "$borderColor", z: "var(--z-sheet)", children: [_jsxs(XStack, { items: "center", gap: "$2", px: "$4", py: "$3", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$1", color: "$soft", flex: 1, numberOfLines: 1, children: card.identifier }), _jsx(Box, { render: _jsx("button", { type: "button" }), onClick: onClose, p: "$1.5", "$max-sm": { minW: 44, minH: 44 }, rounded: "$2", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "aria-label": t('Close'), children: _jsx(X, { size: 16, "aria-hidden": true }) })] }), _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", p: "$4", gap: "$4", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Box, { render: "button", onClick: () => void save({ status: finished ? 'todo' : 'done' }), "aria-label": t(finished ? 'Reopen this card' : 'Mark this card done'), "aria-pressed": finished, width: 22, height: 22, shrink: 0, rounded: 9999, borderWidth: finished ? 0 : 1.5, borderColor: "$soft", bg: finished ? '$ink' : 'transparent', items: "center", justify: "center", hoverStyle: { borderColor: '$ink' }, children: finished ? _jsx(Check, { size: 13, color: "var(--background)", "aria-hidden": true }) : null }), _jsx(Text, { render: _jsx("input", { value: title, onChange: (e) => setTitle(e.target.value), onBlur: () => title.trim() && title !== card.title && void save({ title: title.trim() }), "aria-label": t('Card title') }), flex: 1, minW: 0, bg: "transparent", borderWidth: 1, borderColor: "transparent", rounded: 6, px: 4, outlineStyle: "none", focusStyle: { borderColor: 'var(--ring)' }, color: "inherit", fontSize: "$7", fontWeight: "600", textDecorationLine: finished ? 'line-through' : 'none' })] }), _jsxs(XStack, { gap: "$1.5", flexWrap: "wrap", children: [_jsx(Act, { icon: Tag, label: t('Labels'), on: panel === 'labels', onPress: () => setPanel(panel === 'labels' ? null : 'labels') }), _jsx(Act, { icon: Calendar, label: t('Dates'), on: panel === 'dates', onPress: () => setPanel(panel === 'dates' ? null : 'dates') }), _jsx(Act, { icon: UserPlus, label: t('Members'), on: panel === 'members', onPress: () => setPanel(panel === 'members' ? null : 'members') })] }), panel === 'labels' ? (_jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Labels') }), card.labels.length > 0 ? (_jsx(XStack, { gap: "$1", flexWrap: "wrap", children: card.labels.map((l) => (_jsx(Label, { name: l }, l))) })) : (_jsx(Text, { fontSize: "$1", color: "$soft", children: t('None yet.') })), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Labels sync with your project issues and keep the same color everywhere.') })] })) : null, panel === 'dates' ? (_jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Dates') }), _jsxs(XStack, { gap: "$3", flexWrap: "wrap", children: [_jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Start') }), _jsx(Text, { render: _jsx("input", { type: "date", value: asInput(card.startAt), readOnly: true }), ...DATE })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Due') }), _jsx(Text, { render: _jsx("input", { type: "date", value: asInput(card.dueAt), readOnly: true }), ...DATE })] })] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t("Dates sync from this card's project milestone.") })] })) : null, panel === 'members' ? (_jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Members') }), people.length === 0 ? (_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Nobody to assign yet.') })) : (people.map((p) => (_jsx(Box, { render: "button", onClick: () => void save({ assignee: card.assignee === p.name ? '' : p.name }), width: "100%", p: "$2", rounded: "$2", hoverStyle: { bg: '$hover' }, children: _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Face, { src: p.avatar, emoji: p.emoji, name: p.label, size: 22 }), _jsx(Text, { fontSize: "$2", color: "$ink", flex: 1, numberOfLines: 1, children: p.label }), p.agent ? (_jsx(Text, { fontSize: "$1", color: "$soft", children: t('agent') })) : null, card.assignee === p.name ? _jsx(Check, { size: 14, "aria-hidden": true }) : null] }) }, p.id)))), _jsx(Box, { render: "button", onClick: () => {
|
|
254
270
|
if (!client || busy)
|
|
255
271
|
return;
|
|
256
272
|
setBusy(true);
|
|
257
273
|
void claim(client, card.projectKey, card.number)
|
|
258
|
-
.then(onSaved)
|
|
274
|
+
.then(() => onSaved())
|
|
259
275
|
.catch((e) => setWrong(e.message))
|
|
260
276
|
.finally(() => setBusy(false));
|
|
261
|
-
}, p: "$2", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, children: _jsx(Text, { fontSize: "$1", color: "$ink", children: t('Take it myself') }) })] })) : null, _jsxs(YStack, { gap: "$2", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Description') }), _jsx(Text, { render: _jsx("textarea", { value: body, onChange: (e) => setBody(e.target.value), onBlur: () => body !== (card.description ?? '') && void save({ description: body }), placeholder: t('What is this card about?'), rows: 5 }), width: "100%", bg: "transparent", borderWidth: 1, borderColor: "var(--border)", rounded: 8, p: 10, outlineStyle: "none", color: "inherit", fontSize: "$2" })] }), _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", flex: 1, children: t('Checklist') }), list.length > 0 ? (_jsx(Text, { fontSize: "$1", color: "$soft", children: t('{percent}%', { percent: pct.toLocaleString(locale) }) })) : null] }), list.length > 0 ? (_jsx(YStack, { height: 4, rounded: 9999, bg: "$hover", overflow: "hidden", children: _jsx(YStack, { width: `${pct}%`, height: 4, bg: "$ink" }) })) : null, list.map((s) => (_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx("input", { type: "checkbox", checked: s.done, onChange: (e) => flip(s.line, e.target.checked), "aria-label": s.text }), _jsx(Text, { fontSize: "$2", color: s.done ? '$soft' : '$ink', textDecorationLine: s.done ? 'line-through' : 'none', flex: 1, children: s.text })] }, s.line))), _jsx(XStack, { gap: "$2", children: _jsx(Text, { render: _jsx("input", { value: step, onChange: (e) => setStep(e.target.value), onKeyDown: (e) => {
|
|
277
|
+
}, p: "$2", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, children: _jsx(Text, { fontSize: "$1", color: "$ink", children: t('Take it myself') }) })] })) : null, _jsxs(YStack, { gap: "$2", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Description') }), _jsx(Text, { render: _jsx("textarea", { value: body, onChange: (e) => setBody(e.target.value), onBlur: () => body !== (card.description ?? '') && void save({ description: body }), placeholder: t('What is this card about?'), rows: 5 }), width: "100%", bg: "transparent", borderWidth: 1, borderColor: "var(--border)", rounded: 8, p: 10, outlineStyle: "none", focusStyle: { borderColor: 'var(--ring)' }, color: "inherit", fontSize: "$2" })] }), _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", flex: 1, children: t('Checklist') }), list.length > 0 ? (_jsx(Text, { fontSize: "$1", color: "$soft", children: t('{percent}%', { percent: pct.toLocaleString(locale) }) })) : null] }), list.length > 0 ? (_jsx(YStack, { height: 4, rounded: 9999, bg: "$hover", overflow: "hidden", children: _jsx(YStack, { width: `${pct}%`, height: 4, bg: "$ink" }) })) : null, list.map((s) => (_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx("input", { type: "checkbox", checked: s.done, onChange: (e) => flip(s.line, e.target.checked), "aria-label": s.text }), _jsx(Text, { fontSize: "$2", color: s.done ? '$soft' : '$ink', textDecorationLine: s.done ? 'line-through' : 'none', flex: 1, children: s.text })] }, s.line))), _jsx(XStack, { gap: "$2", children: _jsx(Text, { render: _jsx("input", { value: step, onChange: (e) => setStep(e.target.value), onKeyDown: (e) => {
|
|
262
278
|
if (e.key !== 'Enter' || !step.trim())
|
|
263
279
|
return;
|
|
264
280
|
const written = addStep(body, step);
|
|
265
281
|
setBody(written);
|
|
266
282
|
setStep('');
|
|
267
283
|
void save({ description: written });
|
|
268
|
-
}, placeholder: t('Add an item') }), flex: 1, bg: "transparent", borderWidth: 1, borderColor: "var(--border)", rounded: 6, px: 8, py: 6, outlineStyle: "none", color: "inherit", fontSize: "$2" }) })] }), _jsxs(XStack, { gap: "$3", flexWrap: "wrap", children: [_jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Column') }), _jsxs(Select, { value: card.status, onValueChange: (v) => void save({ status: v }), children: [_jsx(SelectTrigger, { "aria-label": t('Column'), width: 160, children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: COLUMNS.map((c) => (_jsx(SelectItem, { value: c.id, children: columnName(c.id, t) ?? c.label }, c.id))) })] })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Priority') }), _jsxs(Select, { value: card.priority || 'none', onValueChange: (v) => void save({ priority: v }), children: [_jsx(SelectTrigger, { "aria-label": t('Priority'), width: 160, children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: PRIORITIES.map((p) => (_jsx(SelectItem, { value: p, children: priorityName(p, t) }, p))) })] })] })] }), _jsxs(YStack, { gap: "$2", pt: "$2", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Durable run') }), run ? (_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Text, { fontSize: "$2", color: "$ink", children: runStatus(run.status, t) }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: run.workflowId }), run.historyLength ? (_jsx(Text, { fontSize: "$1", color: "$soft", children: t('{count} events', { count: run.historyLength.toLocaleString(locale) }) })) : null] })) : (_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Text, { fontSize: "$1", color: "$soft", flex: 1, children: card.assignee
|
|
284
|
+
}, placeholder: t('Add an item') }), flex: 1, bg: "transparent", borderWidth: 1, borderColor: "var(--border)", rounded: 6, px: 8, py: 6, outlineStyle: "none", focusStyle: { borderColor: 'var(--ring)' }, color: "inherit", fontSize: "$2" }) })] }), _jsxs(XStack, { gap: "$3", flexWrap: "wrap", children: [_jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Column') }), _jsxs(Select, { value: card.status, onValueChange: (v) => void save({ status: v }), children: [_jsx(SelectTrigger, { "aria-label": t('Column'), width: 160, children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: COLUMNS.map((c) => (_jsx(SelectItem, { value: c.id, children: columnName(c.id, t) ?? c.label }, c.id))) })] })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Priority') }), _jsxs(Select, { value: card.priority || 'none', onValueChange: (v) => void save({ priority: v }), children: [_jsx(SelectTrigger, { "aria-label": t('Priority'), width: 160, children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: PRIORITIES.map((p) => (_jsx(SelectItem, { value: p, children: priorityName(p, t) }, p))) })] })] })] }), _jsxs(YStack, { gap: "$2", pt: "$2", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Durable run') }), run ? (_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Text, { fontSize: "$2", color: "$ink", children: runStatus(run.status, t) }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: run.workflowId }), run.historyLength ? (_jsx(Text, { fontSize: "$1", color: "$soft", children: t('{count} events', { count: run.historyLength.toLocaleString(locale) }) })) : null] })) : (_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Text, { fontSize: "$1", color: "$soft", flex: 1, children: card.assignee
|
|
269
285
|
? t('{name} holds this. Hand the work to the engine and it survives a crash.', { name: card.assignee })
|
|
270
286
|
: t('Nobody holds this yet — it can still be run, and the run is durable either way.') }), _jsx(Box, { render: "button", onClick: () => {
|
|
271
287
|
if (!client || starting)
|
|
@@ -317,12 +333,29 @@ function Planner({ cards, onOpen }) {
|
|
|
317
333
|
return (_jsxs(YStack, { flex: 1, minW: 0, minH: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$3", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsx(Calendar, { size: 14, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", flex: 1, children: day.toLocaleDateString(locale, { month: 'long' }) }), _jsx(Box, { render: "button", onClick: () => setOffset((n) => n - 1), p: "$1", rounded: "$2", "aria-label": t('Previous day'), children: _jsx(ChevronLeft, { size: 14, "aria-hidden": true }) }), _jsx(Box, { render: "button", onClick: () => setOffset(0), px: "$2", py: "$1", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", children: _jsx(Text, { fontSize: "$1", color: "$ink", children: t('Today') }) }), _jsx(Box, { render: "button", onClick: () => setOffset((n) => n + 1), p: "$1", rounded: "$2", "aria-label": t('Next day'), children: _jsx(ChevronRight, { size: 14, "aria-hidden": true }) })] }), _jsxs(YStack, { items: "center", py: "$2", gap: "$1", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: dayName(day, t, locale) }), _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: day.getDate().toLocaleString(locale) })] }), _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: [due.length > 0 ? (_jsxs(YStack, { p: "$3", gap: "$2", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Due today') }), due.map((c) => (_jsx(Box, { render: "button", onClick: () => onOpen(c), width: "100%", p: "$2.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$raised", hoverStyle: { borderColor: '$ink' }, children: _jsx(Text, { fontSize: "$2", color: "$ink", numberOfLines: 2, text: "left", children: c.title }) }, c.id)))] })) : null, Array.from({ length: 12 }, (_, i) => i + 8).map((hour) => (_jsx(XStack, { height: 56, borderTopWidth: 1, borderColor: "$borderColor", children: _jsx(YStack, { width: 54, pt: "$1", pl: "$3", children: _jsx(Text, { fontSize: "$1", color: "$soft", children: hourLabel(hour, t, locale) }) }) }, hour)))] })] }));
|
|
318
334
|
}
|
|
319
335
|
// ── the board ───────────────────────────────────────────────────────────────
|
|
320
|
-
function Column({ column, cards, people, onDrop, onOpen, onAdd, loading, }) {
|
|
336
|
+
function Column({ column, cards, people, onDrop, onMoveCard, onOpen, onAdd, loading, }) {
|
|
321
337
|
const { t, locale } = useI18n();
|
|
322
338
|
const [over, setOver] = useState(false);
|
|
323
339
|
const [adding, setAdding] = useState(false);
|
|
340
|
+
const [submitting, setSubmitting] = useState(false);
|
|
324
341
|
const [title, setTitle] = useState('');
|
|
325
|
-
|
|
342
|
+
const submitNewCard = () => {
|
|
343
|
+
const said = title.trim();
|
|
344
|
+
if (!said || submitting)
|
|
345
|
+
return;
|
|
346
|
+
setSubmitting(true);
|
|
347
|
+
// THE TEXT SURVIVES A REFUSAL. Clearing before the answer is
|
|
348
|
+
// how a failed save costs somebody the sentence they wrote.
|
|
349
|
+
void onAdd(column.id, said)
|
|
350
|
+
.then((landed) => {
|
|
351
|
+
if (!landed)
|
|
352
|
+
return;
|
|
353
|
+
setTitle('');
|
|
354
|
+
setAdding(false);
|
|
355
|
+
})
|
|
356
|
+
.finally(() => setSubmitting(false));
|
|
357
|
+
};
|
|
358
|
+
return (_jsx(XStack, { flex: 1, flexBasis: 230, minW: 230, height: "100%", maxH: "100%", items: "flex-start", "$max-md": { flex: 0, flexBasis: 272, width: 272, minW: 272, shrink: 0 }, onDragOver: (e) => {
|
|
326
359
|
e.preventDefault();
|
|
327
360
|
setOver(true);
|
|
328
361
|
}, onDragLeave: () => setOver(false), onDrop: (e) => {
|
|
@@ -331,30 +364,23 @@ function Column({ column, cards, people, onDrop, onOpen, onAdd, loading, }) {
|
|
|
331
364
|
const ref = e.dataTransfer.getData('text/plain');
|
|
332
365
|
if (ref)
|
|
333
366
|
onDrop(ref, column.id);
|
|
334
|
-
}, children: _jsxs(YStack, { width:
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
setTitle('');
|
|
338
|
-
}
|
|
339
|
-
if (e.key === 'Enter' && !e.shiftKey) {
|
|
340
|
-
e.preventDefault();
|
|
341
|
-
const said = title.trim();
|
|
342
|
-
if (!said)
|
|
343
|
-
return;
|
|
344
|
-
// THE TEXT SURVIVES A REFUSAL. Clearing before the answer is
|
|
345
|
-
// how a failed save costs somebody the sentence they wrote.
|
|
346
|
-
void onAdd(column.id, said).then((landed) => {
|
|
347
|
-
if (!landed)
|
|
348
|
-
return;
|
|
367
|
+
}, children: _jsxs(YStack, { width: "100%", minH: 0, gap: "$2", p: "$2", rounded: "$3", borderWidth: 1, borderColor: over ? '$ink' : 'var(--border)', bg: "var(--surface-card)", maxH: "100%", children: [_jsxs(XStack, { items: "baseline", gap: "$2", px: "$2", pt: "$1", shrink: 0, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", flex: 1, numberOfLines: 1, children: columnName(column.id, t) ?? column.label }), _jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "$soft", fontVariant: ['tabular-nums'], children: loading ? '' : cards.length.toLocaleString(locale) })] }), _jsx(YStack, { width: "100%", flexBasis: "auto", shrink: 1, minH: 0, gap: "$2", overflowY: "auto", overflowX: "hidden", children: loading ? (_jsx(YStack, { gap: "$2", role: "status", "aria-busy": true, "aria-label": t('Loading cards'), children: [0, 1].map((i) => (_jsxs(YStack, { p: "$3", gap: "$2", rounded: "$3", borderWidth: 1, borderColor: "$edge", bg: "$panel", children: [_jsx(Skeleton, { layout: "block", width: i === 0 ? '42%' : '30%', height: 14, rounded: "$2" }), _jsx(Skeleton, { layout: "block", width: i === 0 ? '88%' : '76%', height: 13, rounded: "$2" }), _jsx(Skeleton, { layout: "block", width: "54%", height: 11, rounded: "$2" })] }, i))) })) : (cards.map((c) => (_jsx(Tile, { card: c, who: people.find((p) => p.name === c.assignee), onOpen: () => onOpen(c), onMove: (nextStatus) => onMoveCard(c, nextStatus) }, c.id)))) }), adding ? (_jsxs(YStack, { gap: "$2", shrink: 0, children: [_jsx(Text, { render: _jsx("textarea", { value: title, autoFocus: true, onChange: (e) => setTitle(e.target.value), onKeyDown: (e) => {
|
|
368
|
+
if (e.key === 'Escape') {
|
|
369
|
+
setAdding(false);
|
|
349
370
|
setTitle('');
|
|
371
|
+
}
|
|
372
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
373
|
+
e.preventDefault();
|
|
374
|
+
submitNewCard();
|
|
375
|
+
}
|
|
376
|
+
}, placeholder: t('What needs doing?'), rows: 2 }), "$platform-web": { resize: 'none' }, width: "100%", bg: "var(--surface-card-emphasis)", borderWidth: 1, borderColor: "var(--border-strong)", rounded: 8, p: 8, outlineStyle: "none", focusStyle: { borderColor: 'var(--ring)' }, color: "inherit", fontSize: "$2" }), _jsxs(XStack, { items: "center", gap: "$1.5", justify: "flex-end", children: [_jsx(Button, { size: "xs", variant: "outline", rounded: "$2", minH: 30, "$max-sm": { minH: 44 }, onClick: () => {
|
|
350
377
|
setAdding(false);
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}, placeholder: t('What needs doing?'), rows: 2 }), "$platform-web": { resize: 'none' }, width: "100%", bg: "var(--surface-card)", borderWidth: 1, borderColor: "var(--border)", rounded: 8, p: 8, outlineStyle: "none", color: "inherit", fontSize: "$2" }) })) : (_jsx(Box, { render: "button", onClick: () => setAdding(true), width: "100%", p: "$2", rounded: "$2",
|
|
378
|
+
setTitle('');
|
|
379
|
+
}, children: t('Cancel') }), _jsx(Button, { size: "xs", variant: "primary", rounded: "$2", minH: 30, "$max-sm": { minH: 44 }, disabled: !title.trim() || submitting, onClick: submitNewCard, children: t('Add') })] })] })) : (_jsx(Box, { render: _jsx("button", { type: "button" }), onClick: () => setAdding(true), width: "100%", p: "$2", "$max-sm": { minH: 44 }, rounded: "$2", shrink: 0, bg: "transparent", borderWidth: 0, cursor: "pointer",
|
|
354
380
|
// THE WHOLE ROW LIGHTS, not the words — it is a full-width target and
|
|
355
381
|
// a fill is what says so. The tint sits above the column's own
|
|
356
382
|
// ground so the row reads as raised rather than merely tinted.
|
|
357
|
-
hoverStyle: { bg: '$raised' }, children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Plus, { size: 13, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Add a card') })] }) }))] }) }));
|
|
383
|
+
hoverStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Plus, { size: 13, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Add a card') })] }) }))] }) }));
|
|
358
384
|
}
|
|
359
385
|
/** One narrowing, as a box a reader ticks. */
|
|
360
386
|
function Tick({ on, label, onPress, }) {
|
|
@@ -396,6 +422,7 @@ function Filter({ want, labels, onWant, onClose, }) {
|
|
|
396
422
|
// ── the app ─────────────────────────────────────────────────────────────────
|
|
397
423
|
function Cards() {
|
|
398
424
|
const { t, locale } = useI18n();
|
|
425
|
+
const [devMode] = useDevMode();
|
|
399
426
|
const { client } = useAi();
|
|
400
427
|
const { user } = useIam();
|
|
401
428
|
const { currentOrgId } = useOrganizations();
|
|
@@ -416,6 +443,7 @@ function Cards() {
|
|
|
416
443
|
const [want, setWant] = useState({});
|
|
417
444
|
const [filtering, setFiltering] = useState(false);
|
|
418
445
|
const [nonce, bump] = useState(0);
|
|
446
|
+
const [overrides, setOverrides] = useState({});
|
|
419
447
|
// WHO CAN HAVE A CARD: the org's people and its agents, in one list, because
|
|
420
448
|
// the store keeps one assignee and does not ask which kind of worker it is.
|
|
421
449
|
const roster = useMemo(() => [
|
|
@@ -446,7 +474,7 @@ function Cards() {
|
|
|
446
474
|
setKey((k) => k || ks[0] || '');
|
|
447
475
|
})
|
|
448
476
|
.catch(() => { });
|
|
449
|
-
void readBoard(client, key ? { key } : {}, stop.signal)
|
|
477
|
+
void readBoard(client, key && key !== 'all' ? { key } : {}, stop.signal)
|
|
450
478
|
.then((rows) => live && (setCards(rows), setRefused(null)))
|
|
451
479
|
.catch((e) => live && (setCards([]), setRefused(say(e, t('this board'), 'read', t))));
|
|
452
480
|
return () => {
|
|
@@ -454,12 +482,17 @@ function Cards() {
|
|
|
454
482
|
stop.abort();
|
|
455
483
|
};
|
|
456
484
|
}, [client, key, nonce, t]);
|
|
485
|
+
const liveCards = useMemo(() => {
|
|
486
|
+
if (!cards)
|
|
487
|
+
return null;
|
|
488
|
+
return cards.map((c) => (overrides[c.id] ? { ...c, ...overrides[c.id] } : c));
|
|
489
|
+
}, [cards, overrides]);
|
|
457
490
|
// THE AGENT NAMES, so "an agent did this" can be answered about a card whose
|
|
458
491
|
// source says `team` but whose holder is a bot — which is what a person filing
|
|
459
492
|
// work and handing it over actually looks like.
|
|
460
493
|
const bots = useMemo(() => new Set(agents.map((a) => a.name)), [agents]);
|
|
461
|
-
const labels = useMemo(() => [...new Set((
|
|
462
|
-
const shown = useMemo(() => sift(
|
|
494
|
+
const labels = useMemo(() => [...new Set((liveCards ?? []).flatMap((c) => c.labels))].sort(), [liveCards]);
|
|
495
|
+
const shown = useMemo(() => sift(liveCards ?? [], want, me, bots), [liveCards, want, me, bots]);
|
|
463
496
|
const narrowed = Object.values(want).some((v) => (Array.isArray(v) ? v.length : v !== undefined));
|
|
464
497
|
const filed = useMemo(() => {
|
|
465
498
|
const out = new Map();
|
|
@@ -472,27 +505,49 @@ function Cards() {
|
|
|
472
505
|
}
|
|
473
506
|
return out;
|
|
474
507
|
}, [shown]);
|
|
508
|
+
// Show the 4 primary workflow columns side-by-side; include Canceled only when it holds cards.
|
|
509
|
+
const visibleColumns = useMemo(() => COLUMNS.filter((c) => c.id !== 'canceled' || (filed.get('canceled')?.length ?? 0) > 0), [filed]);
|
|
510
|
+
const moveCard = useCallback((card, status) => {
|
|
511
|
+
const targetKey = targetOf(card.projectKey, key, keys);
|
|
512
|
+
if (!targetKey)
|
|
513
|
+
return setRefused(t(NOWHERE));
|
|
514
|
+
setOverrides((prev) => ({ ...prev, [card.id]: { ...(prev[card.id] ?? {}), status } }));
|
|
515
|
+
toast.success(t('Moved to {column}', { column: columnName(status, t) ?? status }));
|
|
516
|
+
void edit(client, targetKey, card.number, { status })
|
|
517
|
+
.then(() => bump((x) => x + 1))
|
|
518
|
+
.catch((e) => {
|
|
519
|
+
setOverrides((prev) => {
|
|
520
|
+
const next = { ...prev };
|
|
521
|
+
delete next[card.id];
|
|
522
|
+
return next;
|
|
523
|
+
});
|
|
524
|
+
setRefused(say(e, t('this card'), 'save', t));
|
|
525
|
+
});
|
|
526
|
+
}, [client, key, keys, t]);
|
|
475
527
|
const move = useCallback((ref, status) => {
|
|
476
528
|
const [k, n] = ref.split('#');
|
|
529
|
+
const num = Number(n);
|
|
530
|
+
const matched = (liveCards ?? []).find((c) => c.number === num && (!k || c.projectKey === k));
|
|
531
|
+
if (matched) {
|
|
532
|
+
moveCard(matched, status);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
477
535
|
// THE CARD'S OWN REF FIRST, then the board on screen, then the first one
|
|
478
|
-
// the store named — and nothing after that.
|
|
479
|
-
|
|
480
|
-
// owner nobody established: an org id is not a project key, and `hanzo` is
|
|
481
|
-
// somebody's real board. A write with no name to write under is refused.
|
|
482
|
-
const targetKey = k || key || keys[0];
|
|
536
|
+
// the store named — and nothing after that.
|
|
537
|
+
const targetKey = targetOf(k, key, keys);
|
|
483
538
|
if (!n)
|
|
484
539
|
return;
|
|
485
540
|
if (!targetKey)
|
|
486
541
|
return setRefused(t(NOWHERE));
|
|
487
|
-
void edit(client, targetKey,
|
|
542
|
+
void edit(client, targetKey, num, { status })
|
|
488
543
|
.then(() => bump((x) => x + 1))
|
|
489
544
|
.catch((e) => setRefused(say(e, t('this card'), 'save', t)));
|
|
490
|
-
}, [client, key, keys, t]);
|
|
545
|
+
}, [client, key, keys, liveCards, moveCard, t]);
|
|
491
546
|
/**
|
|
492
547
|
* Files a card, and ANSWERS WHETHER IT LANDED.
|
|
493
548
|
*/
|
|
494
549
|
const add = useCallback(async (status, title) => {
|
|
495
|
-
const targetKey = key
|
|
550
|
+
const targetKey = targetOf('', key, keys);
|
|
496
551
|
if (!targetKey) {
|
|
497
552
|
setRefused(t(NOWHERE));
|
|
498
553
|
return false;
|
|
@@ -512,11 +567,22 @@ function Cards() {
|
|
|
512
567
|
return false;
|
|
513
568
|
}
|
|
514
569
|
}, [client, key, keys, t]);
|
|
515
|
-
return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { height: 52, shrink: 0, items: "center", gap: "$3", px: "$3", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { render: "h1", fontSize: "$4", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('Board') }), _jsxs(Select, { value: key || 'all', onValueChange: setKey, children: [_jsx(SelectTrigger, { "aria-label": t('Board'), width: 140, $sm: { width: 100 }, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: t('All
|
|
516
|
-
? t('{shown} of {total}', { shown: shown.length.toLocaleString(locale), total:
|
|
517
|
-
: t('{count} cards', { count:
|
|
570
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, height: "100%", overflow: "hidden", position: "relative", children: [_jsxs(XStack, { height: 52, shrink: 0, items: "center", gap: "$3", px: "$3", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { render: "h1", fontSize: "$4", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('Board') }), _jsxs(Select, { value: key || 'all', onValueChange: setKey, children: [_jsx(SelectTrigger, { "aria-label": t('Board'), width: 140, $sm: { width: 100 }, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: t('All boards') }, "all"), keys.map((k) => (_jsx(SelectItem, { value: k, children: k.charAt(0).toUpperCase() + k.slice(1) }, k)))] })] }), _jsx(YStack, { flex: 1 }), liveCards ? (_jsx(Text, { fontSize: "$1", color: "$soft", display: "none", $md: { display: 'flex' }, children: narrowed
|
|
571
|
+
? t('{shown} of {total}', { shown: shown.length.toLocaleString(locale), total: liveCards.length.toLocaleString(locale) })
|
|
572
|
+
: t('{count} cards', { count: liveCards.length.toLocaleString(locale) }) })) : null, _jsx(Act, { icon: ListFilter, label: t('Filter'), on: filtering || narrowed, onPress: () => setFiltering((v) => !v) }), devMode ? (_jsx(XStack, { display: "none", $md: { display: 'flex' }, children: _jsx(Act, { icon: SquareTerminal, label: t('Tabs & shell'), on: Boolean(aside), onPress: () => showAside(aside ? null : "tasks") }) })) : null] }), _jsxs(XStack, { flex: 1, minW: 0, minH: 0, overflow: "hidden", children: [view === 'planner' ? _jsx(Planner, { cards: liveCards ?? [], onOpen: setOpened }) : null, _jsxs(YStack, { flex: 1, minW: 0, minH: 0, overflow: "hidden",
|
|
518
573
|
// One view at a time: the planner is the other reading of these cards.
|
|
519
|
-
display: view === 'planner' ? "none" : "flex", children: [refused ? (_jsxs(XStack, { items: "center", gap: "$2", mx: "$4", mt: "$3", px: "$3", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$hover", children: [_jsx(Text, { fontSize: "$1", color: "$soft", flex: 1, minW: 0, children: t('{reason} Cards will appear here when it answers.', { reason: refused }) }), _jsx(Box, { render: "button", onClick: () => bump((x) => x + 1), shrink: 0, px: "$2", py: "$1", rounded: "$2", borderWidth: 1, borderColor: "
|
|
574
|
+
display: view === 'planner' ? "none" : "flex", children: [refused ? (_jsxs(XStack, { items: "center", gap: "$2", mx: "$4", mt: "$3", px: "$3", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$hover", shrink: 0, children: [_jsx(Text, { fontSize: "$1", color: "$soft", flex: 1, minW: 0, children: t('{reason} Cards will appear here when it answers.', { reason: refused }) }), _jsx(Box, { render: "button", onClick: () => bump((x) => x + 1), shrink: 0, px: "$2", py: "$1", rounded: "$2", borderWidth: 1, borderColor: "var(--border-strong)", hoverStyle: { bg: '$hover' }, children: _jsx(Text, { fontSize: "$1", color: "$ink", children: t('Try again') }) })] })) : null, _jsx(XStack, { flex: 1, minW: 0, minH: 0, overflowX: "auto", overflowY: "hidden", p: "$4", gap: "$3", items: "stretch", "$max-md": { p: '$3' }, "$platform-web": {
|
|
575
|
+
WebkitOverflowScrolling: 'touch',
|
|
576
|
+
overscrollBehaviorX: 'contain',
|
|
577
|
+
}, children: visibleColumns.map((c) => (_jsx(Column, { column: c, cards: filed.get(c.id) ?? [], people: roster, onDrop: move, onMoveCard: moveCard, onOpen: setOpened, onAdd: add, loading: cards === null && !refused }, c.id))) })] })] }), _jsxs(XStack, { shrink: 0, items: "center", gap: "$2", px: "$3", py: "$2", bg: "$background", z: "var(--z-raised)", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(Act, { icon: Columns3, label: t('Board'), on: view === 'board', onPress: () => setView('board') }), _jsx(Act, { icon: Calendar, label: t('Planner'), on: view === 'planner', onPress: () => setView('planner') }), _jsx(YStack, { flex: 1 }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, display: "none", $md: { display: 'flex' }, children: t('Cards stay in sync with your project issues.') })] }), filtering ? (_jsx(Filter, { want: want, labels: labels, onWant: setWant, onClose: () => setFiltering(false) })) : null, opened ? (_jsx(Detail, { card: liveCards?.find((c) => c.id === opened.id) ?? opened, people: roster, agents: agents, onClose: () => setOpened(null), onSaved: (patch) => {
|
|
578
|
+
if (patch) {
|
|
579
|
+
setOverrides((prev) => ({
|
|
580
|
+
...prev,
|
|
581
|
+
[opened.id]: { ...(prev[opened.id] ?? {}), ...patch },
|
|
582
|
+
}));
|
|
583
|
+
}
|
|
584
|
+
bump((x) => x + 1);
|
|
585
|
+
} }, opened.id)) : null] }));
|
|
520
586
|
}
|
|
521
587
|
/**
|
|
522
588
|
* The pane, and the session its reads need.
|