@skillre/dsh-plugin-work-dashboard 0.0.0-stage → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +259 -0
  3. package/README.md +371 -2
  4. package/UNINSTALL.md +7 -0
  5. package/compatibility.json +195 -0
  6. package/cordis.patch.yml +24 -0
  7. package/docs/DESIGN-0.3.md +122 -0
  8. package/docs/DETAIL.md +1 -0
  9. package/docs/DETAIL.zh.md +1 -0
  10. package/docs/PLAN-0.7-0.9.md +230 -0
  11. package/docs/preview.svg +254 -0
  12. package/docs/preview.zh.svg +254 -0
  13. package/icon.svg +17 -0
  14. package/lib/blockers.d.ts +45 -0
  15. package/lib/blockers.js +160 -0
  16. package/lib/client/api.d.ts +42 -0
  17. package/lib/client/api.js +45 -0
  18. package/lib/client/contracts.d.ts +94 -0
  19. package/lib/client/contracts.js +21 -0
  20. package/lib/client/css/base.d.ts +31 -0
  21. package/lib/client/css/base.js +461 -0
  22. package/lib/client/css/blockers.d.ts +18 -0
  23. package/lib/client/css/blockers.js +196 -0
  24. package/lib/client/css/charts.d.ts +14 -0
  25. package/lib/client/css/charts.js +191 -0
  26. package/lib/client/css/detail.d.ts +21 -0
  27. package/lib/client/css/detail.js +423 -0
  28. package/lib/client/css/insights.d.ts +27 -0
  29. package/lib/client/css/insights.js +660 -0
  30. package/lib/client/css/overview.d.ts +23 -0
  31. package/lib/client/css/overview.js +327 -0
  32. package/lib/client/css/summary.d.ts +13 -0
  33. package/lib/client/css/summary.js +187 -0
  34. package/lib/client/format.d.ts +57 -0
  35. package/lib/client/format.js +96 -0
  36. package/lib/client/preferences.d.ts +56 -0
  37. package/lib/client/preferences.js +118 -0
  38. package/lib/client/styles.d.ts +17 -0
  39. package/lib/client/styles.js +24 -0
  40. package/lib/client/text.d.ts +32 -0
  41. package/lib/client/text.js +1112 -0
  42. package/lib/client/view-contract.d.ts +118 -0
  43. package/lib/client/view-contract.js +28 -0
  44. package/lib/client.js +6599 -0
  45. package/lib/config.d.ts +61 -0
  46. package/lib/config.js +67 -0
  47. package/lib/form.d.ts +218 -0
  48. package/lib/form.js +1075 -0
  49. package/lib/gap.d.ts +60 -0
  50. package/lib/gap.js +227 -0
  51. package/lib/index.d.ts +40 -0
  52. package/lib/index.js +159 -0
  53. package/lib/repo.d.ts +124 -0
  54. package/lib/repo.js +407 -0
  55. package/lib/risks.d.ts +24 -0
  56. package/lib/risks.js +85 -0
  57. package/lib/skill.d.ts +94 -0
  58. package/lib/skill.js +220 -0
  59. package/lib/store.d.ts +63 -0
  60. package/lib/store.js +505 -0
  61. package/lib/timeline.d.ts +23 -0
  62. package/lib/timeline.js +93 -0
  63. package/lib/transport.d.ts +67 -0
  64. package/lib/transport.js +131 -0
  65. package/lib/types.d.ts +701 -0
  66. package/lib/types.js +78 -0
  67. package/locale/en.json +7 -0
  68. package/locale/zh.json +7 -0
  69. package/package.json +117 -4
  70. package/skills/poc-export/SKILL.md +81 -0
  71. package/skills/poc-export/scripts/export-form.mjs +654 -0
  72. package/skills/poc-ledger/SKILL.md +171 -0
  73. package/skills/poc-submit/SKILL.md +186 -0
@@ -0,0 +1,118 @@
1
+ /**
2
+ * The view contract between the shell and the three view modules.
3
+ *
4
+ * The shell owns every piece of page state — snapshot, filters, sort, view mode,
5
+ * keyboard selection — and each view module owns exactly one rendering surface.
6
+ * Both sides import these types, so a prop rename breaks the build instead of
7
+ * silently rendering an empty card.
8
+ *
9
+ * The shell passes the project list ALREADY filtered and sorted. A view never
10
+ * re-filters: if the cards say "12 projects" and the table says "12 projects",
11
+ * that has to be the same twelve, computed once.
12
+ */
13
+ import type { BlockerRow, GapItem, PortfolioAnalysis, ProjectDetail, ProjectSummary, RiskBoard, GlobalTimeline, Snapshot, SortKey, StageId, ViewMode } from '../types.js';
14
+ import type { Translate } from './text.js';
15
+ /** The filter dimensions the toolbar exposes. `null` means "not filtered". */
16
+ export interface ActiveFilters {
17
+ system: string | null;
18
+ company: string | null;
19
+ /** A `StageId`, or the sentinels `closed` / `unknown`. */
20
+ stage: string | null;
21
+ status: string | null;
22
+ pocType: string | null;
23
+ }
24
+ /** The empty filter state: everything visible. */
25
+ export declare const NO_FILTERS: ActiveFilters;
26
+ /** How many filter dimensions are currently narrowing the list. */
27
+ export declare function activeFilterCount(filters: ActiveFilters): number;
28
+ /** `true` when no filter is set. */
29
+ export declare function filtersAreEmpty(filters: ActiveFilters): boolean;
30
+ /**
31
+ * A value the toolbar can offer for one filter dimension.
32
+ *
33
+ * `value` is what goes into {@link ActiveFilters}; `label` is what the chip
34
+ * shows; `count` is how many projects currently carry it, so an option that
35
+ * would produce an empty list can be shown as such instead of disappearing.
36
+ */
37
+ export interface FilterOption {
38
+ value: string;
39
+ label: string;
40
+ count: number;
41
+ }
42
+ /** Every option the toolbar offers, derived once from the snapshot. */
43
+ export interface FilterOptions {
44
+ system: FilterOption[];
45
+ company: FilterOption[];
46
+ stage: FilterOption[];
47
+ status: FilterOption[];
48
+ pocType: FilterOption[];
49
+ }
50
+ /** The props the shell hands to the overview surface. */
51
+ export interface OverviewProps {
52
+ snapshot: Snapshot;
53
+ /** Already filtered and sorted by the shell. */
54
+ projects: ProjectSummary[];
55
+ /** Gaps belonging to {@link projects}, in the shell's order. */
56
+ gaps: GapItem[];
57
+ analysis: PortfolioAnalysis;
58
+ filters: ActiveFilters;
59
+ viewMode: ViewMode;
60
+ sortKey: SortKey;
61
+ sortAsc: boolean;
62
+ /** The keyboard-selected project id, or `null`. */
63
+ selectedId: string | null;
64
+ locale: string;
65
+ t: Translate;
66
+ /** True when the snapshot has projects but the filters hide all of them. */
67
+ filteredOut: boolean;
68
+ onOpen(pocId: string): void;
69
+ /** Click a chart segment: apply that filter dimension, or clear it if equal. */
70
+ onFilter(next: Partial<ActiveFilters>): void;
71
+ onClearFilters(): void;
72
+ onViewMode(next: ViewMode): void;
73
+ onSort(next: SortKey): void;
74
+ }
75
+ /** The props the shell hands to the detail surface. */
76
+ export interface DetailProps {
77
+ detail: ProjectDetail;
78
+ /** Gaps of this project only. */
79
+ gaps: GapItem[];
80
+ /**
81
+ * This project's blocker rows, taken from the portfolio board.
82
+ *
83
+ * Passed in rather than recomputed so the detail worklist and the overview
84
+ * panel can never disagree about what a project is missing. `null` when the
85
+ * caller has no board (a detail opened before the first snapshot).
86
+ */
87
+ blockers: BlockerRow[] | null;
88
+ locale: string;
89
+ t: Translate;
90
+ /** Position within the shell's current list, for the prev/next affordance. */
91
+ position: {
92
+ index: number;
93
+ total: number;
94
+ };
95
+ /** `null` when the neighbour does not exist. */
96
+ onPrev: (() => void) | null;
97
+ onNext: (() => void) | null;
98
+ onBack(): void;
99
+ /** Jump to another project by id (used by the gap list cross-links). */
100
+ onOpen(pocId: string): void;
101
+ }
102
+ /** The props the shell hands to the risk board. */
103
+ export interface RiskBoardProps {
104
+ board: RiskBoard;
105
+ t: Translate;
106
+ onBack(): void;
107
+ onOpenProject(pocId: string): void;
108
+ }
109
+ /** The props the shell hands to the global timeline. */
110
+ export interface TimelineProps {
111
+ timeline: GlobalTimeline;
112
+ locale: string;
113
+ t: Translate;
114
+ onBack(): void;
115
+ onOpenProject(pocId: string): void;
116
+ }
117
+ /** Re-export the stage sentinels the board column uses. */
118
+ export type StageBucketKey = StageId | 'closed' | 'unknown';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The view contract between the shell and the three view modules.
3
+ *
4
+ * The shell owns every piece of page state — snapshot, filters, sort, view mode,
5
+ * keyboard selection — and each view module owns exactly one rendering surface.
6
+ * Both sides import these types, so a prop rename breaks the build instead of
7
+ * silently rendering an empty card.
8
+ *
9
+ * The shell passes the project list ALREADY filtered and sorted. A view never
10
+ * re-filters: if the cards say "12 projects" and the table says "12 projects",
11
+ * that has to be the same twelve, computed once.
12
+ */
13
+ /** The empty filter state: everything visible. */
14
+ export const NO_FILTERS = Object.freeze({
15
+ system: null,
16
+ company: null,
17
+ stage: null,
18
+ status: null,
19
+ pocType: null,
20
+ });
21
+ /** How many filter dimensions are currently narrowing the list. */
22
+ export function activeFilterCount(filters) {
23
+ return Object.values(filters).filter((value) => value !== null).length;
24
+ }
25
+ /** `true` when no filter is set. */
26
+ export function filtersAreEmpty(filters) {
27
+ return activeFilterCount(filters) === 0;
28
+ }