@skillcdn/console 0.6.0 → 0.6.2
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/README.md +7 -7
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +58 -35
- package/dist/agent-page.js.map +1 -1
- package/dist/agent-usage.d.ts +51 -0
- package/dist/agent-usage.d.ts.map +1 -0
- package/dist/agent-usage.js +77 -0
- package/dist/agent-usage.js.map +1 -0
- package/dist/api.d.ts +4 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4 -2
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +9 -2
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +491 -125
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +46 -4
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +163 -45
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +62 -13
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/machine-check.d.ts +24 -5
- package/dist/cli/machine-check.d.ts.map +1 -1
- package/dist/cli/machine-check.js +128 -16
- package/dist/cli/machine-check.js.map +1 -1
- package/dist/cli/pack.d.ts +11 -8
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +63 -28
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/runner-host.d.ts +2 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +1 -0
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/cli/secret-notes.d.ts.map +1 -1
- package/dist/cli/secret-notes.js +9 -1
- package/dist/cli/secret-notes.js.map +1 -1
- package/dist/cli/terminal.d.ts +10 -2
- package/dist/cli/terminal.d.ts.map +1 -1
- package/dist/cli/terminal.js +16 -4
- package/dist/cli/terminal.js.map +1 -1
- package/dist/client.d.ts +30 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +13 -1
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +76 -18
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +183 -53
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts +2 -0
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +6 -5
- package/dist/components/agents.js.map +1 -1
- package/dist/components/calendar.d.ts +24 -4
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +79 -36
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/categories.js +2 -2
- package/dist/components/categories.js.map +1 -1
- package/dist/components/comments.js +2 -2
- package/dist/components/comments.js.map +1 -1
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +5 -5
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/documents.d.ts.map +1 -1
- package/dist/components/documents.js +4 -4
- package/dist/components/documents.js.map +1 -1
- package/dist/components/event-feed.d.ts +2 -3
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +4 -184
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/goals.d.ts.map +1 -1
- package/dist/components/goals.js +3 -3
- package/dist/components/goals.js.map +1 -1
- package/dist/components/home.js +9 -9
- package/dist/components/home.js.map +1 -1
- package/dist/components/icon.d.ts.map +1 -1
- package/dist/components/icon.js +11 -2
- package/dist/components/icon.js.map +1 -1
- package/dist/components/notifications.d.ts +65 -0
- package/dist/components/notifications.d.ts.map +1 -0
- package/dist/components/notifications.js +162 -0
- package/dist/components/notifications.js.map +1 -0
- package/dist/components/pack-connect.js +1 -1
- package/dist/components/pack-connect.js.map +1 -1
- package/dist/components/pack-token.js +1 -1
- package/dist/components/pack-token.js.map +1 -1
- package/dist/components/people.js +2 -2
- package/dist/components/people.js.map +1 -1
- package/dist/components/pictures.js +1 -1
- package/dist/components/pictures.js.map +1 -1
- package/dist/components/plugin-settings.d.ts +22 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +63 -11
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.js +1 -1
- package/dist/components/projects.js.map +1 -1
- package/dist/components/roadmap.js +2 -2
- package/dist/components/roadmap.js.map +1 -1
- package/dist/components/rules.js +2 -2
- package/dist/components/rules.js.map +1 -1
- package/dist/components/runs.d.ts.map +1 -1
- package/dist/components/runs.js +1 -1
- package/dist/components/runs.js.map +1 -1
- package/dist/components/sessions.js +1 -1
- package/dist/components/sessions.js.map +1 -1
- package/dist/components/shell.d.ts +2 -0
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +1 -1
- package/dist/components/shell.js.map +1 -1
- package/dist/components/sign-in.js +2 -2
- package/dist/components/sign-in.js.map +1 -1
- package/dist/components/skills.d.ts.map +1 -1
- package/dist/components/skills.js +1 -1
- package/dist/components/skills.js.map +1 -1
- package/dist/components/task-view.d.ts +6 -0
- package/dist/components/task-view.d.ts.map +1 -1
- package/dist/components/task-view.js +3 -2
- package/dist/components/task-view.js.map +1 -1
- package/dist/components/tokens.js +1 -1
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/ui.d.ts +21 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +24 -3
- package/dist/components/ui.js.map +1 -1
- package/dist/components/work.js +1 -1
- package/dist/components/work.js.map +1 -1
- package/dist/console.css +506 -289
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +193 -16
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +17 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +31 -0
- package/dist/data.js.map +1 -1
- package/dist/desk-page.js +5 -5
- package/dist/desk-page.js.map +1 -1
- package/dist/feed-words.d.ts +5 -0
- package/dist/feed-words.d.ts.map +1 -0
- package/dist/feed-words.js +193 -0
- package/dist/feed-words.js.map +1 -0
- package/dist/i18n/en.d.ts +93 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +103 -15
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +105 -22
- package/dist/i18n/ko.js.map +1 -1
- package/dist/icons/glyphs.d.ts +370 -104
- package/dist/icons/glyphs.d.ts.map +1 -1
- package/dist/icons/glyphs.js +72 -66
- package/dist/icons/glyphs.js.map +1 -1
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/index.js +9 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +7 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +7 -0
- package/dist/limits.js.map +1 -1
- package/dist/notifications.d.ts +124 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/notifications.js +147 -0
- package/dist/notifications.js.map +1 -0
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +7 -12
- package/dist/onboarding.js.map +1 -1
- package/dist/plugin/capabilities.d.ts +1 -1
- package/dist/plugin/capabilities.d.ts.map +1 -1
- package/dist/plugin/capabilities.js +10 -0
- package/dist/plugin/capabilities.js.map +1 -1
- package/dist/plugin/context.d.ts +85 -1
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/limits.d.ts +7 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +7 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +8 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +13 -0
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +22 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +19 -3
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/testing.d.ts +2 -0
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +2 -0
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/router.d.ts +6 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +5 -0
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +2 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +2 -0
- package/dist/routes.js.map +1 -1
- package/dist/rules.js +1 -1
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +12 -97
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/browser.d.ts +50 -0
- package/dist/runner/browser.d.ts.map +1 -0
- package/dist/runner/browser.js +104 -0
- package/dist/runner/browser.js.map +1 -0
- package/dist/runner/claude.d.ts +1 -2
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +352 -13
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts +9 -10
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +809 -346
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +14 -3
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +27 -7
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +3 -1
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +17 -5
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/message.d.ts +53 -3
- package/dist/runner/message.d.ts.map +1 -1
- package/dist/runner/message.js +201 -20
- package/dist/runner/message.js.map +1 -1
- package/dist/runner/registry.d.ts +6 -0
- package/dist/runner/registry.d.ts.map +1 -1
- package/dist/runner/registry.js.map +1 -1
- package/dist/runner/rpc.d.ts +31 -0
- package/dist/runner/rpc.d.ts.map +1 -0
- package/dist/runner/rpc.js +102 -0
- package/dist/runner/rpc.js.map +1 -0
- package/dist/runner/runner.d.ts +41 -1
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +695 -52
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack.d.ts +17 -8
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +1250 -78
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/types.d.ts +160 -8
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js.map +1 -1
- package/dist/runner/usage.d.ts +105 -0
- package/dist/runner/usage.d.ts.map +1 -0
- package/dist/runner/usage.js +218 -0
- package/dist/runner/usage.js.map +1 -0
- package/dist/runner.d.ts +4 -4
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +3 -3
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +673 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +205 -1
- package/dist/schemas.js.map +1 -1
- package/dist/services.js +3 -3
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +4 -3
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +11 -13
- package/dist/setup-guide.js.map +1 -1
- package/dist/text.d.ts +7 -0
- package/dist/text.d.ts.map +1 -1
- package/dist/text.js +18 -0
- package/dist/text.js.map +1 -1
- package/dist/vocabulary.d.ts +4 -2
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +4 -1
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +26 -19
- package/docs/specs/plugins.md +16 -10
- package/docs/specs/rest.md +28 -10
- package/docs/specs/runner.md +132 -44
- package/package.json +4 -4
- package/skills/building-a-console/SKILL.md +2 -2
- package/skills/building-a-console/references/configuring.md +1 -1
- package/skills/building-a-plugin/SKILL.md +4 -4
- package/skills/planning-the-board/SKILL.md +1 -1
- package/skills/planning-the-board/references/setting-up.md +2 -2
- package/skills/running-an-agent/SKILL.md +15 -64
- package/skills/running-an-agent/references/preparing-the-machine.md +17 -0
- package/skills/running-an-agent/references/several-tasks.md +37 -0
- package/skills/running-an-agent/references/slack-app.md +70 -13
- package/skills/running-an-agent/references/the-account-and-the-invitation.md +5 -0
- package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +3 -0
- package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +16 -0
- package/skills/running-an-agent/references/your-first-task.md +14 -0
- package/skills/working-the-board/SKILL.md +9 -12
- package/skills/working-the-board/references/a-pack-skills-questions.md +3 -0
- package/skills/working-the-board/references/a-plugins-commands.md +3 -0
- package/skills/working-the-board/references/a-review.md +3 -0
- package/skills/working-the-board/references/an-open-run.md +3 -0
- package/skills/working-the-board/references/requirements.md +7 -0
- package/skills/working-the-board/references/the-pack.md +2 -2
- package/skills/working-the-board/references/what-they-were-told.md +3 -0
- package/skills/working-the-board/references/work-given-in-chat.md +5 -0
- package/src/agent-page.tsx +76 -47
- package/src/agent-usage.ts +113 -0
- package/src/api.ts +62 -0
- package/src/cli/cli.ts +634 -162
- package/src/cli/format.ts +190 -47
- package/src/cli/help.ts +77 -12
- package/src/cli/machine-check.ts +182 -29
- package/src/cli/pack.ts +81 -40
- package/src/cli/runner-host.ts +3 -0
- package/src/cli/secret-notes.ts +9 -1
- package/src/cli/terminal.ts +20 -4
- package/src/client.ts +94 -6
- package/src/components/agent-page.tsx +280 -63
- package/src/components/agents.tsx +23 -3
- package/src/components/calendar.tsx +93 -37
- package/src/components/categories.tsx +2 -2
- package/src/components/comments.tsx +5 -5
- package/src/components/decision-list.tsx +13 -10
- package/src/components/documents.tsx +13 -8
- package/src/components/event-feed.tsx +4 -203
- package/src/components/goals.tsx +6 -4
- package/src/components/home.tsx +12 -12
- package/src/components/icon.tsx +16 -3
- package/src/components/notifications.tsx +419 -0
- package/src/components/pack-connect.tsx +1 -1
- package/src/components/pack-token.tsx +5 -5
- package/src/components/people.tsx +3 -3
- package/src/components/pictures.tsx +1 -1
- package/src/components/plugin-settings.tsx +128 -23
- package/src/components/projects.tsx +1 -1
- package/src/components/roadmap.tsx +2 -2
- package/src/components/rules.tsx +2 -2
- package/src/components/runs.tsx +6 -3
- package/src/components/sessions.tsx +2 -2
- package/src/components/shell.tsx +3 -0
- package/src/components/sign-in.tsx +3 -3
- package/src/components/skills.tsx +5 -3
- package/src/components/task-view.tsx +18 -7
- package/src/components/tokens.tsx +2 -2
- package/src/components/ui.tsx +70 -5
- package/src/components/work.tsx +2 -2
- package/src/console.tsx +269 -12
- package/src/data.ts +54 -0
- package/src/desk-page.tsx +5 -5
- package/src/feed-words.ts +214 -0
- package/src/i18n/en.ts +114 -15
- package/src/i18n/ko.ts +115 -22
- package/src/icons/glyphs.ts +74 -68
- package/src/icons/index.ts +9 -1
- package/src/index.ts +11 -0
- package/src/limits.ts +7 -0
- package/src/notifications.ts +205 -0
- package/src/onboarding.ts +10 -14
- package/src/plugin/capabilities.ts +13 -0
- package/src/plugin/context.ts +87 -0
- package/src/plugin/limits.ts +7 -0
- package/src/plugin/manifest.ts +14 -0
- package/src/plugin/rest-schemas.ts +27 -3
- package/src/plugin/testing.ts +4 -0
- package/src/plugin.ts +2 -0
- package/src/router.ts +7 -0
- package/src/routes.ts +2 -0
- package/src/rules.ts +1 -1
- package/src/runner/acp.ts +12 -118
- package/src/runner/browser.ts +128 -0
- package/src/runner/claude.ts +399 -12
- package/src/runner/codex.ts +904 -400
- package/src/runner/config.ts +30 -7
- package/src/runner/desk.ts +22 -6
- package/src/runner/message.ts +251 -21
- package/src/runner/registry.ts +6 -0
- package/src/runner/rpc.ts +140 -0
- package/src/runner/runner.ts +863 -53
- package/src/runner/slack.ts +1535 -85
- package/src/runner/types.ts +150 -5
- package/src/runner/usage.ts +299 -0
- package/src/runner.ts +16 -1
- package/src/schemas.ts +249 -0
- package/src/services.ts +3 -3
- package/src/setup-guide.ts +12 -14
- package/src/styles/README.md +11 -7
- package/src/styles/console.css +2 -0
- package/src/styles/drawn-by-pages.json +7 -82
- package/src/styles/pages/agents.css +46 -35
- package/src/styles/pages/calendar.css +0 -1
- package/src/styles/pages/connect.css +0 -14
- package/src/styles/pages/decisions.css +2 -43
- package/src/styles/pages/documents.css +0 -29
- package/src/styles/pages/home.css +4 -16
- package/src/styles/pages/people.css +2 -17
- package/src/styles/pages/plugins.css +9 -12
- package/src/styles/pages/roadmap.css +0 -16
- package/src/styles/pages/settings.css +0 -28
- package/src/styles/pages/sign-in.css +2 -17
- package/src/styles/pages/thread.css +4 -50
- package/src/styles/pages/work.css +0 -5
- package/src/styles/parts/button.css +31 -0
- package/src/styles/parts/count.css +10 -0
- package/src/styles/parts/divider.css +17 -0
- package/src/styles/parts/frame.css +12 -0
- package/src/styles/parts/icon.css +39 -0
- package/src/styles/parts/menu.css +184 -0
- package/src/styles/parts/panel.css +7 -0
- package/src/styles/parts/progress.css +63 -0
- package/src/styles/parts/settings.css +2 -0
- package/src/styles/parts/sheet.css +28 -0
- package/src/styles/parts/text.css +34 -0
- package/src/text.ts +19 -0
- package/src/vocabulary.ts +4 -1
- package/template/plugin/package.json +1 -1
package/src/console.tsx
CHANGED
|
@@ -27,6 +27,9 @@ import {
|
|
|
27
27
|
type RestEvent,
|
|
28
28
|
type RestMe,
|
|
29
29
|
type RestMyDecisions,
|
|
30
|
+
type RestNotification,
|
|
31
|
+
type RestNotificationSettings,
|
|
32
|
+
type RestNotifications,
|
|
30
33
|
type RestPluginDetail,
|
|
31
34
|
type RestProject,
|
|
32
35
|
type RestProjectInput,
|
|
@@ -36,6 +39,7 @@ import {
|
|
|
36
39
|
type RestRules,
|
|
37
40
|
type RestSessions,
|
|
38
41
|
type RestTask,
|
|
42
|
+
type RestTaskFollow,
|
|
39
43
|
type RestTaskInput,
|
|
40
44
|
type RestToken,
|
|
41
45
|
type RestTokenCreated,
|
|
@@ -43,6 +47,7 @@ import {
|
|
|
43
47
|
RULES_PATH,
|
|
44
48
|
RULES_TITLE,
|
|
45
49
|
type TaskState,
|
|
50
|
+
unseenSince,
|
|
46
51
|
type WeekStart,
|
|
47
52
|
} from "./api.js";
|
|
48
53
|
import { AVATAR_SETS, type AvatarSet } from "./avatar.js";
|
|
@@ -69,6 +74,7 @@ import { EventFeed, type EventFeedProps } from "./components/event-feed.js";
|
|
|
69
74
|
import { GoalForm, GoalList, type GoalListProps, GoalView, goalMonth } from "./components/goals.js";
|
|
70
75
|
import { HomeGrid, type HomeGridProps, type ProjectGlance } from "./components/home.js";
|
|
71
76
|
import { MyDecisions, ReachedDecision } from "./components/my-decisions.js";
|
|
77
|
+
import { NotificationSettings, NotificationsMenu } from "./components/notifications.js";
|
|
72
78
|
import { PackTokenWays } from "./components/pack-token.js";
|
|
73
79
|
import { PAGE_SIZE } from "./components/paged.js";
|
|
74
80
|
import {
|
|
@@ -937,6 +943,26 @@ function TaskPage(props: {
|
|
|
937
943
|
(fetched !== undefined && (fetched.id === route.id || fetched.number === route.number)
|
|
938
944
|
? fetched
|
|
939
945
|
: undefined);
|
|
946
|
+
// What the reader is told of this task (ADR-0157): read with it, and not offered where the
|
|
947
|
+
// console keeps none, an older one.
|
|
948
|
+
const { taskFollow, followTask } = data.actions;
|
|
949
|
+
const [follow, setFollow] = useState<RestTaskFollow | undefined>(undefined);
|
|
950
|
+
const followed = task?.id;
|
|
951
|
+
useEffect(() => {
|
|
952
|
+
setFollow(undefined);
|
|
953
|
+
if (followed === undefined) {
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
const controller = new AbortController();
|
|
957
|
+
taskFollow(followed, controller.signal)
|
|
958
|
+
.then((found) => {
|
|
959
|
+
if (!controller.signal.aborted) {
|
|
960
|
+
setFollow(found);
|
|
961
|
+
}
|
|
962
|
+
})
|
|
963
|
+
.catch(() => undefined);
|
|
964
|
+
return () => controller.abort();
|
|
965
|
+
}, [followed, taskFollow]);
|
|
940
966
|
// The task this one is part of: among the board's, or asked for by itself when it was put away.
|
|
941
967
|
const parentId = task?.parentId ?? null;
|
|
942
968
|
const parentOnBoard =
|
|
@@ -1062,6 +1088,18 @@ function TaskPage(props: {
|
|
|
1062
1088
|
),
|
|
1063
1089
|
}}
|
|
1064
1090
|
onAbandonRun={(run) => void act(() => data.actions.abandonRun(run.id))}
|
|
1091
|
+
follow={
|
|
1092
|
+
follow === undefined
|
|
1093
|
+
? undefined
|
|
1094
|
+
: {
|
|
1095
|
+
on: follow.on,
|
|
1096
|
+
busy,
|
|
1097
|
+
onChange: (on) =>
|
|
1098
|
+
void act(async () => {
|
|
1099
|
+
setFollow(await followTask(task.id, on));
|
|
1100
|
+
}),
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1065
1103
|
onArchive={(target) =>
|
|
1066
1104
|
void act(async () => {
|
|
1067
1105
|
await data.actions.archiveTask(target.id);
|
|
@@ -1951,11 +1989,15 @@ function ProjectSettingsPage(props: {
|
|
|
1951
1989
|
}
|
|
1952
1990
|
|
|
1953
1991
|
/**
|
|
1954
|
-
* The views of the settings: the workspace's, read by everyone
|
|
1955
|
-
*
|
|
1956
|
-
* name.
|
|
1992
|
+
* The views of the settings: the workspace's, read by everyone; what the person chose to be
|
|
1993
|
+
* told of (ADR-0157), their own; and the browsers the person is signed in on (board #309),
|
|
1994
|
+
* which a console that holds a token does not offer, and so does not name.
|
|
1957
1995
|
*/
|
|
1958
|
-
function SettingsViews(props: {
|
|
1996
|
+
function SettingsViews(props: {
|
|
1997
|
+
readonly on: "workspace" | "notifications" | "sessions" | "categories";
|
|
1998
|
+
/** Whether the console keeps what a member is told of (ADR-0157), and so has that view. */
|
|
1999
|
+
readonly told: boolean;
|
|
2000
|
+
}) {
|
|
1959
2001
|
const settings = useWords().settings;
|
|
1960
2002
|
const views = settings.views;
|
|
1961
2003
|
return (
|
|
@@ -1967,6 +2009,15 @@ function SettingsViews(props: { readonly on: "workspace" | "sessions" | "categor
|
|
|
1967
2009
|
>
|
|
1968
2010
|
{views.workspace}
|
|
1969
2011
|
</a>
|
|
2012
|
+
{props.told && (
|
|
2013
|
+
<a
|
|
2014
|
+
className={cx("sc-tab", props.on === "notifications" && "sc-tab-current")}
|
|
2015
|
+
href={PATHS.notificationSettings}
|
|
2016
|
+
aria-current={props.on === "notifications" ? "page" : undefined}
|
|
2017
|
+
>
|
|
2018
|
+
{views.notifications}
|
|
2019
|
+
</a>
|
|
2020
|
+
)}
|
|
1970
2021
|
<a
|
|
1971
2022
|
className={cx("sc-tab", props.on === "sessions" && "sc-tab-current")}
|
|
1972
2023
|
href={PATHS.sessions}
|
|
@@ -2019,7 +2070,7 @@ function SessionsPage(props: {
|
|
|
2019
2070
|
<div className="sc-page-head">
|
|
2020
2071
|
<h1 className="sc-page-title">{words.settings.title}</h1>
|
|
2021
2072
|
</div>
|
|
2022
|
-
<SettingsViews on="sessions" />
|
|
2073
|
+
<SettingsViews on="sessions" told={keepsNotifications(data)} />
|
|
2023
2074
|
{(error ?? failure) !== undefined && <Callout tone="danger">{error ?? failure}</Callout>}
|
|
2024
2075
|
{sessions === undefined ? (
|
|
2025
2076
|
failure === undefined && (
|
|
@@ -2224,7 +2275,7 @@ function WorkspaceSettingsPage(props: {
|
|
|
2224
2275
|
return (
|
|
2225
2276
|
<>
|
|
2226
2277
|
{head}
|
|
2227
|
-
{!holdsToken(data) && <SettingsViews on="workspace" />}
|
|
2278
|
+
{!holdsToken(data) && <SettingsViews on="workspace" told={keepsNotifications(data)} />}
|
|
2228
2279
|
{error !== undefined && <Callout tone="danger">{error}</Callout>}
|
|
2229
2280
|
{workspace !== undefined && (
|
|
2230
2281
|
<section className="sc-panel" aria-label={words.settings.workspace.aria}>
|
|
@@ -2561,11 +2612,11 @@ function PlatePage(props: {
|
|
|
2561
2612
|
) {
|
|
2562
2613
|
setForbidden(true);
|
|
2563
2614
|
} else {
|
|
2564
|
-
setProblem(errorWords(failure, couldNotLoad));
|
|
2615
|
+
setProblem(errorWords(failure, couldNotLoad, words));
|
|
2565
2616
|
}
|
|
2566
2617
|
});
|
|
2567
2618
|
return () => controller.abort();
|
|
2568
|
-
}, [load, couldNotLoad, refused, remember, early]);
|
|
2619
|
+
}, [load, couldNotLoad, refused, remember, early, words]);
|
|
2569
2620
|
return (
|
|
2570
2621
|
<>
|
|
2571
2622
|
{props.headless !== true && (
|
|
@@ -2715,6 +2766,7 @@ function useMyDecisions(
|
|
|
2715
2766
|
/** What the first page is remembered by, with whose it is. */
|
|
2716
2767
|
remember: string,
|
|
2717
2768
|
): DecisionsRead {
|
|
2769
|
+
const words = useWords();
|
|
2718
2770
|
const [items, setItems] = useState<RestMyDecisions["items"] | undefined>(
|
|
2719
2771
|
() => rememberedAs<RememberedDecisions>(remember)?.items,
|
|
2720
2772
|
);
|
|
@@ -2744,7 +2796,7 @@ function useMyDecisions(
|
|
|
2744
2796
|
setMore(page.more);
|
|
2745
2797
|
} catch (failure: unknown) {
|
|
2746
2798
|
if (signal?.aborted !== true) {
|
|
2747
|
-
setProblem(errorWords(failure, couldNotLoad));
|
|
2799
|
+
setProblem(errorWords(failure, couldNotLoad, words));
|
|
2748
2800
|
}
|
|
2749
2801
|
} finally {
|
|
2750
2802
|
if (signal?.aborted !== true) {
|
|
@@ -2752,7 +2804,7 @@ function useMyDecisions(
|
|
|
2752
2804
|
}
|
|
2753
2805
|
}
|
|
2754
2806
|
},
|
|
2755
|
-
[myDecisions, raised, couldNotLoad, remember],
|
|
2807
|
+
[myDecisions, raised, couldNotLoad, remember, words],
|
|
2756
2808
|
);
|
|
2757
2809
|
useEffect(() => {
|
|
2758
2810
|
const controller = new AbortController();
|
|
@@ -2768,6 +2820,167 @@ function useMyDecisions(
|
|
|
2768
2820
|
return { items, more, busy, problem, readMore, reload };
|
|
2769
2821
|
}
|
|
2770
2822
|
|
|
2823
|
+
/** How many notifications the list under the bell reads at a time. */
|
|
2824
|
+
const NOTIFICATIONS_READ = 20;
|
|
2825
|
+
|
|
2826
|
+
/** Whether the console keeps what a member is told of (ADR-0157): an older one answers none of it. */
|
|
2827
|
+
const keepsNotifications = (data: ConsoleData): boolean =>
|
|
2828
|
+
data.me?.notifications !== undefined && data.me.notifications !== null;
|
|
2829
|
+
|
|
2830
|
+
/**
|
|
2831
|
+
* The bell in the page's head (ADR-0157): the person's notifications open under it, the
|
|
2832
|
+
* newest first. Opening the list reads all of it at one moment, so that the mark on the bell
|
|
2833
|
+
* goes; what was read at that moment is shown as new this once, and as seen from the next
|
|
2834
|
+
* opening on.
|
|
2835
|
+
*/
|
|
2836
|
+
function NotificationsBell(props: {
|
|
2837
|
+
readonly data: ConsoleData;
|
|
2838
|
+
readonly onNavigate: (href: string) => void;
|
|
2839
|
+
}) {
|
|
2840
|
+
const words = useWords();
|
|
2841
|
+
const said = words.notifications;
|
|
2842
|
+
const { data } = props;
|
|
2843
|
+
const { notifications, readNotifications } = data.actions;
|
|
2844
|
+
const [items, setItems] = useState<RestNotifications["items"] | undefined>(undefined);
|
|
2845
|
+
const [more, setMore] = useState(false);
|
|
2846
|
+
const [since, setSince] = useState<string | undefined>(undefined);
|
|
2847
|
+
const [problem, setProblem] = useState<string | undefined>(undefined);
|
|
2848
|
+
// The opening whose answer is shown: one that answers after a later one began is let go.
|
|
2849
|
+
const turn = useRef(0);
|
|
2850
|
+
// The moment an opening read something at whose rows were never shown (`unseenSince`).
|
|
2851
|
+
const unseen = useRef<string | undefined>(undefined);
|
|
2852
|
+
const open = useCallback(async () => {
|
|
2853
|
+
turn.current += 1;
|
|
2854
|
+
const mine = turn.current;
|
|
2855
|
+
setProblem(undefined);
|
|
2856
|
+
try {
|
|
2857
|
+
// Read first, then listed: what the list answers as read at that moment is what was
|
|
2858
|
+
// new, and one that arrives between the two is not read yet, and new all the same.
|
|
2859
|
+
const read = await readNotifications({ all: true });
|
|
2860
|
+
unseen.current = unseenSince(unseen.current, read);
|
|
2861
|
+
const page = await notifications({ limit: NOTIFICATIONS_READ, offset: 0 });
|
|
2862
|
+
if (mine !== turn.current) {
|
|
2863
|
+
return;
|
|
2864
|
+
}
|
|
2865
|
+
setSince(unseen.current ?? read.at);
|
|
2866
|
+
unseen.current = undefined;
|
|
2867
|
+
setItems(page.items);
|
|
2868
|
+
setMore(page.more);
|
|
2869
|
+
} catch (failure: unknown) {
|
|
2870
|
+
if (mine === turn.current) {
|
|
2871
|
+
setProblem(errorWords(failure, said.couldNotLoad, words));
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
}, [notifications, readNotifications, said.couldNotLoad, words]);
|
|
2875
|
+
const readMore = useCallback(async () => {
|
|
2876
|
+
const mine = turn.current;
|
|
2877
|
+
try {
|
|
2878
|
+
const page = await notifications({ limit: NOTIFICATIONS_READ, offset: items?.length ?? 0 });
|
|
2879
|
+
if (mine !== turn.current) {
|
|
2880
|
+
return;
|
|
2881
|
+
}
|
|
2882
|
+
// A list that moved between two reads, by what arrived meanwhile, answers a row a second
|
|
2883
|
+
// time: each is shown once.
|
|
2884
|
+
setItems((before) => {
|
|
2885
|
+
const shown = new Set((before ?? []).map((one) => one.id));
|
|
2886
|
+
return [...(before ?? []), ...page.items.filter((one) => !shown.has(one.id))];
|
|
2887
|
+
});
|
|
2888
|
+
setMore(page.more);
|
|
2889
|
+
} catch {
|
|
2890
|
+
// The rows that are shown stay: more is still offered, and asked for again by a press.
|
|
2891
|
+
}
|
|
2892
|
+
}, [notifications, items]);
|
|
2893
|
+
const visible = (key: string) => data.projects.some((project) => project.key === key);
|
|
2894
|
+
/** Where what a notification is of is read: the task, the decision, the agent account. */
|
|
2895
|
+
const hrefOf = (notification: RestNotification): string | undefined => {
|
|
2896
|
+
const { event, project } = notification;
|
|
2897
|
+
if (event.decisionId !== null) {
|
|
2898
|
+
return project !== null && visible(project.key)
|
|
2899
|
+
? decisionHref(project.key, event.decisionId)
|
|
2900
|
+
: myDecisionHref(event.decisionId);
|
|
2901
|
+
}
|
|
2902
|
+
if (project !== null && event.data.number !== undefined) {
|
|
2903
|
+
return visible(project.key) ? taskHref(project.key, event.data.number) : undefined;
|
|
2904
|
+
}
|
|
2905
|
+
return event.data.handle === undefined ? undefined : agentHref(event.data.handle);
|
|
2906
|
+
};
|
|
2907
|
+
return (
|
|
2908
|
+
<NotificationsMenu
|
|
2909
|
+
unread={data.me?.notifications?.unread ?? 0}
|
|
2910
|
+
notifications={items}
|
|
2911
|
+
since={since}
|
|
2912
|
+
problem={problem}
|
|
2913
|
+
href={hrefOf}
|
|
2914
|
+
settingsHref={PATHS.notificationSettings}
|
|
2915
|
+
more={more}
|
|
2916
|
+
onMore={() => void readMore()}
|
|
2917
|
+
onOpen={() => void open()}
|
|
2918
|
+
onNavigate={props.onNavigate}
|
|
2919
|
+
/>
|
|
2920
|
+
);
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
/**
|
|
2924
|
+
* What the person chose to be told of (ADR-0157): a view of the settings, their own. Each
|
|
2925
|
+
* choice is kept as it is made.
|
|
2926
|
+
*/
|
|
2927
|
+
function NotificationSettingsPage(props: { readonly data: ConsoleData }) {
|
|
2928
|
+
const words = useWords();
|
|
2929
|
+
const said = words.notifications;
|
|
2930
|
+
const { data } = props;
|
|
2931
|
+
const { notificationSettings, updateNotificationSettings } = data.actions;
|
|
2932
|
+
const [settings, setSettings] = useState<RestNotificationSettings | undefined>(undefined);
|
|
2933
|
+
const [problem, setProblem] = useState<string | undefined>(undefined);
|
|
2934
|
+
const { busy, error, act } = useAction();
|
|
2935
|
+
useEffect(() => {
|
|
2936
|
+
const controller = new AbortController();
|
|
2937
|
+
setProblem(undefined);
|
|
2938
|
+
notificationSettings(controller.signal)
|
|
2939
|
+
.then((found) => {
|
|
2940
|
+
if (!controller.signal.aborted) {
|
|
2941
|
+
setSettings(found);
|
|
2942
|
+
}
|
|
2943
|
+
})
|
|
2944
|
+
.catch((failure: unknown) => {
|
|
2945
|
+
if (!controller.signal.aborted) {
|
|
2946
|
+
setProblem(errorWords(failure, said.couldNotLoad, words));
|
|
2947
|
+
}
|
|
2948
|
+
});
|
|
2949
|
+
return () => controller.abort();
|
|
2950
|
+
}, [notificationSettings, said.couldNotLoad, words]);
|
|
2951
|
+
const shownProblem = problem ?? error;
|
|
2952
|
+
return (
|
|
2953
|
+
<>
|
|
2954
|
+
<div className="sc-page-head">
|
|
2955
|
+
<h1 className="sc-page-title">{words.settings.title}</h1>
|
|
2956
|
+
</div>
|
|
2957
|
+
{!holdsToken(data) && <SettingsViews on="notifications" told />}
|
|
2958
|
+
{shownProblem !== undefined && <Callout tone="danger">{shownProblem}</Callout>}
|
|
2959
|
+
{settings === undefined ? (
|
|
2960
|
+
shownProblem === undefined && (
|
|
2961
|
+
<div className="sc-loading">
|
|
2962
|
+
<Spinner label={said.loading} />
|
|
2963
|
+
</div>
|
|
2964
|
+
)
|
|
2965
|
+
) : (
|
|
2966
|
+
<section className="sc-panel" aria-label={said.settings.title}>
|
|
2967
|
+
<NotificationSettings
|
|
2968
|
+
settings={settings}
|
|
2969
|
+
projects={data.projects.map((project) => ({ key: project.key, name: project.name }))}
|
|
2970
|
+
agent={data.me?.person?.kind === "agent"}
|
|
2971
|
+
busy={busy}
|
|
2972
|
+
onChange={(input) =>
|
|
2973
|
+
void act(async () => {
|
|
2974
|
+
setSettings(await updateNotificationSettings(input));
|
|
2975
|
+
})
|
|
2976
|
+
}
|
|
2977
|
+
/>
|
|
2978
|
+
</section>
|
|
2979
|
+
)}
|
|
2980
|
+
</>
|
|
2981
|
+
);
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2771
2984
|
/**
|
|
2772
2985
|
* A person's decisions (ADR-0042), laid out as a project's decisions page is: those waiting for
|
|
2773
2986
|
* their answer, answered here, those they asked of others, and the record of both.
|
|
@@ -2844,6 +3057,34 @@ function MyDecisionsPage(props: { readonly data: ConsoleData }) {
|
|
|
2844
3057
|
);
|
|
2845
3058
|
}
|
|
2846
3059
|
|
|
3060
|
+
/** How often the agents are read again while a page that says how they stand is in view. */
|
|
3061
|
+
const AGENTS_AGAIN_MS = 30_000;
|
|
3062
|
+
|
|
3063
|
+
/**
|
|
3064
|
+
* Keeps the agent accounts as they stand while a page shows them, how each stands and what its
|
|
3065
|
+
* allowance has used (ADR-0156): read again as the page is opened, every half a minute while its
|
|
3066
|
+
* window is in view, as often as a runner says how it stands, and when the person comes back to
|
|
3067
|
+
* it. A window nobody looks at asks nothing.
|
|
3068
|
+
*/
|
|
3069
|
+
function AgentsKept(props: { readonly data: ConsoleData }) {
|
|
3070
|
+
const { refreshAgents } = props.data.actions;
|
|
3071
|
+
useEffect(() => {
|
|
3072
|
+
const again = () => {
|
|
3073
|
+
if (document.visibilityState === "visible") {
|
|
3074
|
+
refreshAgents().catch(() => undefined);
|
|
3075
|
+
}
|
|
3076
|
+
};
|
|
3077
|
+
again();
|
|
3078
|
+
const timer = setInterval(again, AGENTS_AGAIN_MS);
|
|
3079
|
+
document.addEventListener("visibilitychange", again);
|
|
3080
|
+
return () => {
|
|
3081
|
+
clearInterval(timer);
|
|
3082
|
+
document.removeEventListener("visibilitychange", again);
|
|
3083
|
+
};
|
|
3084
|
+
}, [refreshAgents]);
|
|
3085
|
+
return null;
|
|
3086
|
+
}
|
|
3087
|
+
|
|
2847
3088
|
function WorkPage(props: {
|
|
2848
3089
|
readonly data: ConsoleData;
|
|
2849
3090
|
readonly components: ConsoleComponents;
|
|
@@ -2854,7 +3095,12 @@ function WorkPage(props: {
|
|
|
2854
3095
|
return (
|
|
2855
3096
|
<PlatePage
|
|
2856
3097
|
components={props.components}
|
|
2857
|
-
under={
|
|
3098
|
+
under={
|
|
3099
|
+
<>
|
|
3100
|
+
<AgentsKept data={props.data} />
|
|
3101
|
+
<AgentsNeedingYou agents={props.data.agents} me={props.data.me?.person?.id} />
|
|
3102
|
+
</>
|
|
3103
|
+
}
|
|
2858
3104
|
load={plate}
|
|
2859
3105
|
remember={`work:${props.data.me?.person?.id ?? ""}`}
|
|
2860
3106
|
early="work"
|
|
@@ -3088,6 +3334,9 @@ function WorkspacePage(props: {
|
|
|
3088
3334
|
if (route.name === "my-decision") {
|
|
3089
3335
|
return <MyDecisionPage id={route.id} data={data} />;
|
|
3090
3336
|
}
|
|
3337
|
+
if (route.name === "notification-settings") {
|
|
3338
|
+
return <NotificationSettingsPage data={data} />;
|
|
3339
|
+
}
|
|
3091
3340
|
if (route.name === "person-work") {
|
|
3092
3341
|
return <PersonWorkPage id={route.id} data={data} components={components} week={route.week} />;
|
|
3093
3342
|
}
|
|
@@ -3113,7 +3362,7 @@ function WorkspacePage(props: {
|
|
|
3113
3362
|
<div className="sc-page-head">
|
|
3114
3363
|
<h1 className="sc-page-title">{words.settings.title}</h1>
|
|
3115
3364
|
</div>
|
|
3116
|
-
{!holdsToken(data) && <SettingsViews on="categories" />}
|
|
3365
|
+
{!holdsToken(data) && <SettingsViews on="categories" told={keepsNotifications(data)} />}
|
|
3117
3366
|
{error !== undefined && <Callout tone="danger">{error}</Callout>}
|
|
3118
3367
|
<components.CategoryList
|
|
3119
3368
|
categories={data.categories}
|
|
@@ -3419,6 +3668,7 @@ function WorkspacePage(props: {
|
|
|
3419
3668
|
{error !== undefined && <Callout tone="danger">{error}</Callout>}
|
|
3420
3669
|
{view !== "connected" ? (
|
|
3421
3670
|
<>
|
|
3671
|
+
<AgentsKept data={data} />
|
|
3422
3672
|
<section className="sc-people-group" aria-label={agents.views.mine}>
|
|
3423
3673
|
<p className="sc-lead">{accounts.intro}</p>
|
|
3424
3674
|
<components.AgentAccountList
|
|
@@ -3692,6 +3942,7 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
3692
3942
|
label: words.nav.settings,
|
|
3693
3943
|
current:
|
|
3694
3944
|
route.name === "workspace-settings" ||
|
|
3945
|
+
route.name === "notification-settings" ||
|
|
3695
3946
|
route.name === "sessions" ||
|
|
3696
3947
|
route.name === "categories" ||
|
|
3697
3948
|
route.name === "plugins-settings",
|
|
@@ -3884,6 +4135,12 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
3884
4135
|
onLanguage={(tag) => void data.actions.updateMe({ language: tag }).catch(() => undefined)}
|
|
3885
4136
|
person={data.me.person}
|
|
3886
4137
|
live={projectKey === undefined ? undefined : data.live}
|
|
4138
|
+
notifications={
|
|
4139
|
+
// Where the console keeps what a member is told of (ADR-0157): an older one answers none.
|
|
4140
|
+
keepsNotifications(data) ? (
|
|
4141
|
+
<NotificationsBell data={data} onNavigate={(href) => navigation.go(href)} />
|
|
4142
|
+
) : undefined
|
|
4143
|
+
}
|
|
3887
4144
|
wide={
|
|
3888
4145
|
route.name === "board" ||
|
|
3889
4146
|
route.name === "calendar" ||
|
package/src/data.ts
CHANGED
|
@@ -35,6 +35,11 @@ import {
|
|
|
35
35
|
type RestMemberPatch,
|
|
36
36
|
type RestMePatch,
|
|
37
37
|
type RestMyDecisions,
|
|
38
|
+
type RestNotificationSettings,
|
|
39
|
+
type RestNotificationSettingsInput,
|
|
40
|
+
type RestNotifications,
|
|
41
|
+
type RestNotificationsRead,
|
|
42
|
+
type RestNotificationsReadInput,
|
|
38
43
|
type RestOrganization,
|
|
39
44
|
type RestPackConnect,
|
|
40
45
|
type RestPackConnectStarted,
|
|
@@ -55,6 +60,7 @@ import {
|
|
|
55
60
|
type RestSessions,
|
|
56
61
|
type RestSkills,
|
|
57
62
|
type RestTask,
|
|
63
|
+
type RestTaskFollow,
|
|
58
64
|
type RestTaskInput,
|
|
59
65
|
type RestTaskPatch,
|
|
60
66
|
type RestTasks,
|
|
@@ -86,6 +92,12 @@ const FEED_KEEP = 200;
|
|
|
86
92
|
const FEED_MAX_PAGES = 20;
|
|
87
93
|
/** How long changes that arrive together are gathered before the lists are loaded once. */
|
|
88
94
|
const RELOAD_DELAY_MS = 150;
|
|
95
|
+
/**
|
|
96
|
+
* How long after something happened on a task or a decision the mark on the bell is
|
|
97
|
+
* asked for again: the console makes a member's notifications a few seconds after the event,
|
|
98
|
+
* as its worker reads the feed (ADR-0157).
|
|
99
|
+
*/
|
|
100
|
+
const TOLD_DELAY_MS = 7000;
|
|
89
101
|
|
|
90
102
|
export interface ConsoleActions {
|
|
91
103
|
/**
|
|
@@ -93,6 +105,8 @@ export interface ConsoleActions {
|
|
|
93
105
|
* time it is shown, so that what waits in each project is what waits now (ADR-0107).
|
|
94
106
|
*/
|
|
95
107
|
refreshProjects(): Promise<void>;
|
|
108
|
+
/** Reads the agent accounts again, for a page that says how they stand: what fails stays as it was. */
|
|
109
|
+
refreshAgents(): Promise<void>;
|
|
96
110
|
/** Makes a project, whose owner the person becomes, with an image for its mark when one is given. */
|
|
97
111
|
createProject(input: RestProjectInput, icon?: FileUpload): Promise<RestProject>;
|
|
98
112
|
/** Changes the settings of the project the page is on; for an owner. */
|
|
@@ -117,6 +131,21 @@ export interface ConsoleActions {
|
|
|
117
131
|
updateTask(id: string, patch: RestTaskPatch): Promise<RestTask>;
|
|
118
132
|
/** One task by its id or its number, asked for by itself: a task put away is not among the board's. */
|
|
119
133
|
fetchTask(ref: string, signal?: AbortSignal): Promise<RestTask>;
|
|
134
|
+
/** What the person made of a task of the project the page is on (ADR-0157): told of everything on it, of nothing, or as their settings say. */
|
|
135
|
+
taskFollow(ref: string, signal?: AbortSignal): Promise<RestTaskFollow>;
|
|
136
|
+
followTask(ref: string, on: boolean): Promise<RestTaskFollow>;
|
|
137
|
+
/** A page of what the person is told of (ADR-0157), the newest first, read when the page asks. */
|
|
138
|
+
notifications(
|
|
139
|
+
filter: { readonly unread?: boolean; readonly limit: number; readonly offset: number },
|
|
140
|
+
signal?: AbortSignal,
|
|
141
|
+
): Promise<RestNotifications>;
|
|
142
|
+
/** Marks notifications as read, those named or all; the mark on the bell follows. */
|
|
143
|
+
readNotifications(input: RestNotificationsReadInput): Promise<RestNotificationsRead>;
|
|
144
|
+
/** What the person is told of, and changing it. */
|
|
145
|
+
notificationSettings(signal?: AbortSignal): Promise<RestNotificationSettings>;
|
|
146
|
+
updateNotificationSettings(
|
|
147
|
+
input: RestNotificationSettingsInput,
|
|
148
|
+
): Promise<RestNotificationSettings>;
|
|
120
149
|
/** Puts a done or dropped task away, or brings one back (ADR-0029). */
|
|
121
150
|
archiveTask(id: string): Promise<RestTask>;
|
|
122
151
|
restoreTask(id: string): Promise<RestTask>;
|
|
@@ -613,6 +642,7 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
613
642
|
const { signal } = controller;
|
|
614
643
|
let unfollow: (() => void) | undefined;
|
|
615
644
|
let reloadTimer: ReturnType<typeof setTimeout> | undefined;
|
|
645
|
+
let toldTimer: ReturnType<typeof setTimeout> | undefined;
|
|
616
646
|
const scope = client.project(projectKey);
|
|
617
647
|
const run = async () => {
|
|
618
648
|
try {
|
|
@@ -680,6 +710,14 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
680
710
|
refreshMe(signal).catch(() => undefined);
|
|
681
711
|
}
|
|
682
712
|
}, RELOAD_DELAY_MS);
|
|
713
|
+
// What happened may be told to the person: the mark on the bell follows,
|
|
714
|
+
// once the console has had the time to make the notification.
|
|
715
|
+
if (event.kind.startsWith("task.") || event.kind.startsWith("decision.")) {
|
|
716
|
+
clearTimeout(toldTimer);
|
|
717
|
+
toldTimer = setTimeout(() => {
|
|
718
|
+
refreshMe(signal).catch(() => undefined);
|
|
719
|
+
}, TOLD_DELAY_MS);
|
|
720
|
+
}
|
|
683
721
|
},
|
|
684
722
|
});
|
|
685
723
|
};
|
|
@@ -687,6 +725,7 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
687
725
|
return () => {
|
|
688
726
|
controller.abort();
|
|
689
727
|
clearTimeout(reloadTimer);
|
|
728
|
+
clearTimeout(toldTimer);
|
|
690
729
|
unfollow?.();
|
|
691
730
|
setLive(false);
|
|
692
731
|
};
|
|
@@ -705,6 +744,10 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
705
744
|
const answer = await client.projects();
|
|
706
745
|
setProjects(answer.items);
|
|
707
746
|
},
|
|
747
|
+
async refreshAgents() {
|
|
748
|
+
const answer = await client.agents();
|
|
749
|
+
setAgents(answer.items);
|
|
750
|
+
},
|
|
708
751
|
async createProject(input, icon) {
|
|
709
752
|
const made = await client.createProject(input);
|
|
710
753
|
const marked = icon === undefined ? made : await client.project(made.key).setIcon(icon);
|
|
@@ -774,6 +817,17 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
774
817
|
return task;
|
|
775
818
|
},
|
|
776
819
|
fetchTask: (ref, signal) => scope().task(ref, signal),
|
|
820
|
+
taskFollow: (ref, signal) => scope().taskFollow(ref, signal),
|
|
821
|
+
followTask: (ref, on) => scope().followTask(ref, on),
|
|
822
|
+
notifications: (filter, signal) => client.notifications(filter, signal),
|
|
823
|
+
async readNotifications(input) {
|
|
824
|
+
const read = await client.readNotifications(input);
|
|
825
|
+
// Not waited for: the list that opens is read meanwhile, and the mark goes when this answers.
|
|
826
|
+
void refreshMe().catch(() => undefined);
|
|
827
|
+
return read;
|
|
828
|
+
},
|
|
829
|
+
notificationSettings: (signal) => client.notificationSettings(signal),
|
|
830
|
+
updateNotificationSettings: (input) => client.updateNotificationSettings(input),
|
|
777
831
|
async archiveTask(id) {
|
|
778
832
|
const task = await scope().archiveTask(id);
|
|
779
833
|
setTasks((current) => current.filter((candidate) => candidate.id !== id));
|
package/src/desk-page.tsx
CHANGED
|
@@ -147,11 +147,11 @@ export function DeskPage(props: DeskPageProps) {
|
|
|
147
147
|
})
|
|
148
148
|
.catch((failure: unknown) => {
|
|
149
149
|
if (!controller.signal.aborted) {
|
|
150
|
-
setProblem(errorWords(failure, couldNotLoad));
|
|
150
|
+
setProblem(errorWords(failure, couldNotLoad, pack));
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
return () => controller.abort();
|
|
154
|
-
}, [client, view, personId, couldNotLoad]);
|
|
154
|
+
}, [client, view, personId, couldNotLoad, pack]);
|
|
155
155
|
|
|
156
156
|
// The closed work is read each time a view that shows it is come to, or its words change:
|
|
157
157
|
// the first page of each project, for the figures everything, for the archive what the
|
|
@@ -173,7 +173,7 @@ export function DeskPage(props: DeskPageProps) {
|
|
|
173
173
|
})
|
|
174
174
|
.catch((failure: unknown) => {
|
|
175
175
|
if (!controller.signal.aborted) {
|
|
176
|
-
setProblem(errorWords(failure, couldNotLoad));
|
|
176
|
+
setProblem(errorWords(failure, couldNotLoad, pack));
|
|
177
177
|
}
|
|
178
178
|
})
|
|
179
179
|
.finally(() => {
|
|
@@ -182,7 +182,7 @@ export function DeskPage(props: DeskPageProps) {
|
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
184
|
return () => controller.abort();
|
|
185
|
-
}, [client, reads, wanted, personId, projects, couldNotLoad]);
|
|
185
|
+
}, [client, reads, wanted, personId, projects, couldNotLoad, pack]);
|
|
186
186
|
|
|
187
187
|
if (personId === undefined) {
|
|
188
188
|
return null;
|
|
@@ -203,7 +203,7 @@ export function DeskPage(props: DeskPageProps) {
|
|
|
203
203
|
};
|
|
204
204
|
(shown.words.length === 0 ? setWhole : setFound)(next);
|
|
205
205
|
})
|
|
206
|
-
.catch((failure: unknown) => setProblem(errorWords(failure, couldNotLoad)))
|
|
206
|
+
.catch((failure: unknown) => setProblem(errorWords(failure, couldNotLoad, pack)))
|
|
207
207
|
.finally(() => setBusy(false));
|
|
208
208
|
};
|
|
209
209
|
// A run that ended on a task still open has its title on the plate, where the plate was read.
|