@gaia-ai/addon-gaia-ui 0.13.1 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/src/Component/footer-actions/index.js +4 -2
  2. package/dist/src/Component/list-chrome/index.js +1 -2
  3. package/dist/src/Component/markdown/index.d.ts +5 -0
  4. package/dist/src/Component/markdown/index.js +15 -0
  5. package/dist/src/Component/section-list/index.d.ts +1 -1
  6. package/dist/src/Component/section-list/index.js +1 -1
  7. package/dist/src/Component/stats-panel/index.js +2 -2
  8. package/dist/src/Component/team-member-workload-list/index.d.ts +9 -0
  9. package/dist/src/Component/team-member-workload-list/index.js +31 -0
  10. package/dist/src/Component/top-tabs/index.d.ts +8 -306
  11. package/dist/src/Component/top-tabs/index.js +12 -263
  12. package/dist/src/Component/work-ticket-list/index.d.ts +19 -0
  13. package/dist/src/Component/work-ticket-list/index.js +14 -0
  14. package/dist/src/Component/workload-summary/index.d.ts +3 -0
  15. package/dist/src/Component/workload-summary/index.js +12 -0
  16. package/dist/src/Data/session-store.d.ts +17 -0
  17. package/dist/src/Data/session-store.js +93 -0
  18. package/dist/src/Entity/collection.d.ts +3 -0
  19. package/dist/src/Entity/collection.js +1 -0
  20. package/dist/src/Entity/conductor/Screen/conductors.d.ts +6 -18
  21. package/dist/src/Entity/conductor/Screen/conductors.js +31 -42
  22. package/dist/src/Entity/conductor/Screen/project-conductors.d.ts +6 -18
  23. package/dist/src/Entity/conductor/Screen/project-conductors.js +37 -43
  24. package/dist/src/Entity/project/Data/workload.d.ts +16 -0
  25. package/dist/src/Entity/project/Data/workload.js +70 -0
  26. package/dist/src/Entity/project/Screen/project-overview.d.ts +34 -0
  27. package/dist/src/Entity/project/Screen/project-overview.js +76 -0
  28. package/dist/src/Entity/project/Screen/project-picker.d.ts +4 -4
  29. package/dist/src/Entity/project/Screen/project-picker.js +3 -5
  30. package/dist/src/Entity/project/Screen/project-work.d.ts +33 -0
  31. package/dist/src/Entity/project/Screen/project-work.js +114 -0
  32. package/dist/src/Entity/project/Screen/projects-screen.d.ts +1 -5
  33. package/dist/src/Entity/project/Screen/projects-screen.js +3 -5
  34. package/dist/src/Entity/run/Data/query.d.ts +7 -3
  35. package/dist/src/Entity/run/Data/query.js +10 -3
  36. package/dist/src/Entity/run/Data/runs.d.ts +2 -0
  37. package/dist/src/Entity/run/Data/runs.js +26 -1
  38. package/dist/src/Entity/run/Screen/run-detail.d.ts +0 -1
  39. package/dist/src/Entity/run/Screen/run-detail.js +1 -4
  40. package/dist/src/Entity/run/Screen/runs.d.ts +1 -6
  41. package/dist/src/Entity/run/Screen/runs.js +3 -7
  42. package/dist/src/Entity/run/Screen/user-runs.d.ts +18 -17
  43. package/dist/src/Entity/run/Screen/user-runs.js +35 -21
  44. package/dist/src/Entity/team/Data/projects.d.ts +3 -0
  45. package/dist/src/Entity/team/Data/projects.js +22 -0
  46. package/dist/src/Entity/team/Data/workload.d.ts +23 -0
  47. package/dist/src/Entity/team/Data/workload.js +58 -0
  48. package/dist/src/Entity/team/Screen/team-member-work.d.ts +41 -0
  49. package/dist/src/Entity/team/Screen/team-member-work.js +56 -0
  50. package/dist/src/Entity/team/Screen/team-users.d.ts +2 -15
  51. package/dist/src/Entity/team/Screen/team-users.js +55 -92
  52. package/dist/src/Entity/team/Screen/team-work.d.ts +28 -0
  53. package/dist/src/Entity/team/Screen/team-work.js +67 -0
  54. package/dist/src/Entity/team/Screen/teams-screen.d.ts +32 -38
  55. package/dist/src/Entity/team/Screen/teams-screen.js +55 -89
  56. package/dist/src/Entity/ticket/Component/react-statistics.d.ts +22 -0
  57. package/dist/src/Entity/ticket/Component/react-statistics.js +44 -0
  58. package/dist/src/Entity/ticket/Component/sections/index.d.ts +2 -3
  59. package/dist/src/Entity/ticket/Component/sections/index.js +7 -15
  60. package/dist/src/Entity/ticket/Component/ticket-content/index.d.ts +12 -0
  61. package/dist/src/Entity/ticket/Component/ticket-content/index.js +247 -0
  62. package/dist/src/Entity/ticket/Component/ticket-content/model.d.ts +59 -0
  63. package/dist/src/Entity/ticket/Component/ticket-content/model.js +485 -0
  64. package/dist/src/Entity/ticket/Component/ticket-detail/index.d.ts +40 -44
  65. package/dist/src/Entity/ticket/Component/ticket-detail/index.js +114 -53
  66. package/dist/src/Entity/ticket/Data/detail.d.ts +6 -3
  67. package/dist/src/Entity/ticket/Data/detail.js +19 -4
  68. package/dist/src/Entity/ticket/Data/input.d.ts +7 -0
  69. package/dist/src/Entity/ticket/Data/input.js +8 -0
  70. package/dist/src/Entity/ticket/Data/query.d.ts +2 -0
  71. package/dist/src/Entity/ticket/Data/query.js +8 -0
  72. package/dist/src/Entity/ticket/Data/store.d.ts +20 -0
  73. package/dist/src/Entity/ticket/Data/store.js +127 -0
  74. package/dist/src/Entity/ticket/Data/tickets.d.ts +4 -0
  75. package/dist/src/Entity/ticket/Data/tickets.js +42 -1
  76. package/dist/src/Entity/ticket/Data/workload.d.ts +13 -0
  77. package/dist/src/Entity/ticket/Data/workload.js +9 -0
  78. package/dist/src/Entity/ticket/Screen/create-ticket-form.js +1 -1
  79. package/dist/src/Entity/ticket/Screen/edit-assignment-form.d.ts +1 -1
  80. package/dist/src/Entity/ticket/Screen/edit-assignment-form.js +1 -1
  81. package/dist/src/Entity/ticket/Screen/my-work.d.ts +36 -0
  82. package/dist/src/Entity/ticket/Screen/my-work.js +97 -0
  83. package/dist/src/Entity/ticket/Screen/ticket-agents.d.ts +1 -6
  84. package/dist/src/Entity/ticket/Screen/ticket-agents.js +2 -6
  85. package/dist/src/Entity/ticket/Screen/ticket-comments.d.ts +32 -0
  86. package/dist/src/Entity/ticket/Screen/ticket-comments.js +31 -0
  87. package/dist/src/Entity/ticket/Screen/ticket-content-screen.d.ts +92 -0
  88. package/dist/src/Entity/ticket/Screen/ticket-content-screen.js +362 -0
  89. package/dist/src/Entity/ticket/Screen/ticket-detail.d.ts +25 -286
  90. package/dist/src/Entity/ticket/Screen/ticket-detail.js +43 -954
  91. package/dist/src/Entity/ticket/Screen/ticket-planning.d.ts +32 -0
  92. package/dist/src/Entity/ticket/Screen/ticket-planning.js +34 -0
  93. package/dist/src/Entity/ticket/Screen/ticket-react-markdown.d.ts +28 -0
  94. package/dist/src/Entity/ticket/Screen/ticket-react-markdown.js +86 -0
  95. package/dist/src/Entity/ticket/Screen/ticket-react.d.ts +28 -0
  96. package/dist/src/Entity/ticket/Screen/ticket-react.js +61 -0
  97. package/dist/src/Entity/ticket/Screen/ticket-related.d.ts +59 -0
  98. package/dist/src/Entity/ticket/Screen/ticket-related.js +220 -0
  99. package/dist/src/Entity/ticket/Screen/ticket-runs.d.ts +55 -0
  100. package/dist/src/Entity/ticket/Screen/ticket-runs.js +222 -0
  101. package/dist/src/Entity/ticket/Screen/tickets.d.ts +1 -6
  102. package/dist/src/Entity/ticket/Screen/tickets.js +2 -6
  103. package/dist/src/Entity/ticket/Screen/user-tickets.d.ts +18 -17
  104. package/dist/src/Entity/ticket/Screen/user-tickets.js +34 -20
  105. package/dist/src/Entity/user/Data/member-context.d.ts +4 -0
  106. package/dist/src/Entity/user/Data/member-context.js +38 -0
  107. package/dist/src/Entity/user/Data/users.d.ts +16 -14
  108. package/dist/src/Entity/user/Data/users.js +31 -8
  109. package/dist/src/Entity/user/Screen/member-overview.d.ts +48 -0
  110. package/dist/src/Entity/user/Screen/member-overview.js +63 -0
  111. package/dist/src/Entity/user/Screen/users.d.ts +21 -19
  112. package/dist/src/Entity/user/Screen/users.js +63 -93
  113. package/dist/src/Entity/workspace/Data/members.d.ts +8 -0
  114. package/dist/src/Entity/workspace/Data/members.js +49 -0
  115. package/dist/src/Entity/workspace/Screen/workspace-picker.js +6 -10
  116. package/dist/src/Extension/load.d.ts +3 -3
  117. package/dist/src/Extension/load.js +4 -4
  118. package/dist/src/Extension/store.d.ts +3 -7
  119. package/dist/src/Extension/store.js +7 -40
  120. package/dist/src/Kernel/chrome.d.ts +27 -4
  121. package/dist/src/Kernel/chrome.js +97 -50
  122. package/dist/src/Kernel/contribution-guard.d.ts +4 -0
  123. package/dist/src/Kernel/contribution-guard.js +48 -0
  124. package/dist/src/Kernel/pipe.d.ts +6 -0
  125. package/dist/src/Kernel/pipe.js +70 -0
  126. package/dist/src/Kernel/react-body.d.ts +9 -0
  127. package/dist/src/Kernel/react-body.js +42 -0
  128. package/dist/src/Kernel/renderer.d.ts +3 -1
  129. package/dist/src/Kernel/renderer.js +5 -2
  130. package/dist/src/Kernel/tui-kernel.js +99 -57
  131. package/dist/src/Routing/context.d.ts +10 -0
  132. package/dist/src/Routing/context.js +12 -0
  133. package/dist/src/Routing/registry.d.ts +3 -1
  134. package/dist/src/Routing/registry.js +49 -8
  135. package/dist/src/Routing/route.d.ts +12 -1
  136. package/dist/src/Routing/routes.d.ts +6 -5
  137. package/dist/src/Routing/routes.js +48 -22
  138. package/dist/src/Routing/tabs.d.ts +3 -0
  139. package/dist/src/Routing/tabs.js +57 -0
  140. package/dist/src/Screen/async-react-screen.d.ts +43 -0
  141. package/dist/src/Screen/async-react-screen.js +95 -0
  142. package/dist/src/Screen/async-screen.d.ts +11 -1
  143. package/dist/src/Screen/async-screen.js +33 -6
  144. package/dist/src/Screen/empty-overview.d.ts +9 -0
  145. package/dist/src/Screen/empty-overview.js +14 -0
  146. package/dist/src/Screen/list-screen.d.ts +1 -1
  147. package/dist/src/Screen/list-screen.js +1 -1
  148. package/dist/src/Screen/react-screen.d.ts +14 -0
  149. package/dist/src/Screen/react-screen.js +34 -0
  150. package/dist/src/Screen/row-action.d.ts +17 -0
  151. package/dist/src/Screen/row-action.js +37 -0
  152. package/dist/src/Screen/screen.d.ts +18 -40
  153. package/dist/src/Statistics/client.d.ts +65 -0
  154. package/dist/src/Statistics/client.js +197 -0
  155. package/dist/src/Statistics/dashboard.d.ts +93 -0
  156. package/dist/src/Statistics/dashboard.js +206 -0
  157. package/dist/src/Statistics/figures.d.ts +5 -0
  158. package/dist/src/Statistics/figures.js +74 -0
  159. package/dist/src/Statistics/member-stats.d.ts +58 -0
  160. package/dist/src/Statistics/member-stats.js +151 -0
  161. package/dist/src/Statistics/presentation.d.ts +2 -0
  162. package/dist/src/Statistics/presentation.js +15 -0
  163. package/dist/src/Statistics/screen.d.ts +31 -0
  164. package/dist/src/Statistics/screen.js +74 -0
  165. package/dist/src/Vendor/termcn/hooks/use-motion.d.ts +5 -0
  166. package/dist/src/Vendor/termcn/hooks/use-motion.js +7 -0
  167. package/dist/src/Vendor/termcn/hooks/use-theme.d.ts +5 -0
  168. package/dist/src/Vendor/termcn/hooks/use-theme.js +10 -0
  169. package/dist/src/Vendor/termcn/hooks/use-unicode.d.ts +5 -0
  170. package/dist/src/Vendor/termcn/hooks/use-unicode.js +34 -0
  171. package/dist/src/Vendor/termcn/lib/dither-chart-utils.d.ts +130 -0
  172. package/dist/src/Vendor/termcn/lib/dither-chart-utils.js +357 -0
  173. package/dist/src/Vendor/termcn/lib/dither-line-chart-utils.d.ts +2 -0
  174. package/dist/src/Vendor/termcn/lib/dither-line-chart-utils.js +72 -0
  175. package/dist/src/Vendor/termcn/lib/dither-radar-chart-utils.d.ts +2 -0
  176. package/dist/src/Vendor/termcn/lib/dither-radar-chart-utils.js +113 -0
  177. package/dist/src/Vendor/termcn/themes/default.d.ts +1 -0
  178. package/dist/src/Vendor/termcn/themes/default.js +3 -0
  179. package/dist/src/Vendor/termcn/ui/badge.d.ts +13 -0
  180. package/dist/src/Vendor/termcn/ui/badge.js +33 -0
  181. package/dist/src/Vendor/termcn/ui/bar-chart.d.ts +16 -0
  182. package/dist/src/Vendor/termcn/ui/bar-chart.js +61 -0
  183. package/dist/src/Vendor/termcn/ui/card.d.ts +18 -0
  184. package/dist/src/Vendor/termcn/ui/card.js +7 -0
  185. package/dist/src/Vendor/termcn/ui/dither-chart.d.ts +118 -0
  186. package/dist/src/Vendor/termcn/ui/dither-chart.js +419 -0
  187. package/dist/src/Vendor/termcn/ui/dither-line-chart.d.ts +10 -0
  188. package/dist/src/Vendor/termcn/ui/dither-line-chart.js +11 -0
  189. package/dist/src/Vendor/termcn/ui/dither-radar-chart.d.ts +21 -0
  190. package/dist/src/Vendor/termcn/ui/dither-radar-chart.js +11 -0
  191. package/dist/src/Vendor/termcn/ui/divider.d.ts +14 -0
  192. package/dist/src/Vendor/termcn/ui/divider.js +25 -0
  193. package/dist/src/Vendor/termcn/ui/gauge.d.ts +12 -0
  194. package/dist/src/Vendor/termcn/ui/gauge.js +48 -0
  195. package/dist/src/Vendor/termcn/ui/heat-map.d.ts +13 -0
  196. package/dist/src/Vendor/termcn/ui/heat-map.js +59 -0
  197. package/dist/src/Vendor/termcn/ui/key-value.d.ts +16 -0
  198. package/dist/src/Vendor/termcn/ui/key-value.js +24 -0
  199. package/dist/src/Vendor/termcn/ui/line-chart.d.ts +15 -0
  200. package/dist/src/Vendor/termcn/ui/line-chart.js +102 -0
  201. package/dist/src/Vendor/termcn/ui/markdown.d.ts +24 -0
  202. package/dist/src/Vendor/termcn/ui/markdown.js +39 -0
  203. package/dist/src/Vendor/termcn/ui/progress-bar.d.ts +13 -0
  204. package/dist/src/Vendor/termcn/ui/progress-bar.js +13 -0
  205. package/dist/src/Vendor/termcn/ui/sparkline.d.ts +8 -0
  206. package/dist/src/Vendor/termcn/ui/sparkline.js +30 -0
  207. package/dist/src/Vendor/termcn/ui/types.d.ts +82 -0
  208. package/dist/src/Vendor/termcn/ui/types.js +1 -0
  209. package/dist/src/launcher.d.ts +2 -1
  210. package/dist/src/launcher.js +5 -2
  211. package/dist/src/lib/theme.d.ts +56 -0
  212. package/dist/src/lib/theme.js +42 -0
  213. package/dist/src/lib/vnode.d.ts +4 -0
  214. package/dist/src/lib/vnode.js +6 -3
  215. package/dist/src/plugin.js +16 -1
  216. package/dist/src/react-experiment.d.ts +1 -0
  217. package/dist/src/react-experiment.js +7 -0
  218. package/dist/src/react-preset.d.ts +3 -0
  219. package/dist/src/react-preset.js +5 -0
  220. package/dist/src/types.d.ts +20 -7
  221. package/dist/src/ui.d.ts +19 -1
  222. package/dist/src/ui.js +15 -0
  223. package/package.json +11 -5
@@ -99,11 +99,13 @@ export const parseFooterLadder = (ladder, idPrefix = 'footer-action') => {
99
99
  .map((s) => s.trim())
100
100
  .filter((s) => s !== '');
101
101
  const items = [];
102
- for (let i = 0; i < segments.length; i += 1) {
103
- const m = /^(\S+)(?:\s+(.+))?$/.exec(segments[i]);
102
+ for (const [i, seg] of segments.entries()) {
103
+ const m = /^(\S+)(?:\s+(.+))?$/.exec(seg);
104
104
  if (m === null)
105
105
  continue;
106
106
  const key = m[1];
107
+ if (key === undefined)
108
+ continue;
107
109
  const label = m[2];
108
110
  items.push(actionItem(`${idPrefix}-${i}`, key, label));
109
111
  }
@@ -9,7 +9,7 @@ import { BACKGROUND_ACTIVE, BORDER, DEFAULT_BACKGROUND, FOREGROUND, FOREGROUND_A
9
9
  */
10
10
  export const filterBadgeStrip = (id, badges) => {
11
11
  const nodes = [];
12
- for (let index = 0; index < badges.length; index += 1) {
12
+ for (const [index, badge] of badges.entries()) {
13
13
  if (index > 0) {
14
14
  nodes.push(textNode({
15
15
  id: `${id}-gap-${index}`,
@@ -18,7 +18,6 @@ export const filterBadgeStrip = (id, badges) => {
18
18
  fg: BORDER,
19
19
  }));
20
20
  }
21
- const badge = badges[index];
22
21
  const value = badge.value;
23
22
  const active = value !== undefined && value !== '';
24
23
  const label = active ? value : badge.label;
@@ -24,6 +24,11 @@ export declare const styledRunOf: (span: MarkdownSpan) => StyledRun;
24
24
  * reads a span's flags.
25
25
  */
26
26
  export declare const styledLineOf: (line: MarkdownLine) => StyledLine;
27
+ /**
28
+ * The inverse of {@link styledLineOf}: already-painted runs as parser lines,
29
+ * so a React painter can consume production rows without a source round trip.
30
+ */
31
+ export declare const markdownLineFromStyled: (line: StyledLine) => MarkdownLine;
27
32
  /** A `gaia_rich` body as the physical rows a surface draws or prints — D1. */
28
33
  export declare function markdownLines(body: string): StyledLine[];
29
34
  /** A line NOTHING parses — one unstyled run (D3's plain path, as a value). */
@@ -74,6 +74,21 @@ export const styledLineOf = (line) => ({
74
74
  runs: line.spans.map(styledRunOf),
75
75
  heading: line.heading,
76
76
  });
77
+ /**
78
+ * The inverse of {@link styledLineOf}: already-painted runs as parser lines,
79
+ * so a React painter can consume production rows without a source round trip.
80
+ */
81
+ export const markdownLineFromStyled = (line) => ({
82
+ text: line.text,
83
+ heading: line.heading,
84
+ spans: line.runs.map((run) => ({
85
+ text: run.text,
86
+ ...((run.attributes & BOLD) !== 0 ? { bold: true } : {}),
87
+ ...((run.attributes & ITALIC) !== 0 ? { italic: true } : {}),
88
+ ...((run.attributes & DIM) !== 0 ? { dim: true } : {}),
89
+ ...(run.fg !== undefined ? { code: true } : {}),
90
+ })),
91
+ });
77
92
  /** A `gaia_rich` body as the physical rows a surface draws or prints — D1. */
78
93
  export function markdownLines(body) {
79
94
  return parseMarkdown(body).map(styledLineOf);
@@ -173,7 +173,7 @@ export declare const panelSectionKey: (heading: string) => string;
173
173
  * The one description of what a section renders as. {@link flattenSections}
174
174
  * derives the row surface from it and a converted screen derives its nodes from
175
175
  * it, so the two cannot answer differently for the same document — which is the
176
- * property that lets the Dashboard hand over renderables while its pipe keeps
176
+ * property that lets Stats hand over renderables while its pipe keeps
177
177
  * emitting the bytes it always did (spec F5).
178
178
  */
179
179
  export declare function sectionRows(sections: Section[], keyOf?: (heading: string) => string): SectionRow[];
@@ -131,7 +131,7 @@ export const panelSectionKey = (heading) => Array.from(new TextEncoder().encode(
131
131
  * The one description of what a section renders as. {@link flattenSections}
132
132
  * derives the row surface from it and a converted screen derives its nodes from
133
133
  * it, so the two cannot answer differently for the same document — which is the
134
- * property that lets the Dashboard hand over renderables while its pipe keeps
134
+ * property that lets Stats hand over renderables while its pipe keeps
135
135
  * emitting the bytes it always did (spec F5).
136
136
  */
137
137
  export function sectionRows(sections,
@@ -1,9 +1,9 @@
1
- // GAIA-256 spec D11 — the Dashboard's `/usage`-style bar rows.
1
+ // GAIA-256 spec D11 — Stats' `/usage`-style bar rows.
2
2
  //
3
3
  // A SHARED component (the third in `src/Component/`), and it earns that place by
4
4
  // carrying no entity vocabulary at all: it takes `{ label, numbers }` and draws
5
5
  // bars. Nothing here knows a ticket from a run from a project — which is exactly
6
- // what G4 asserts, and why the Dashboard can render four different blocks from
6
+ // what G4 asserts, and why Stats can render four different blocks from
7
7
  // one function.
8
8
  //
9
9
  // It produces the ROWS OF ONE BLOCK. Stacking blocks under bold headings is
@@ -0,0 +1,9 @@
1
+ import type { SectionLine } from '../section-list/index.js';
2
+ export interface TeamMemberWorkloadListItem {
3
+ userId: string;
4
+ label: string;
5
+ open: number;
6
+ running: number;
7
+ waiting: number;
8
+ }
9
+ export declare function teamMemberWorkloadRows(members: readonly TeamMemberWorkloadListItem[]): SectionLine[];
@@ -0,0 +1,31 @@
1
+ const countCell = (text) => ({
2
+ text,
3
+ width: 9,
4
+ right: true,
5
+ });
6
+ export function teamMemberWorkloadRows(members) {
7
+ const memberCell = (text) => ({
8
+ text,
9
+ width: 24,
10
+ min: 12,
11
+ grow: 1,
12
+ });
13
+ return [
14
+ {
15
+ cells: [
16
+ memberCell('Member'),
17
+ countCell('Open'),
18
+ countCell('Running'),
19
+ countCell('Waiting'),
20
+ ],
21
+ },
22
+ ...members.map((member) => ({
23
+ cells: [
24
+ memberCell(member.label),
25
+ countCell(String(member.open)),
26
+ countCell(String(member.running)),
27
+ countCell(String(member.waiting)),
28
+ ],
29
+ })),
30
+ ];
31
+ }
@@ -1,315 +1,17 @@
1
- /** One top-level TUI tab: its id and label. */
1
+ /** Tab rendering is independent of registration and routing. */
2
2
  export interface TopTab {
3
3
  id: string;
4
4
  label: string;
5
5
  }
6
- /** The root level: what there is before a project is chosen. */
7
- export declare const ROOT_TABS: readonly [{
8
- readonly id: "dashboard";
9
- readonly label: "Dashboard";
10
- }, {
11
- readonly id: "projects";
12
- readonly label: "Projects";
13
- }, {
14
- readonly id: "conductors";
15
- readonly label: "Conductors";
16
- }, {
17
- readonly id: "teams";
18
- readonly label: "Teams";
19
- }];
20
- /**
21
- * The project level: the tabs of an opened project.
22
- *
23
- * GAIA-450 added `conductors` (`ProjectConductorsScreen`, `project.conductors`,
24
- * order 50) — LAST, by the same "which project it serves is a COLUMN of that
25
- * screen" argument GAIA-232 made for the root level, applied the other way:
26
- * once a project IS chosen, seeing who serves it is a natural final stop
27
- * beside Tickets, Ticket-Agents and Runs. Missing here — as it was for one
28
- * `coding` pass, review B11 — makes the screen and its route entirely
29
- * unreachable by Tab or click: `tabsOfLocation` reads this list, not the
30
- * route registry's `tab` metadata, for what a level cycles through.
31
- */
32
- export declare const PROJECT_TABS: readonly [{
33
- readonly id: "dashboard";
34
- readonly label: "Dashboard";
35
- }, {
36
- readonly id: "tickets";
37
- readonly label: "Tickets";
38
- }, {
39
- readonly id: "ticket-agents";
40
- readonly label: "Ticket-Agents";
41
- }, {
42
- readonly id: "runs";
43
- readonly label: "Runs";
44
- }, {
45
- readonly id: "conductors";
46
- readonly label: "Conductors";
47
- }];
48
- /**
49
- * The ticket level: the sections of ONE OPEN TICKET — GAIA-346.
50
- *
51
- * The third level this file's GAIA-239 comment has described since it was
52
- * written, arriving with the change that needed it. What is new is not the level
53
- * but where it is DRAWN: that comment reserved it for "the header box's meta row,
54
- * so no top-level bar at all", and the operator's ruling is the opposite — the
55
- * sections belong in the bar every other level uses, and the ticket detail keeps
56
- * no tab row of its own.
57
- *
58
- * These entries are NOT destinations. A section is a mode of the one ticket
59
- * route: switching one runs no `Router.navigate`, so the screen instance, its
60
- * document and its per-section state are untouched (spec D1/F3). The kernel
61
- * learns that from the screen, through `Screen.selectTopTab`, and not from a
62
- * level name — nothing in this file distinguishes a mode from a destination, and
63
- * nothing should.
64
- *
65
- * `runs` is declared here AND on the project level, which GAIA-256 D2 already
66
- * made legal: ids are not globally unique, every function is level-parameterised,
67
- * and one bar is on screen at a time.
68
- */
69
- export declare const TICKET_TABS: readonly [{
70
- readonly id: "overview";
71
- readonly label: "Overview";
72
- }, {
73
- readonly id: "comments";
74
- readonly label: "Comments";
75
- }, {
76
- readonly id: "related";
77
- readonly label: "Related";
78
- }, {
79
- readonly id: "runs";
80
- readonly label: "Runs";
81
- }];
82
- /**
83
- * The team level: Overview · Users for one crew — GAIA-391 AC4, by operator
84
- * ruling.
85
- *
86
- * The level the `users` root tab BECAME. It sits between root and user, so the
87
- * navigation reads root → team → user: which crews are there, who is in this
88
- * one, what has that person done. Destinations, not modes — each tab is its own
89
- * screen, so Tab runs a real `Router.navigate` and `teamId` is preserved
90
- * (`Routing/registry.ts` keeps the params for this scope for the same reason it
91
- * keeps them for `project` and `user`).
92
- *
93
- * `overview` is also declared on the user level, which GAIA-256 D2 already made
94
- * legal: ids are not globally unique, every function here is level-parameterised,
95
- * and one bar is on screen at a time.
96
- */
97
- export declare const TEAM_TABS: readonly [{
98
- readonly id: "overview";
99
- readonly label: "Overview";
100
- }, {
101
- readonly id: "users";
102
- readonly label: "Users";
103
- }];
104
- /**
105
- * The user level: Overview · Tickets · Runs for one person (GAIA-377 D1).
106
- *
107
- * Destinations, not modes — each tab is its own screen in the slice that owns
108
- * its query (D2), so Tab runs a real `Router.navigate` and preserves `userId`.
109
- *
110
- * UNCHANGED by GAIA-391: the ruling moved this level's PARENT (it hangs off
111
- * {@link TEAM_TABS} now instead of off a root `users` tab), not its contents.
112
- */
113
- export declare const USER_TABS: readonly [{
114
- readonly id: "overview";
115
- readonly label: "Overview";
116
- }, {
117
- readonly id: "tickets";
118
- readonly label: "Tickets";
119
- }, {
120
- readonly id: "runs";
121
- readonly label: "Runs";
122
- }];
123
- /**
124
- * The tab bars, keyed by level — the one place a level is named.
125
- *
126
- * Declared in DEPTH order (root → project → ticket, then team → user), which is
127
- * documentation rather than mechanism: nothing reads this object in key order
128
- * since GAIA-256 D2 deleted `locateTab`, the one function that did.
129
- */
130
- export declare const TAB_LEVELS: {
131
- readonly root: readonly [{
132
- readonly id: "dashboard";
133
- readonly label: "Dashboard";
134
- }, {
135
- readonly id: "projects";
136
- readonly label: "Projects";
137
- }, {
138
- readonly id: "conductors";
139
- readonly label: "Conductors";
140
- }, {
141
- readonly id: "teams";
142
- readonly label: "Teams";
143
- }];
144
- readonly project: readonly [{
145
- readonly id: "dashboard";
146
- readonly label: "Dashboard";
147
- }, {
148
- readonly id: "tickets";
149
- readonly label: "Tickets";
150
- }, {
151
- readonly id: "ticket-agents";
152
- readonly label: "Ticket-Agents";
153
- }, {
154
- readonly id: "runs";
155
- readonly label: "Runs";
156
- }, {
157
- readonly id: "conductors";
158
- readonly label: "Conductors";
159
- }];
160
- readonly ticket: readonly [{
161
- readonly id: "overview";
162
- readonly label: "Overview";
163
- }, {
164
- readonly id: "comments";
165
- readonly label: "Comments";
166
- }, {
167
- readonly id: "related";
168
- readonly label: "Related";
169
- }, {
170
- readonly id: "runs";
171
- readonly label: "Runs";
172
- }];
173
- readonly team: readonly [{
174
- readonly id: "overview";
175
- readonly label: "Overview";
176
- }, {
177
- readonly id: "users";
178
- readonly label: "Users";
179
- }];
180
- readonly user: readonly [{
181
- readonly id: "overview";
182
- readonly label: "Overview";
183
- }, {
184
- readonly id: "tickets";
185
- readonly label: "Tickets";
186
- }, {
187
- readonly id: "runs";
188
- readonly label: "Runs";
189
- }];
190
- };
191
- /** The name of a level that carries a top-level tab bar. */
192
- export type TabLevel = keyof typeof TAB_LEVELS;
193
- /** The ids of one level's tabs, derived from {@link TAB_LEVELS}. */
194
- export type TabIdOf<L extends TabLevel> = (typeof TAB_LEVELS)[L][number]['id'];
195
- /**
196
- * The id of any top-level tab, derived — never re-listed. Before GAIA-239 this
197
- * union was hand-written in `tui-kernel.ts` alongside a third hardcoded copy of
198
- * the same ids for the Tab cycle order; the three could drift silently.
199
- */
200
- export type TopTabId = {
201
- [L in TabLevel]: TabIdOf<L>;
202
- }[TabLevel];
203
- /**
204
- * Where a screen sits in the navigation: which bar it draws, and which tab of
205
- * that bar is its own. A discriminated union over the levels, so a location can
206
- * never pair one level's name with another level's tab id.
207
- *
208
- * GAIA-373 D5/D6 — the `ticket` arm is the one that is NOT a literal union, and
209
- * it is also the one that carries an optional bar of its own. Both halves have
210
- * the same cause: the ticket level is not a DESTINATION level.
211
- * `router.navigateTab` is never reached for it, because `selectTopTab` claims
212
- * every ticket tab (GAIA-346 D4), so the literal union that protects root/project
213
- * NAVIGATION has no target here — while a contributed section mode
214
- * (`gaia/artifacts`) is data from the contribution store and cannot be a literal
215
- * in this file at all. Root and project keep theirs intact, so
216
- * `topTabBar('root', 'runs')` is still a TS2345.
217
- *
218
- * `tabs` is read by BOTH bar builders below and by the kernel's Tab cycle, so
219
- * the bar drawn, the bar clicked and the bar cycled are three readings of one
220
- * field rather than three answers.
221
- */
222
- export type TabLocation = {
223
- level: 'root';
224
- tab: TabIdOf<'root'>;
225
- } | {
226
- level: 'project';
227
- tab: TabIdOf<'project'>;
228
- } | {
229
- level: 'ticket';
6
+ export interface TabLocation {
7
+ level: string;
230
8
  tab: string;
231
- tabs?: readonly TopTab[];
232
- } | {
233
- level: 'team';
234
- tab: TabIdOf<'team'>;
235
- } | {
236
- level: 'user';
237
- tab: TabIdOf<'user'>;
238
- };
239
- /** The entries a location draws: its own, else its level's registry. */
240
- export declare const tabsOfLocation: (location: TabLocation) => readonly TopTab[];
241
- /**
242
- * The bar as the PIECES it is drawn from: one part per tab, carrying that tab's
243
- * id, with the joins between them carrying none.
244
- *
245
- * GAIA-340 Task 11 (spec D6) — this replaces `topTabSpans`, which published the
246
- * same layout as `[start, end)` COLUMN ranges for the kernel to resolve a click
247
- * against. The bar is a row of renderables now (`Kernel/chrome.ts`), so "which
248
- * tab is under the pointer" is answered by the renderer's own hit test — the
249
- * part the pointer landed on IS a node, and its id names its tab. A column map
250
- * beside that would be a second answer to a question the renderer already
251
- * answers, and it needed `displayWidth` to build, which is exactly the string
252
- * measurement this ticket exists to delete (R5/D8).
253
- *
254
- * The argument the spans made survives unchanged, and is why the parts are here
255
- * rather than in the chrome: {@link topTabBar} is these parts JOINED, so the
256
- * rendered bar and the clickable pieces are two readings of one expression and
257
- * cannot drift apart.
258
- */
259
- export interface TabBarPart<Id extends string = TopTabId> {
260
- /** The tab this piece is, or absent for the join between two tabs. */
9
+ tabs: readonly TopTab[];
10
+ }
11
+ export interface TabBarPart<Id extends string = string> {
261
12
  readonly tab?: Id;
262
13
  readonly text: string;
263
14
  }
264
- /**
265
- * One level's tab bar as a single row; the active tab is bracketed.
266
- *
267
- * The level is part of the signature on purpose: it is what keeps the id checked
268
- * at compile time now that there is more than one bar. `topTabBar('root', 'runs')`
269
- * is a TS2345 naming the root level's valid ids — not a bar that silently
270
- * brackets nothing.
271
- *
272
- * NO PRODUCT CALLER SINCE GAIA-340 Task 11, and KEPT — the decision, so it is not
273
- * re-litigated. The chrome draws the bar as one node per tab (`tabPartsFor`), so
274
- * the only readers of this and of {@link tabBarFor} are four suites that pin the
275
- * bar's picture. They are what those pins compare the RENDERED row against, and
276
- * the alternative is transcribing the bar into each of them as a literal — a
277
- * hand-copied reference cannot notice a label change, where this one is
278
- * `renderParts(…).join('')`, i.e. the same expression the chrome's nodes come
279
- * from. Two readings of one source cannot drift into two answers; a literal and a
280
- * source can. That is the same argument spec D6 makes for moving an independent
281
- * reference rather than dropping it, and it costs ten lines and no measurement.
282
- */
283
- export declare function topTabBar<L extends TabLevel>(level: L, activeId: TabIdOf<L>): string;
284
- /**
285
- * The same bar, for a caller holding a whole {@link TabLocation} rather than a
286
- * literal level. The pairing was already checked when the location was built, so
287
- * this needs no second check — and unlike `topTabBar(loc.level, loc.tab)` it does
288
- * not ask the compiler to correlate two independently narrowed properties.
289
- */
15
+ export declare const tabsOfLocation: (location: TabLocation) => readonly TopTab[];
16
+ export declare function tabPartsFor(location: TabLocation): TabBarPart[];
290
17
  export declare function tabBarFor(location: TabLocation): string;
291
- /**
292
- * One level's own bar as its clickable pieces — see {@link TabBarPart}.
293
- *
294
- * GAIA-239: the LEVEL is part of the signature, exactly as it is for
295
- * {@link topTabBar}, and for the same reason twice over. GAIA-241 shipped one
296
- * `topTabSpans(activeId)` over the single flat bar; read level-blind it would
297
- * publish the project bar's pieces on the root screen too, so a click where
298
- * `Ticket-Agents` sits on the other level would open a tab that screen does not
299
- * draw — the very defect GAIA-239 removed, arriving through the mouse. Pieces
300
- * and bar of two different levels is a TS2345, not a silent mis-click.
301
- */
302
- export declare function topTabParts<L extends TabLevel>(level: L, activeId: TabIdOf<L>): TabBarPart<TabIdOf<L>>[];
303
- /**
304
- * The same pieces, for a caller holding a whole {@link TabLocation} — the
305
- * companion of {@link tabBarFor}, and the pairing it needs was already checked
306
- * when the location was built. Keeping the two in step is what makes "the bar you
307
- * see is the bar you click" true by construction: both read `location`.
308
- *
309
- * GAIA-373 — `TabBarPart<string>` rather than the `TopTabId` default, and that
310
- * is an honest widening rather than a lost check: a location may carry a bar of
311
- * its own now, whose entries are CONTRIBUTED (`gaia/artifacts`) and by
312
- * construction outside every union derived from `TAB_LEVELS`. The level-typed
313
- * {@link topTabParts} keeps the narrow ids for callers that name a level.
314
- */
315
- export declare function tabPartsFor(location: TabLocation): TabBarPart<string>[];