@gaia-ai/addon-gaia-ui 0.20.0 → 0.21.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.
@@ -21,7 +21,12 @@ const HEADINGS = {
21
21
  // `detailSections` only pushes them when a matching comment exists, and
22
22
  // `sectionsForTab` drops the rest — so Overview `selectable` is `2 + N`
23
23
  // (N = how many of {spec, plan} exist). Entry 0 stays Latest summary.
24
+ // GAIA-678: `Source` joins `Parent` here too — `sectionsForTab`'s only way to
25
+ // reach the pipe (`ticket-detail.ts`'s `fullNonInteractive` renders the
26
+ // overview tab's sections, not `related`'s), and no code reads it back out
27
+ // of `byHeading` for the interactive Overview body, so it is otherwise inert.
24
28
  overview: [
29
+ 'Source',
25
30
  'Parent',
26
31
  'Links',
27
32
  'Latest summary',
@@ -43,7 +48,15 @@ const HEADINGS = {
43
48
  // GAIA-369 D5: `Blocked by` between `Sub-tickets` and `Referenced tickets` —
44
49
  // grouped with the other relationship sections, and the only one of the three
45
50
  // rendered as identity rows rather than a count (see `blockedByLines`).
46
- related: ['Parent', 'Sub-tickets', 'Blocked by', 'Referenced tickets'],
51
+ // GAIA-678: `Source` FIRST — the upstream ticket this one was imported from
52
+ // (`gaia_ticket.origin`), a plain attribute rather than a relationship.
53
+ related: [
54
+ 'Source',
55
+ 'Parent',
56
+ 'Sub-tickets',
57
+ 'Blocked by',
58
+ 'Referenced tickets',
59
+ ],
47
60
  // GAIA-255 AC-6: the shared run table, with selectable rows — not a section.
48
61
  runs: [],
49
62
  };
@@ -194,6 +194,7 @@ const linkProperties = (lines) => {
194
194
  });
195
195
  };
196
196
  const relatedProperties = (document) => [
197
+ originProperty(document, 'source') ?? property('source', ''),
197
198
  ...relatedTicketProperties(document, 'parent_id', 'parent'),
198
199
  ...relatedTicketProperties(document, 'sub_tickets', 'sub-ticket'),
199
200
  ...relatedTicketProperties(document, 'blocked_by', 'blocked by'),
@@ -387,11 +388,11 @@ const metricMatrix = (document) => {
387
388
  };
388
389
  return { ticket: ticketGrid, runs: runsGrid };
389
390
  };
390
- const originProperty = (document) => {
391
+ const originProperty = (document, key = 'origin') => {
391
392
  const origin = asString(document.data?.attributes?.origin);
392
393
  if (origin === undefined)
393
394
  return undefined;
394
- return property('origin', origin, origin.startsWith('http') ? { href: origin } : {});
395
+ return property(key, origin, origin.startsWith('http') ? { href: origin } : {});
395
396
  };
396
397
  const EMPTY_SUMMARY = 'No summary comment.';
397
398
  const hasSummary = (lines) => {
@@ -149,7 +149,7 @@ export declare function headerState(document: TicketDetailDocument): string;
149
149
  /**
150
150
  * The ticket detail sections, each with an explicit empty state — GAIA-369 D7 /
151
151
  * GAIA-381 D3 order, which IS the order the flat `| cat` render prints:
152
- * State, Labels, Parent, Latest summary, Latest spec?, Latest plan?, Description,
152
+ * State, Labels, Source, Parent, Latest summary, Latest spec?, Latest plan?, Description,
153
153
  * Assignment, Time, Comments, Sub-tickets, Blocked by, Runs, Referenced tickets,
154
154
  * Links, Branch, Environments. Spec/Plan are omitted when no matching comment.
155
155
  *
@@ -570,6 +570,15 @@ function parentLines(document) {
570
570
  return ['No parent ticket.'];
571
571
  return [ticketIdentityRow(document, id)];
572
572
  }
573
+ /**
574
+ * The source (origin) ticket's URL — GAIA-678. A plain attribute, not a
575
+ * relationship, so there is no identity row to resolve: the URL verbatim, or
576
+ * the pane's usual empty state when the ticket carries none.
577
+ */
578
+ function sourceLines(document) {
579
+ const origin = asString(document.data?.attributes?.origin);
580
+ return origin === undefined ? ['none'] : [origin];
581
+ }
573
582
  /**
574
583
  * The blockers' identity rows — GAIA-369 D5, AC-3.
575
584
  *
@@ -632,7 +641,7 @@ function timeLines(a) {
632
641
  /**
633
642
  * The ticket detail sections, each with an explicit empty state — GAIA-369 D7 /
634
643
  * GAIA-381 D3 order, which IS the order the flat `| cat` render prints:
635
- * State, Labels, Parent, Latest summary, Latest spec?, Latest plan?, Description,
644
+ * State, Labels, Source, Parent, Latest summary, Latest spec?, Latest plan?, Description,
636
645
  * Assignment, Time, Comments, Sub-tickets, Blocked by, Runs, Referenced tickets,
637
646
  * Links, Branch, Environments. Spec/Plan are omitted when no matching comment.
638
647
  *
@@ -663,6 +672,9 @@ export function detailSections(document, labels, nowSeconds = 0, baseUrl) {
663
672
  heading: 'Labels',
664
673
  lines: labelNames(document).length ? labelNames(document) : ['No labels.'],
665
674
  });
675
+ // GAIA-678: the upstream ticket this one was imported from — above `Parent`,
676
+ // matching the interactive Related pane's row order.
677
+ sections.push({ heading: 'Source', lines: sourceLines(document) });
666
678
  sections.push({ heading: 'Parent', lines: parentLines(document) });
667
679
  // GAIA-369 D3/D7: ABOVE `Description`, matching its Overview position — the
668
680
  // newest phase handoff is what an operator reads before the ticket's own body,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaia-ai/addon-gaia-ui",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "GAIA TUI: interactive terminal UI (dashboard, projects, tickets) as a dropsh `tui` renderer plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "zustand": "^5.0.15"
30
30
  },
31
31
  "peerDependencies": {
32
- "@gaia-ai/core": "^0.20.0",
33
- "@gaia-ai/message": "^0.20.0"
32
+ "@gaia-ai/core": "^0.21.0",
33
+ "@gaia-ai/message": "^0.21.0"
34
34
  }
35
35
  }