@skillcdn/console 0.5.0 → 0.5.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 +87 -12
- package/SKILLCDN.md +3 -3
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +7 -6
- package/dist/agent-page.js.map +1 -1
- package/dist/api.d.ts +9 -7
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +8 -6
- package/dist/api.js.map +1 -1
- package/dist/charts.d.ts +103 -0
- package/dist/charts.d.ts.map +1 -0
- package/dist/charts.js +182 -0
- package/dist/charts.js.map +1 -0
- package/dist/cli/cli.d.ts +58 -2
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +1742 -472
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/command-words.d.ts +20 -0
- package/dist/cli/command-words.d.ts.map +1 -0
- package/dist/cli/command-words.js +51 -0
- package/dist/cli/command-words.js.map +1 -0
- package/dist/cli/credentials.d.ts +54 -5
- package/dist/cli/credentials.d.ts.map +1 -1
- package/dist/cli/credentials.js +126 -20
- package/dist/cli/credentials.js.map +1 -1
- package/dist/cli/directory.d.ts +19 -4
- package/dist/cli/directory.d.ts.map +1 -1
- package/dist/cli/directory.js +16 -8
- package/dist/cli/directory.js.map +1 -1
- package/dist/cli/format.d.ts +70 -9
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +267 -40
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts +13 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +101 -58
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/machine-check.d.ts +36 -0
- package/dist/cli/machine-check.d.ts.map +1 -0
- package/dist/cli/machine-check.js +151 -0
- package/dist/cli/machine-check.js.map +1 -0
- package/dist/cli/main.js +76 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/pack.d.ts +69 -60
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +241 -270
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/plugin-check.d.ts +42 -0
- package/dist/cli/plugin-check.d.ts.map +1 -1
- package/dist/cli/plugin-check.js +221 -36
- package/dist/cli/plugin-check.js.map +1 -1
- package/dist/cli/plugin-cli.d.ts +6 -1
- package/dist/cli/plugin-cli.d.ts.map +1 -1
- package/dist/cli/plugin-cli.js +21 -4
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/plugin-main.js +1 -0
- package/dist/cli/plugin-main.js.map +1 -1
- package/dist/cli/runner-host.d.ts +7 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +2 -0
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/cli/secret-notes.d.ts +8 -0
- package/dist/cli/secret-notes.d.ts.map +1 -0
- package/dist/cli/secret-notes.js +48 -0
- package/dist/cli/secret-notes.js.map +1 -0
- package/dist/cli/serve.d.ts +33 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +252 -3
- package/dist/cli/serve.js.map +1 -1
- package/dist/client.d.ts +54 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +77 -80
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +164 -8
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +588 -151
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +1 -1
- package/dist/components/agents.js.map +1 -1
- package/dist/components/board.d.ts.map +1 -1
- package/dist/components/board.js +3 -2
- package/dist/components/board.js.map +1 -1
- package/dist/components/categories.js +1 -1
- package/dist/components/categories.js.map +1 -1
- package/dist/components/charts.d.ts +157 -0
- package/dist/components/charts.d.ts.map +1 -0
- package/dist/components/charts.js +182 -0
- package/dist/components/charts.js.map +1 -0
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +1 -1
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/desk-records.d.ts +102 -0
- package/dist/components/desk-records.d.ts.map +1 -0
- package/dist/components/desk-records.js +221 -0
- package/dist/components/desk-records.js.map +1 -0
- package/dist/components/desk.d.ts +85 -0
- package/dist/components/desk.d.ts.map +1 -0
- package/dist/components/desk.js +135 -0
- package/dist/components/desk.js.map +1 -0
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +7 -3
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/goals.d.ts +2 -0
- package/dist/components/goals.d.ts.map +1 -1
- package/dist/components/goals.js +1 -1
- package/dist/components/goals.js.map +1 -1
- package/dist/components/home.d.ts.map +1 -1
- package/dist/components/home.js +14 -6
- package/dist/components/home.js.map +1 -1
- package/dist/components/icon.d.ts +31 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +169 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/markdown.d.ts +6 -0
- package/dist/components/markdown.d.ts.map +1 -1
- package/dist/components/markdown.js +10 -2
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/people.js +1 -1
- package/dist/components/people.js.map +1 -1
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +7 -0
- package/dist/components/plugin-frame.js.map +1 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +54 -3
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.d.ts +17 -4
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +51 -12
- package/dist/components/projects.js.map +1 -1
- package/dist/components/rules.d.ts +8 -10
- package/dist/components/rules.d.ts.map +1 -1
- package/dist/components/rules.js +35 -13
- package/dist/components/rules.js.map +1 -1
- package/dist/components/sessions.d.ts.map +1 -1
- package/dist/components/sessions.js +3 -2
- package/dist/components/sessions.js.map +1 -1
- package/dist/components/setup.d.ts +9 -3
- package/dist/components/setup.d.ts.map +1 -1
- package/dist/components/setup.js +12 -6
- package/dist/components/setup.js.map +1 -1
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +3 -2
- package/dist/components/shell.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 +5 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +10 -7
- package/dist/components/ui.js.map +1 -1
- package/dist/connect-page.js +1 -1
- package/dist/connect-page.js.map +1 -1
- package/dist/console.css +1172 -106
- package/dist/console.d.ts +5 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +52 -39
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +32 -33
- package/dist/data.js.map +1 -1
- package/dist/desk-page.d.ts +38 -0
- package/dist/desk-page.d.ts.map +1 -0
- package/dist/desk-page.js +184 -0
- package/dist/desk-page.js.map +1 -0
- package/dist/desk-records-page.d.ts +18 -0
- package/dist/desk-records-page.d.ts.map +1 -0
- package/dist/desk-records-page.js +130 -0
- package/dist/desk-records-page.js.map +1 -0
- package/dist/desk-records.d.ts +247 -0
- package/dist/desk-records.d.ts.map +1 -0
- package/dist/desk-records.js +543 -0
- package/dist/desk-records.js.map +1 -0
- package/dist/desk.d.ts +122 -0
- package/dist/desk.d.ts.map +1 -0
- package/dist/desk.js +211 -0
- package/dist/desk.js.map +1 -0
- package/dist/feed-stream.d.ts +39 -0
- package/dist/feed-stream.d.ts.map +1 -0
- package/dist/feed-stream.js +117 -0
- package/dist/feed-stream.js.map +1 -0
- package/dist/home-tiles.d.ts +19 -3
- package/dist/home-tiles.d.ts.map +1 -1
- package/dist/home-tiles.js +147 -42
- package/dist/home-tiles.js.map +1 -1
- package/dist/i18n/en.d.ts +228 -6
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +309 -9
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +366 -85
- package/dist/i18n/ko.js.map +1 -1
- package/dist/i18n/particles.d.ts +7 -0
- package/dist/i18n/particles.d.ts.map +1 -0
- package/dist/i18n/particles.js +72 -0
- package/dist/i18n/particles.js.map +1 -0
- package/dist/icons/glyphs.d.ts +605 -0
- package/dist/icons/glyphs.d.ts.map +1 -0
- package/dist/icons/glyphs.js +104 -0
- package/dist/icons/glyphs.js.map +1 -0
- package/dist/icons/index.d.ts +59 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +157 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +20 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +20 -0
- package/dist/limits.js.map +1 -1
- package/dist/marks.d.ts +9 -0
- package/dist/marks.d.ts.map +1 -1
- package/dist/marks.js +9 -0
- package/dist/marks.js.map +1 -1
- package/dist/onboarding.d.ts +6 -0
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +5 -5
- package/dist/onboarding.js.map +1 -1
- package/dist/plugin/context.d.ts +42 -11
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/limits.d.ts +2 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +2 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +13 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +30 -3
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +55 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +37 -0
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/sandbox.d.ts.map +1 -1
- package/dist/plugin/sandbox.js +4 -1
- package/dist/plugin/sandbox.js.map +1 -1
- package/dist/plugin/testing.d.ts +6 -2
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +52 -10
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin/web.d.ts +3 -0
- package/dist/plugin/web.d.ts.map +1 -1
- package/dist/plugin/web.js +5 -1
- package/dist/plugin/web.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/records.d.ts +283 -0
- package/dist/records.d.ts.map +1 -0
- package/dist/records.js +543 -0
- package/dist/records.js.map +1 -0
- package/dist/routes.d.ts +3 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +3 -1
- package/dist/routes.js.map +1 -1
- package/dist/rules.d.ts +30 -11
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +98 -45
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +32 -21
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/awake.d.ts +35 -0
- package/dist/runner/awake.d.ts.map +1 -0
- package/dist/runner/awake.js +95 -0
- package/dist/runner/awake.js.map +1 -0
- package/dist/runner/claude.d.ts +1 -1
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +100 -18
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts +1 -1
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +20 -17
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +5 -0
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +9 -0
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +43 -2
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +168 -13
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/process.d.ts.map +1 -1
- package/dist/runner/process.js +11 -4
- package/dist/runner/process.js.map +1 -1
- package/dist/runner/redact.d.ts +39 -4
- package/dist/runner/redact.d.ts.map +1 -1
- package/dist/runner/redact.js +81 -5
- package/dist/runner/redact.js.map +1 -1
- package/dist/runner/runner.d.ts +28 -3
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +371 -54
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +10 -4
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/task-scheduler.d.ts +20 -0
- package/dist/runner/task-scheduler.d.ts.map +1 -1
- package/dist/runner/task-scheduler.js +34 -4
- package/dist/runner/task-scheduler.js.map +1 -1
- package/dist/runner/types.d.ts +51 -1
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js +26 -0
- package/dist/runner/types.js.map +1 -1
- package/dist/runner.d.ts +6 -6
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +5 -5
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +603 -6
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +156 -20
- package/dist/schemas.js.map +1 -1
- package/dist/services.d.ts +22 -5
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +41 -17
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +17 -4
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +48 -41
- package/dist/setup-guide.js.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +5 -1
- package/dist/tokens.js.map +1 -1
- package/dist/vocabulary.d.ts +21 -3
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +19 -3
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +73 -44
- package/docs/specs/plugins.md +40 -22
- package/docs/specs/records.md +113 -0
- package/docs/specs/rest.md +30 -21
- package/docs/specs/runner.md +46 -22
- package/package.json +11 -2
- package/skills/building-a-console/SKILL.md +4 -4
- package/skills/building-a-plugin/SKILL.md +6 -6
- package/skills/deploying-a-console/SKILL.md +4 -4
- package/skills/deploying-a-console/references/resources.md +41 -4
- package/skills/deploying-a-console/references/running-it-again.md +3 -2
- package/skills/keeping-a-desk/SKILL.md +133 -0
- package/skills/keeping-a-desk/collections.md +96 -0
- package/skills/planning-the-board/SKILL.md +14 -18
- package/skills/planning-the-board/references/a-task.md +2 -2
- package/skills/planning-the-board/references/project-rules.md +13 -14
- package/skills/planning-the-board/references/setting-up.md +15 -13
- package/skills/running-an-agent/SKILL.md +47 -56
- package/skills/working-the-board/SKILL.md +63 -44
- package/skills/working-the-board/references/terms.md +9 -5
- package/skills/working-the-board/references/the-pack.md +12 -10
- package/skills/working-the-board/references/the-sentence.md +2 -2
- package/src/agent-page.tsx +16 -2
- package/src/api.ts +109 -3
- package/src/charts.ts +250 -0
- package/src/cli/cli.ts +2226 -580
- package/src/cli/command-words.ts +56 -0
- package/src/cli/credentials.ts +181 -20
- package/src/cli/directory.ts +28 -10
- package/src/cli/format.ts +332 -49
- package/src/cli/help.ts +113 -57
- package/src/cli/machine-check.ts +223 -0
- package/src/cli/main.ts +72 -2
- package/src/cli/pack.ts +333 -372
- package/src/cli/plugin-check.ts +275 -34
- package/src/cli/plugin-cli.ts +28 -4
- package/src/cli/plugin-main.ts +1 -0
- package/src/cli/runner-host.ts +8 -0
- package/src/cli/secret-notes.ts +63 -0
- package/src/cli/serve.ts +295 -2
- package/src/client.ts +215 -177
- package/src/components/agent-page.tsx +1044 -281
- package/src/components/agents.tsx +9 -5
- package/src/components/board.tsx +3 -15
- package/src/components/categories.tsx +2 -2
- package/src/components/charts.tsx +680 -0
- package/src/components/decision-list.tsx +11 -7
- package/src/components/desk-records.tsx +724 -0
- package/src/components/desk.tsx +471 -0
- package/src/components/event-feed.tsx +12 -3
- package/src/components/goals.tsx +33 -25
- package/src/components/home.tsx +42 -6
- package/src/components/icon.tsx +337 -0
- package/src/components/markdown.tsx +22 -2
- package/src/components/people.tsx +1 -1
- package/src/components/plugin-frame.tsx +7 -0
- package/src/components/plugin-settings.tsx +171 -12
- package/src/components/projects.tsx +68 -17
- package/src/components/rules.tsx +94 -34
- package/src/components/sessions.tsx +2 -13
- package/src/components/setup.tsx +20 -5
- package/src/components/shell.tsx +3 -20
- package/src/components/tokens.tsx +1 -1
- package/src/components/ui.tsx +16 -8
- package/src/connect-page.tsx +1 -1
- package/src/console.tsx +104 -62
- package/src/data.ts +37 -34
- package/src/desk-page.tsx +332 -0
- package/src/desk-records-page.tsx +256 -0
- package/src/desk-records.ts +808 -0
- package/src/desk.ts +329 -0
- package/src/feed-stream.ts +144 -0
- package/src/home-tiles.ts +170 -46
- package/src/i18n/en.ts +323 -11
- package/src/i18n/ko.ts +378 -87
- package/src/i18n/particles.ts +79 -0
- package/src/icons/glyphs.ts +112 -0
- package/src/icons/index.ts +195 -0
- package/src/index.ts +125 -0
- package/src/limits.ts +20 -0
- package/src/marks.ts +12 -0
- package/src/onboarding.ts +14 -6
- package/src/plugin/context.ts +55 -12
- package/src/plugin/limits.ts +2 -0
- package/src/plugin/manifest.ts +38 -2
- package/src/plugin/rest-schemas.ts +41 -0
- package/src/plugin/sandbox.ts +4 -1
- package/src/plugin/testing.ts +63 -12
- package/src/plugin/web.ts +9 -2
- package/src/plugin.ts +2 -0
- package/src/records.ts +702 -0
- package/src/routes.ts +3 -1
- package/src/rules.ts +108 -47
- package/src/runner/acp.ts +49 -30
- package/src/runner/awake.ts +135 -0
- package/src/runner/claude.ts +131 -26
- package/src/runner/codex.ts +37 -26
- package/src/runner/config.ts +9 -0
- package/src/runner/desk.ts +200 -15
- package/src/runner/process.ts +11 -4
- package/src/runner/redact.ts +92 -6
- package/src/runner/runner.ts +457 -56
- package/src/runner/slack.ts +10 -4
- package/src/runner/task-scheduler.ts +36 -4
- package/src/runner/types.ts +67 -1
- package/src/runner.ts +27 -2
- package/src/schemas.ts +177 -18
- package/src/services.ts +55 -16
- package/src/setup-guide.ts +49 -40
- package/src/styles/README.md +16 -5
- package/src/styles/base.css +17 -0
- package/src/styles/console.css +10 -0
- package/src/styles/drawn-by-pages.json +1 -1
- package/src/styles/pages/agents.css +103 -1
- package/src/styles/pages/board.css +0 -10
- package/src/styles/pages/calendar.css +1 -1
- package/src/styles/pages/connect.css +0 -10
- package/src/styles/pages/decisions.css +3 -1
- package/src/styles/pages/desk.css +126 -0
- package/src/styles/pages/documents.css +5 -0
- package/src/styles/pages/feed.css +5 -2
- package/src/styles/pages/home.css +5 -0
- package/src/styles/pages/roadmap.css +2 -2
- package/src/styles/pages/settings.css +11 -0
- package/src/styles/pages/task.css +0 -20
- package/src/styles/pages/thread.css +1 -1
- package/src/styles/parts/bars.css +80 -0
- package/src/styles/parts/calendar.css +1 -1
- package/src/styles/parts/callout.css +1 -0
- package/src/styles/parts/chart.css +173 -0
- package/src/styles/parts/detail.css +22 -0
- package/src/styles/parts/empty.css +2 -0
- package/src/styles/parts/eyebrow.css +1 -1
- package/src/styles/parts/facts.css +1 -1
- package/src/styles/parts/figures.css +65 -0
- package/src/styles/parts/form.css +2 -1
- package/src/styles/parts/icon.css +191 -0
- package/src/styles/parts/input.css +14 -4
- package/src/styles/parts/legend.css +48 -0
- package/src/styles/parts/mark.css +36 -0
- package/src/styles/parts/menu.css +1 -7
- package/src/styles/parts/page.css +1 -1
- package/src/styles/parts/panel.css +10 -0
- package/src/styles/parts/person.css +5 -2
- package/src/styles/parts/progress.css +5 -2
- package/src/styles/parts/rows.css +1 -0
- package/src/styles/parts/series.css +32 -0
- package/src/styles/parts/settings.css +5 -0
- package/src/styles/parts/share.css +25 -0
- package/src/styles/parts/spark.css +23 -0
- package/src/styles/parts/stat.css +69 -0
- package/src/styles/tokens.css +31 -10
- package/src/tokens.ts +5 -1
- package/src/vocabulary.ts +25 -3
- package/template/desk-web/README.md +8 -0
- package/template/desk-web/index.html +13 -0
- package/template/desk-web/package.json +25 -0
- package/template/desk-web/src/main.tsx +24 -0
- package/template/desk-web/src/page.tsx +51 -0
- package/template/desk-web/tsconfig.json +16 -0
- package/template/desk-web/vite.config.ts +15 -0
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { MAX_SEARCH_LENGTH, type RestWorkBrief } from "../api.js";
|
|
3
|
+
import { dateOf } from "../dates.js";
|
|
4
|
+
import {
|
|
5
|
+
DESK_ENDINGS,
|
|
6
|
+
type DeskFigures,
|
|
7
|
+
type DeskProject,
|
|
8
|
+
type DeskRun,
|
|
9
|
+
type DeskTask,
|
|
10
|
+
standingOf,
|
|
11
|
+
} from "../desk.js";
|
|
12
|
+
import { useLanguage, useWords } from "../i18n/index.js";
|
|
13
|
+
import { BarList, Chart, Stat, Stats } from "./charts.js";
|
|
14
|
+
import { ShowMore, usePaged } from "./paged.js";
|
|
15
|
+
import { ProjectMark } from "./projects.js";
|
|
16
|
+
import { RunStatusBadge } from "./runs.js";
|
|
17
|
+
import { TaskList } from "./task-list.js";
|
|
18
|
+
import {
|
|
19
|
+
Badge,
|
|
20
|
+
Button,
|
|
21
|
+
CategoryBadge,
|
|
22
|
+
CopyButton,
|
|
23
|
+
cx,
|
|
24
|
+
EmptyState,
|
|
25
|
+
PersonChip,
|
|
26
|
+
StateBadge,
|
|
27
|
+
Time,
|
|
28
|
+
} from "./ui.js";
|
|
29
|
+
|
|
30
|
+
// The board's views of a desk's page (ADR-0116): what stands on the board now, the board's
|
|
31
|
+
// figures and the board's archive of one member's own work across their projects, beside the
|
|
32
|
+
// records' views (`desk-records.tsx`). Each takes its data as props and nothing from the
|
|
33
|
+
// network, and is built from the console's parts alone: rows, panes, badges, and the charts
|
|
34
|
+
// for the figures (ADR-0123). What people wrote is shown as text, never as HTML.
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The views of a desk's page, in the order its tabs stand: the records the desk keeps, then the
|
|
38
|
+
* member's work on the board, what stands there now, its figures and its archive.
|
|
39
|
+
*/
|
|
40
|
+
export const DESK_VIEWS = ["records", "now", "figures", "archive"] as const;
|
|
41
|
+
export type DeskView = (typeof DESK_VIEWS)[number];
|
|
42
|
+
|
|
43
|
+
/** The tabs of a desk: one per view, the current one marked. */
|
|
44
|
+
export function DeskViews(props: {
|
|
45
|
+
readonly view: DeskView;
|
|
46
|
+
readonly viewHref: (view: DeskView) => string;
|
|
47
|
+
}) {
|
|
48
|
+
const words = useWords().desk;
|
|
49
|
+
return (
|
|
50
|
+
<nav className="sc-subtabs sc-desk-views" aria-label={words.views.aria}>
|
|
51
|
+
{DESK_VIEWS.map((view) => (
|
|
52
|
+
<a
|
|
53
|
+
key={view}
|
|
54
|
+
className={cx("sc-tab", view === props.view && "sc-tab-current")}
|
|
55
|
+
href={props.viewHref(view)}
|
|
56
|
+
aria-current={view === props.view ? "page" : undefined}
|
|
57
|
+
>
|
|
58
|
+
{words.views[view]}
|
|
59
|
+
</a>
|
|
60
|
+
))}
|
|
61
|
+
</nav>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A week as a figure names it: from its first day to its last, without the year, which eight
|
|
67
|
+
* weeks in a row would say eight times.
|
|
68
|
+
*/
|
|
69
|
+
export function weekLabel(start: string, end: string, language?: string): string {
|
|
70
|
+
const from = dateOf(start);
|
|
71
|
+
const to = dateOf(end);
|
|
72
|
+
if (Number.isNaN(from.getTime()) || Number.isNaN(to.getTime())) {
|
|
73
|
+
return `${start} - ${end}`;
|
|
74
|
+
}
|
|
75
|
+
const format = new Intl.DateTimeFormat(language, { month: "short", day: "numeric" });
|
|
76
|
+
return typeof format.formatRange === "function"
|
|
77
|
+
? format.formatRange(from, to)
|
|
78
|
+
: `${format.format(from)} - ${format.format(to)}`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A week as a point of a chart names it: by its first day, short enough to stand under a
|
|
83
|
+
* column. The table beside the chart, or the heading over it, says that the points are weeks.
|
|
84
|
+
*/
|
|
85
|
+
export function weekStartLabel(start: string, language?: string): string {
|
|
86
|
+
const from = dateOf(start);
|
|
87
|
+
return Number.isNaN(from.getTime())
|
|
88
|
+
? start
|
|
89
|
+
: new Intl.DateTimeFormat(language, { month: "short", day: "numeric" }).format(from);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** A project as a row says it: its mark and its name. */
|
|
93
|
+
function ProjectName(props: { readonly project: DeskProject }) {
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
<ProjectMark project={props.project} size="sm" /> {props.project.name}
|
|
97
|
+
</>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** A run as a row: the task it is on, the project and the agent, how it stands and since when. */
|
|
102
|
+
function RunRow(props: {
|
|
103
|
+
readonly run: DeskRun;
|
|
104
|
+
readonly href: string;
|
|
105
|
+
/** Which moment the row says: when an open run was last heard from, or when one ended. */
|
|
106
|
+
readonly moment: "heard" | "ended";
|
|
107
|
+
}) {
|
|
108
|
+
const words = useWords();
|
|
109
|
+
const { project, run, title } = props.run;
|
|
110
|
+
return (
|
|
111
|
+
<li className="sc-task-row">
|
|
112
|
+
<a className="sc-task-row-title" href={props.href}>
|
|
113
|
+
<span className="sc-card-number">#{run.taskNumber}</span> {title ?? run.agent}
|
|
114
|
+
</a>
|
|
115
|
+
<span className="sc-task-row-project">
|
|
116
|
+
<ProjectName project={project} />
|
|
117
|
+
{title !== undefined && <> · {run.agent}</>}
|
|
118
|
+
</span>
|
|
119
|
+
<span className="sc-task-row-meta">
|
|
120
|
+
<RunStatusBadge status={run.status} />
|
|
121
|
+
{props.moment === "heard" ? (
|
|
122
|
+
<span className="sc-muted">
|
|
123
|
+
{words.runs.lastHeard} <Time iso={run.lastHeardAt} precision="clock" />
|
|
124
|
+
</span>
|
|
125
|
+
) : (
|
|
126
|
+
run.endedAt !== null && <Time iso={run.endedAt} precision="day" />
|
|
127
|
+
)}
|
|
128
|
+
</span>
|
|
129
|
+
</li>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface DeskStandingProps {
|
|
134
|
+
/** The open tasks the person works on, the sooner due first, as the plate answers them. */
|
|
135
|
+
readonly tasks: readonly DeskTask[];
|
|
136
|
+
/** The decisions that wait for the person's answer. */
|
|
137
|
+
readonly decisions: RestWorkBrief["decisions"];
|
|
138
|
+
/** The person's runs that are open. */
|
|
139
|
+
readonly runs: readonly DeskRun[];
|
|
140
|
+
/** The day to count due days from; the browser's today when left out. */
|
|
141
|
+
readonly today?: string | undefined;
|
|
142
|
+
readonly taskHref: (projectKey: string, taskNumber: number) => string;
|
|
143
|
+
readonly decisionHref: (projectKey: string, decisionId: string) => string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* What stands on the board now, what holds something up first: the decisions that wait for
|
|
148
|
+
* the person, since a run waits on each; then the runs that are open; then the open tasks by state.
|
|
149
|
+
*/
|
|
150
|
+
export function DeskStanding(props: DeskStandingProps) {
|
|
151
|
+
const words = useWords();
|
|
152
|
+
const desk = words.desk;
|
|
153
|
+
const projectOf = new Map(props.tasks.map((item) => [item.task.id, item.project]));
|
|
154
|
+
const groups = standingOf(props.tasks).filter((group) => group.tasks.length > 0);
|
|
155
|
+
return (
|
|
156
|
+
<div className="sc-desk-lists">
|
|
157
|
+
<section className="sc-task-section" aria-label={desk.now.decisions}>
|
|
158
|
+
<h2 className="sc-section-title">
|
|
159
|
+
{desk.now.decisions} <span className="sc-column-count">{props.decisions.length}</span>
|
|
160
|
+
</h2>
|
|
161
|
+
{props.decisions.length === 0 ? (
|
|
162
|
+
<p className="sc-muted">{words.work.noDecisions}</p>
|
|
163
|
+
) : (
|
|
164
|
+
<ul className="sc-task-rows" aria-label={desk.now.decisions}>
|
|
165
|
+
{props.decisions.map(({ project, decision }) => (
|
|
166
|
+
<li key={decision.id} className="sc-task-row">
|
|
167
|
+
<a
|
|
168
|
+
className="sc-task-row-title"
|
|
169
|
+
href={props.decisionHref(project.key, decision.id)}
|
|
170
|
+
>
|
|
171
|
+
{decision.question}
|
|
172
|
+
</a>
|
|
173
|
+
<span className="sc-task-row-project">
|
|
174
|
+
<ProjectName project={project} />
|
|
175
|
+
</span>
|
|
176
|
+
<span className="sc-task-row-meta">
|
|
177
|
+
<PersonChip person={decision.raisedBy} />
|
|
178
|
+
<Time iso={decision.createdAt} precision="day" />
|
|
179
|
+
</span>
|
|
180
|
+
</li>
|
|
181
|
+
))}
|
|
182
|
+
</ul>
|
|
183
|
+
)}
|
|
184
|
+
</section>
|
|
185
|
+
<section className="sc-task-section" aria-label={desk.now.runs}>
|
|
186
|
+
<h2 className="sc-section-title">
|
|
187
|
+
{desk.now.runs} <span className="sc-column-count">{props.runs.length}</span>
|
|
188
|
+
</h2>
|
|
189
|
+
{props.runs.length === 0 ? (
|
|
190
|
+
<p className="sc-muted">{desk.now.noRuns}</p>
|
|
191
|
+
) : (
|
|
192
|
+
<ul className="sc-task-rows" aria-label={desk.now.runs}>
|
|
193
|
+
{props.runs.map((run) => (
|
|
194
|
+
<RunRow
|
|
195
|
+
key={run.run.id}
|
|
196
|
+
run={run}
|
|
197
|
+
href={props.taskHref(run.project.key, run.run.taskNumber)}
|
|
198
|
+
moment="heard"
|
|
199
|
+
/>
|
|
200
|
+
))}
|
|
201
|
+
</ul>
|
|
202
|
+
)}
|
|
203
|
+
</section>
|
|
204
|
+
{groups.map((group) => (
|
|
205
|
+
<section
|
|
206
|
+
key={group.state}
|
|
207
|
+
className="sc-task-section"
|
|
208
|
+
aria-label={words.vocabulary.state[group.state]}
|
|
209
|
+
>
|
|
210
|
+
<h2 className="sc-section-title">
|
|
211
|
+
{words.vocabulary.state[group.state]}{" "}
|
|
212
|
+
<span className="sc-column-count">{group.tasks.length}</span>
|
|
213
|
+
</h2>
|
|
214
|
+
<TaskList
|
|
215
|
+
tasks={group.tasks.map((item) => item.task)}
|
|
216
|
+
taskHref={(task) => props.taskHref(projectOf.get(task.id)?.key ?? "", task.number)}
|
|
217
|
+
projectOf={(task) => {
|
|
218
|
+
const project = projectOf.get(task.id);
|
|
219
|
+
return project === undefined ? undefined : <ProjectName project={project} />;
|
|
220
|
+
}}
|
|
221
|
+
today={props.today}
|
|
222
|
+
/>
|
|
223
|
+
</section>
|
|
224
|
+
))}
|
|
225
|
+
</div>
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface DeskFiguresViewProps {
|
|
230
|
+
readonly figures: DeskFigures;
|
|
231
|
+
/**
|
|
232
|
+
* Where a project had more than a visit reads: how many tasks and runs of each were counted,
|
|
233
|
+
* said under the figures so that nobody reads them as the whole.
|
|
234
|
+
*/
|
|
235
|
+
readonly partial?: { readonly tasks: number; readonly runs: number } | undefined;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* The figures of the weeks counted, the few that matter first: how many tasks were done and
|
|
240
|
+
* how the runs ended, a number each; then what was done week by week, as one chart; then the
|
|
241
|
+
* same by project and by category, each as bars with its figure in words beside it. Where
|
|
242
|
+
* nothing was closed in those weeks the view says what would be counted, and draws no axis.
|
|
243
|
+
*/
|
|
244
|
+
export function DeskFiguresView(props: DeskFiguresViewProps) {
|
|
245
|
+
const words = useWords();
|
|
246
|
+
const figures = words.desk.figures;
|
|
247
|
+
const { tag } = useLanguage();
|
|
248
|
+
const { weeks, runs, byProject, byCategory, done } = props.figures;
|
|
249
|
+
const ended = DESK_ENDINGS.reduce((sum, ending) => sum + runs[ending], 0);
|
|
250
|
+
const partial = props.partial !== undefined && (
|
|
251
|
+
<p className="sc-muted">{figures.partial(props.partial.tasks, props.partial.runs)}</p>
|
|
252
|
+
);
|
|
253
|
+
if (done === 0 && ended === 0) {
|
|
254
|
+
return (
|
|
255
|
+
<div className="sc-desk-figures">
|
|
256
|
+
<EmptyState title={figures.empty.title} body={figures.empty.body(weeks.length)} />
|
|
257
|
+
{partial}
|
|
258
|
+
</div>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
return (
|
|
262
|
+
<div className="sc-desk-figures">
|
|
263
|
+
<section className="sc-task-section" aria-label={figures.lead(weeks.length)}>
|
|
264
|
+
<h2 className="sc-section-title">{figures.lead(weeks.length)}</h2>
|
|
265
|
+
{/* The endings are told apart by their names: a colour each would say good and bad
|
|
266
|
+
where the tones already do. */}
|
|
267
|
+
<Stats label={figures.lead(weeks.length)}>
|
|
268
|
+
<Stat label={figures.tasksDone} value={done.toLocaleString(tag)} />
|
|
269
|
+
{DESK_ENDINGS.map((ending) => (
|
|
270
|
+
<Stat
|
|
271
|
+
key={ending}
|
|
272
|
+
label={figures.ended[ending]}
|
|
273
|
+
value={runs[ending].toLocaleString(tag)}
|
|
274
|
+
/>
|
|
275
|
+
))}
|
|
276
|
+
</Stats>
|
|
277
|
+
</section>
|
|
278
|
+
<section className="sc-task-section" aria-label={figures.weeks}>
|
|
279
|
+
<h2 className="sc-section-title">{figures.weeks}</h2>
|
|
280
|
+
<Chart
|
|
281
|
+
title={figures.weeks}
|
|
282
|
+
language={tag}
|
|
283
|
+
points={weeks.map((week) => weekStartLabel(week.start, tag))}
|
|
284
|
+
// No task done in these weeks is a sentence, never columns of nothing over an axis.
|
|
285
|
+
series={[
|
|
286
|
+
{
|
|
287
|
+
name: words.vocabulary.state.done,
|
|
288
|
+
values: weeks.map((week) => (done === 0 ? undefined : week.done)),
|
|
289
|
+
},
|
|
290
|
+
]}
|
|
291
|
+
empty={figures.none}
|
|
292
|
+
/>
|
|
293
|
+
</section>
|
|
294
|
+
<div className="sc-desk-pair">
|
|
295
|
+
<section className="sc-panel" aria-label={figures.byProject}>
|
|
296
|
+
<h2 className="sc-section-title">{figures.byProject}</h2>
|
|
297
|
+
{byProject.length === 0 ? (
|
|
298
|
+
<p className="sc-muted">{figures.none}</p>
|
|
299
|
+
) : (
|
|
300
|
+
<BarList
|
|
301
|
+
label={figures.byProject}
|
|
302
|
+
language={tag}
|
|
303
|
+
rows={byProject.map((row) => ({
|
|
304
|
+
id: row.project.key,
|
|
305
|
+
label: <ProjectName project={row.project} />,
|
|
306
|
+
value: row.done,
|
|
307
|
+
words: `${figures.done(row.done)} · ${figures.runsCount(row.runs)}`,
|
|
308
|
+
}))}
|
|
309
|
+
/>
|
|
310
|
+
)}
|
|
311
|
+
</section>
|
|
312
|
+
<section className="sc-panel" aria-label={figures.byCategory}>
|
|
313
|
+
<h2 className="sc-section-title">{figures.byCategory}</h2>
|
|
314
|
+
{byCategory.length === 0 ? (
|
|
315
|
+
<p className="sc-muted">{figures.none}</p>
|
|
316
|
+
) : (
|
|
317
|
+
<BarList
|
|
318
|
+
label={figures.byCategory}
|
|
319
|
+
language={tag}
|
|
320
|
+
rows={byCategory.map((row) => ({
|
|
321
|
+
id: row.category?.key ?? "",
|
|
322
|
+
label:
|
|
323
|
+
row.category === null ? (
|
|
324
|
+
figures.noCategory
|
|
325
|
+
) : (
|
|
326
|
+
<CategoryBadge category={row.category} />
|
|
327
|
+
),
|
|
328
|
+
value: row.done,
|
|
329
|
+
words: figures.done(row.done),
|
|
330
|
+
}))}
|
|
331
|
+
/>
|
|
332
|
+
)}
|
|
333
|
+
</section>
|
|
334
|
+
</div>
|
|
335
|
+
{partial}
|
|
336
|
+
</div>
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface DeskArchiveProps {
|
|
341
|
+
/** The tasks the person worked on that are done, dropped or put away, the last closed first. */
|
|
342
|
+
readonly tasks: readonly DeskTask[];
|
|
343
|
+
/** The person's runs that ended, the last ended first. */
|
|
344
|
+
readonly runs: readonly DeskRun[];
|
|
345
|
+
/** The words the lists were found by; none for everything. */
|
|
346
|
+
readonly query?: string | undefined;
|
|
347
|
+
readonly busy?: boolean | undefined;
|
|
348
|
+
readonly onSearch: (words: string) => void;
|
|
349
|
+
/** Whether the console has more than was read, and the way to read the next page of it. */
|
|
350
|
+
readonly more?: boolean | undefined;
|
|
351
|
+
readonly onMore?: (() => void) | undefined;
|
|
352
|
+
readonly taskHref: (projectKey: string, taskNumber: number) => string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/** The archive: the person's closed tasks and ended runs, found by words, a page at a time. */
|
|
356
|
+
export function DeskArchive(props: DeskArchiveProps) {
|
|
357
|
+
const words = useWords();
|
|
358
|
+
const archive = words.desk.archive;
|
|
359
|
+
const [query, setQuery] = useState(props.query ?? "");
|
|
360
|
+
const tasks = usePaged(props.tasks);
|
|
361
|
+
const runs = usePaged(props.runs);
|
|
362
|
+
const found = props.query !== undefined && props.query.length > 0;
|
|
363
|
+
return (
|
|
364
|
+
<div className="sc-desk-archive">
|
|
365
|
+
<form
|
|
366
|
+
className="sc-desk-search"
|
|
367
|
+
aria-label={archive.search}
|
|
368
|
+
onSubmit={(event) => {
|
|
369
|
+
event.preventDefault();
|
|
370
|
+
props.onSearch(query.trim());
|
|
371
|
+
}}
|
|
372
|
+
>
|
|
373
|
+
<input
|
|
374
|
+
className="sc-input"
|
|
375
|
+
type="search"
|
|
376
|
+
placeholder={archive.placeholder}
|
|
377
|
+
aria-label={archive.search}
|
|
378
|
+
maxLength={MAX_SEARCH_LENGTH}
|
|
379
|
+
value={query}
|
|
380
|
+
onChange={(event) => setQuery(event.target.value)}
|
|
381
|
+
/>
|
|
382
|
+
<Button type="submit" size="sm" disabled={props.busy === true}>
|
|
383
|
+
{archive.find}
|
|
384
|
+
</Button>
|
|
385
|
+
</form>
|
|
386
|
+
{props.tasks.length === 0 && props.runs.length === 0 ? (
|
|
387
|
+
<p className="sc-muted">{found ? archive.nothingFound : archive.nothing}</p>
|
|
388
|
+
) : (
|
|
389
|
+
<div className="sc-desk-lists">
|
|
390
|
+
<section className="sc-task-section" aria-label={archive.tasks}>
|
|
391
|
+
<h2 className="sc-section-title">
|
|
392
|
+
{archive.tasks} <span className="sc-column-count">{props.tasks.length}</span>
|
|
393
|
+
</h2>
|
|
394
|
+
<ul className="sc-task-rows" aria-label={archive.tasks}>
|
|
395
|
+
{tasks.shown.map(({ project, task }) => (
|
|
396
|
+
<li key={task.id} className="sc-task-row">
|
|
397
|
+
<a className="sc-task-row-title" href={props.taskHref(project.key, task.number)}>
|
|
398
|
+
<span className="sc-card-number">#{task.number}</span> {task.title}
|
|
399
|
+
</a>
|
|
400
|
+
<span className="sc-task-row-project">
|
|
401
|
+
<ProjectName project={project} />
|
|
402
|
+
</span>
|
|
403
|
+
<span className="sc-task-row-meta">
|
|
404
|
+
{task.category !== null && <CategoryBadge category={task.category} />}
|
|
405
|
+
<StateBadge state={task.state} />
|
|
406
|
+
{task.archivedAt !== null && <Badge>{archive.putAway}</Badge>}
|
|
407
|
+
<Time iso={task.archivedAt ?? task.doneAt ?? task.updatedAt} precision="day" />
|
|
408
|
+
</span>
|
|
409
|
+
</li>
|
|
410
|
+
))}
|
|
411
|
+
</ul>
|
|
412
|
+
<ShowMore rest={tasks.rest} onMore={tasks.more} />
|
|
413
|
+
</section>
|
|
414
|
+
<section className="sc-task-section" aria-label={archive.runs}>
|
|
415
|
+
<h2 className="sc-section-title">
|
|
416
|
+
{archive.runs} <span className="sc-column-count">{props.runs.length}</span>
|
|
417
|
+
</h2>
|
|
418
|
+
<ul className="sc-task-rows" aria-label={archive.runs}>
|
|
419
|
+
{runs.shown.map((run) => (
|
|
420
|
+
<RunRow
|
|
421
|
+
key={run.run.id}
|
|
422
|
+
run={run}
|
|
423
|
+
href={props.taskHref(run.project.key, run.run.taskNumber)}
|
|
424
|
+
moment="ended"
|
|
425
|
+
/>
|
|
426
|
+
))}
|
|
427
|
+
</ul>
|
|
428
|
+
<ShowMore rest={runs.rest} onMore={runs.more} />
|
|
429
|
+
</section>
|
|
430
|
+
</div>
|
|
431
|
+
)}
|
|
432
|
+
{props.more === true && props.onMore !== undefined && (
|
|
433
|
+
<div className="sc-show-more">
|
|
434
|
+
<Button
|
|
435
|
+
variant="secondary"
|
|
436
|
+
size="sm"
|
|
437
|
+
disabled={props.busy === true}
|
|
438
|
+
onClick={props.onMore}
|
|
439
|
+
>
|
|
440
|
+
{archive.older}
|
|
441
|
+
</Button>
|
|
442
|
+
</div>
|
|
443
|
+
)}
|
|
444
|
+
</div>
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export interface DeskWordsProps {
|
|
449
|
+
/** The console's origin, which the words name for the agent to connect to. */
|
|
450
|
+
readonly origin: string;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* A desk of a person's own, on the Agents page (ADR-0121, ADR-0122): a title, one line, and
|
|
455
|
+
* what to tell an agent, copied whole as the words for connecting an agent are above it.
|
|
456
|
+
* Nothing stands after the block: what follows the install is the command's to say.
|
|
457
|
+
*/
|
|
458
|
+
export function DeskWords(props: DeskWordsProps) {
|
|
459
|
+
const words = useWords().desk.command;
|
|
460
|
+
const quote = words.quote(props.origin);
|
|
461
|
+
return (
|
|
462
|
+
<section className="sc-panel sc-desk-command" aria-label={words.title}>
|
|
463
|
+
<h2 className="sc-section-title">{words.title}</h2>
|
|
464
|
+
<p>{words.line}</p>
|
|
465
|
+
<div className="sc-copyable">
|
|
466
|
+
<pre className="sc-code">{quote}</pre>
|
|
467
|
+
<CopyButton text={quote} size="sm" />
|
|
468
|
+
</div>
|
|
469
|
+
</section>
|
|
470
|
+
);
|
|
471
|
+
}
|
|
@@ -27,7 +27,11 @@ function sentenceOf(event: RestEvent, words: Messages): string {
|
|
|
27
27
|
: `#${data.number}${data.title === undefined ? "" : ` ${data.title}`}`;
|
|
28
28
|
const project = data.name ?? data.key ?? feed.aProject;
|
|
29
29
|
const changed = (data.fields ?? []).map((field) => feed.field[field] ?? field);
|
|
30
|
-
|
|
30
|
+
// A keyed secret's value is named with the key it is kept under (ADR-0111).
|
|
31
|
+
const fields =
|
|
32
|
+
changed.length === 0
|
|
33
|
+
? feed.something
|
|
34
|
+
: `${changed.join(", ")}${data.under === undefined ? "" : ` (${data.under})`}`;
|
|
31
35
|
const page = feed.thePage(data.title ?? data.path ?? "");
|
|
32
36
|
const role = (value: string | undefined): string =>
|
|
33
37
|
value === "admin"
|
|
@@ -250,7 +254,7 @@ function formatClock(iso: string, language: string): string {
|
|
|
250
254
|
const date = new Date(iso);
|
|
251
255
|
return Number.isNaN(date.getTime())
|
|
252
256
|
? iso
|
|
253
|
-
: date.toLocaleTimeString(language, { hour: "
|
|
257
|
+
: date.toLocaleTimeString(language, { hour: "numeric", minute: "2-digit" });
|
|
254
258
|
}
|
|
255
259
|
|
|
256
260
|
type FeedRun = { readonly actor: RestEvent; readonly events: RestEvent[] };
|
|
@@ -282,7 +286,12 @@ export function EventFeed(props: EventFeedProps) {
|
|
|
282
286
|
const newestFirst = [...props.events].reverse();
|
|
283
287
|
const { shown, rest, more } = usePaged(newestFirst);
|
|
284
288
|
if (props.events.length === 0) {
|
|
285
|
-
|
|
289
|
+
// Named as the feed with events is, so that a feed with nothing in it is still found.
|
|
290
|
+
return (
|
|
291
|
+
<section className="sc-feed" aria-label={words.feed.list}>
|
|
292
|
+
{props.empty ?? null}
|
|
293
|
+
</section>
|
|
294
|
+
);
|
|
286
295
|
}
|
|
287
296
|
return (
|
|
288
297
|
<>
|
package/src/components/goals.tsx
CHANGED
|
@@ -234,6 +234,8 @@ export interface GoalViewProps {
|
|
|
234
234
|
/** Where a document of the project is read, by its path, for the links in what was written. */
|
|
235
235
|
readonly docHref?: ((path: string) => string) | undefined;
|
|
236
236
|
readonly today?: string | undefined;
|
|
237
|
+
/** Where every goal of the project is: the way back, over the title. */
|
|
238
|
+
readonly allHref?: string | undefined;
|
|
237
239
|
/** Where the goal is changed; left out, it cannot be changed from here. */
|
|
238
240
|
readonly editHref?: string | undefined;
|
|
239
241
|
/** Called when an owner moves the goal to another state from here. */
|
|
@@ -287,14 +289,39 @@ export function GoalView(props: GoalViewProps) {
|
|
|
287
289
|
<div className="sc-goal-page">
|
|
288
290
|
<header className="sc-goal-header">
|
|
289
291
|
<div className="sc-task-header">
|
|
290
|
-
<
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
<DueBadge dueOn={goal.dueOn} state={dueState(goal)} today={props.today} />
|
|
292
|
+
<div className="sc-task-heading">
|
|
293
|
+
{props.allHref !== undefined && (
|
|
294
|
+
<p className="sc-task-parent">
|
|
295
|
+
<a href={props.allHref}>{roadmap.all}</a>
|
|
296
|
+
</p>
|
|
296
297
|
)}
|
|
298
|
+
<h1 className="sc-task-title">{goal.title}</h1>
|
|
299
|
+
<div className="sc-task-badges">
|
|
300
|
+
{goal.category !== null && <CategoryBadge category={goal.category} />}
|
|
301
|
+
<GoalStateBadge state={goal.state} />
|
|
302
|
+
{goal.dueOn !== null && (
|
|
303
|
+
<DueBadge dueOn={goal.dueOn} state={dueState(goal)} today={props.today} />
|
|
304
|
+
)}
|
|
305
|
+
</div>
|
|
297
306
|
</div>
|
|
307
|
+
{(props.editHref !== undefined || props.onArchiveTasks !== undefined) && (
|
|
308
|
+
<div className="sc-task-actions">
|
|
309
|
+
{props.editHref !== undefined && (
|
|
310
|
+
<a className="sc-button sc-button-secondary" href={props.editHref}>
|
|
311
|
+
{words.common.edit}
|
|
312
|
+
</a>
|
|
313
|
+
)}
|
|
314
|
+
{props.onArchiveTasks !== undefined && (
|
|
315
|
+
<Button
|
|
316
|
+
variant="secondary"
|
|
317
|
+
disabled={props.busy === true}
|
|
318
|
+
onClick={props.onArchiveTasks}
|
|
319
|
+
>
|
|
320
|
+
{roadmap.archiveTasks}
|
|
321
|
+
</Button>
|
|
322
|
+
)}
|
|
323
|
+
</div>
|
|
324
|
+
)}
|
|
298
325
|
</div>
|
|
299
326
|
<div className="sc-goal-progress">
|
|
300
327
|
<ProgressBar counts={goal.taskCounts} />
|
|
@@ -361,25 +388,6 @@ export function GoalView(props: GoalViewProps) {
|
|
|
361
388
|
<Time iso={goal.createdAt} />
|
|
362
389
|
</dd>
|
|
363
390
|
</div>
|
|
364
|
-
{props.editHref !== undefined && (
|
|
365
|
-
<div>
|
|
366
|
-
<a className="sc-button sc-button-secondary sc-button-sm" href={props.editHref}>
|
|
367
|
-
{words.common.edit}
|
|
368
|
-
</a>
|
|
369
|
-
</div>
|
|
370
|
-
)}
|
|
371
|
-
{props.onArchiveTasks !== undefined && (
|
|
372
|
-
<div>
|
|
373
|
-
<Button
|
|
374
|
-
variant="secondary"
|
|
375
|
-
size="sm"
|
|
376
|
-
disabled={props.busy === true}
|
|
377
|
-
onClick={props.onArchiveTasks}
|
|
378
|
-
>
|
|
379
|
-
{roadmap.archiveTasks}
|
|
380
|
-
</Button>
|
|
381
|
-
</div>
|
|
382
|
-
)}
|
|
383
391
|
</dl>
|
|
384
392
|
{goal.body.length > 0 && (
|
|
385
393
|
<details className="sc-goal-about">
|