@kud/jira-ink 0.6.0 → 0.7.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.
package/dist/index.d.ts CHANGED
@@ -183,13 +183,25 @@ type Block = {
183
183
  declare const blocksFor: (rows: BoardRow[]) => Block[];
184
184
  /** Index into `blocks` of the n-th issue, so a cursor over issues maps to a line. */
185
185
  declare const blockIndexOfIssue: (blocks: Block[], issueIndex: number) => number;
186
+ type PriorityGlyph = "⇈" | "↑" | "=" | "↓" | "⇊" | " ";
186
187
  /**
187
- * Priority names are per-instance, so this matches the default scheme, the
188
- * common renames and the P0–P4 ladder rather than an exact list. Medium — or
189
- * anything unrecognised — draws nothing: the glyph column marks the two ends
190
- * only.
188
+ * Rank against the scheme's default rung, in Jira's own arrow grammar: two
189
+ * rungs above draws `⇈`, one `↑`, the default `=`, one below `↓`, two `⇊`.
190
+ *
191
+ * Five glyphs, not three, and the normal rung gets one. The column used to
192
+ * mark the two ends only (`▲` / `▼`, nothing for normal), which on a four-rung
193
+ * scheme — P1 to P4, the common shape — put a mark on half the rows, drew P2
194
+ * as if it were normal, and made P3 and P4 identical. And a blank beside a
195
+ * marked row read as MISSING rather than as normal: the absent-vs-zero
196
+ * distinction, one glyph at a time. So `=` says "we looked, it is normal",
197
+ * and the blank finally means only "no priority, or one we cannot place".
198
+ *
199
+ * Names are per-instance, so this matches the default scheme, the common
200
+ * renames and the P0–P5 ladder rather than an exact list. Deriving rank from
201
+ * the instance's ordered priority list, with its default flag, is the honest
202
+ * version of this and where it goes next; the names are the fallback.
191
203
  */
192
- declare const priorityGlyph: (name: string | null) => "\u25B2" | "\u25BC" | " ";
204
+ declare const priorityGlyph: (name: string | null) => PriorityGlyph;
193
205
  declare const relativeAge: (iso: string, now?: number) => string;
194
206
  declare const pillVariantFor: (row: Pick<BoardRow, "type" | "container">) => "group" | "info" | "error" | "muted";
195
207
  type BoardModel = {
@@ -281,18 +293,15 @@ declare const IssueBoard: ({ model, viewer, loadedAt, scope, showingAll, searchE
281
293
 
282
294
  type PriorityMarker = {
283
295
  /** Always one column wide, so a list filling every row keeps its grid. */
284
- marker: "▲" | "▼" | " ";
296
+ marker: PriorityGlyph;
285
297
  /** Absent for the blank: nothing to paint. */
286
298
  color?: string;
287
299
  };
288
300
  /**
289
301
  * The priority cell as the board draws it — glyph and colour together, so a
290
302
  * host filling gh-ink's `marker` / `markerColor` pair and the board's own row
291
- * cannot disagree on a hue. Shape is the channel (`▲` above normal, `▼`
292
- * below, nothing for normal); the hues sit in different bins so the two arrows
293
- * do not merge at row-scan speed, and a warm one on the high end so it clears
294
- * the row text. The hex-vs-token question was settled with the pill map: one
295
- * site, here, never a host-side table that drifts.
303
+ * cannot disagree on a hue. One site, never a host-side table that drifts;
304
+ * see `priorityGlyph` for what the glyphs say.
296
305
  */
297
306
  declare const priorityMarker: (name: string | null) => PriorityMarker;
298
307
 
@@ -305,4 +314,4 @@ declare const priorityMarker: (name: string | null) => PriorityMarker;
305
314
  declare const MOCK_BOARD_ROWS: BoardRow[];
306
315
  declare const mockBoard: () => BoardModel;
307
316
 
308
- export { type Block, type BoardModel, type BoardOptions, type BoardRow, type BoardScope, type BoardTab, type BoardTabs, IssueBoard, type IssueBoardProps, IssueBody, type IssueBodyProps, type IssueDetail, IssueDetailView, type IssueDetailViewProps, MOCK_BOARD_ROWS, OFF_BOARD, type PriorityMarker, type StatusCategory, type TabSource, type Transition, blockIndexOfIssue, blocksFor, boardOf, countsFor, issueDetailOf, mockBoard, pillVariantFor, priorityGlyph, priorityMarker, relativeAge, tabOf, tabsFromBoard, tabsFromCategories, tabsFromConfig, toBoardRow, transitionsOf, visibleTabs };
317
+ export { type Block, type BoardModel, type BoardOptions, type BoardRow, type BoardScope, type BoardTab, type BoardTabs, IssueBoard, type IssueBoardProps, IssueBody, type IssueBodyProps, type IssueDetail, IssueDetailView, type IssueDetailViewProps, MOCK_BOARD_ROWS, OFF_BOARD, type PriorityGlyph, type PriorityMarker, type StatusCategory, type TabSource, type Transition, blockIndexOfIssue, blocksFor, boardOf, countsFor, issueDetailOf, mockBoard, pillVariantFor, priorityGlyph, priorityMarker, relativeAge, tabOf, tabsFromBoard, tabsFromCategories, tabsFromConfig, toBoardRow, transitionsOf, visibleTabs };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MarkdownViewport } from '@kud/ink-markdown';
2
- import { useTabs, KeyValue, Badge, Tabs, FooterHints, StatusMessage, colors, useListCursor, pillWidth, TextInput, SelectableRow, Pill, LoadingScreen } from '@kud/ink-ui';
2
+ import { colors, useTabs, KeyValue, Badge, Tabs, FooterHints, StatusMessage, useListCursor, pillWidth, TextInput, SelectableRow, Pill, LoadingScreen } from '@kud/ink-ui';
3
3
  import { useInput, Box, Text, useStdout } from 'ink';
4
4
  import { useState, useEffect, useMemo } from 'react';
5
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -346,8 +346,11 @@ var blockIndexOfIssue = (blocks, issueIndex) => {
346
346
  };
347
347
  var priorityGlyph = (name) => {
348
348
  const n = (name ?? "").trim().toLowerCase();
349
- if (/highest|high|critical|blocker|urgent|^p[01]$/.test(n)) return "\u25B2";
350
- if (/lowest|low|minor|trivial|^p[3-5]$/.test(n)) return "\u25BC";
349
+ if (/^(highest|blocker|critical|p[01])$/.test(n)) return "\u21C8";
350
+ if (/^(high|urgent|major|p2)$/.test(n)) return "\u2191";
351
+ if (/^(medium|normal|p3)$/.test(n)) return "=";
352
+ if (/^(low|minor|p4)$/.test(n)) return "\u2193";
353
+ if (/^(lowest|trivial|p5)$/.test(n)) return "\u21CA";
351
354
  return " ";
352
355
  };
353
356
  var UNITS = [
@@ -382,14 +385,24 @@ var boardOf = async (client, jql, { tabs, board, limit = 200 } = {}) => {
382
385
  ]);
383
386
  return { rows: issues.map(toBoardRow), tabs: derived ?? tabsFromCategories() };
384
387
  };
388
+ var COLOUR = {
389
+ "\u21C8": colors.warning,
390
+ "\u2191": colors.warning,
391
+ "=": colors.muted,
392
+ "\u2193": colors.info,
393
+ "\u21CA": colors.info,
394
+ " ": void 0
395
+ };
385
396
  var priorityMarker = (name) => {
386
397
  const marker = priorityGlyph(name);
387
- return marker === "\u25B2" ? { marker, color: colors.warning } : marker === "\u25BC" ? { marker, color: colors.muted } : { marker };
398
+ const color = COLOUR[marker];
399
+ return color ? { marker, color } : { marker };
388
400
  };
389
401
  var CHROME = 6;
390
402
  var LEGEND = [
391
- ["\u25B2", "high priority"],
392
- ["\u25BC", "low priority"],
403
+ ["\u21C8 \u2191", "priority above the default"],
404
+ ["=", "default priority"],
405
+ ["\u2193 \u21CA", "priority below the default"],
393
406
  ["\u2500\u2500 epic \u2500\u2500", "a parent not in this tab; its rows hang beneath"],
394
407
  ["\u2514\u2500", "a row under the container above it"],
395
408
  ["story \xB7 bug \xB7 task", "issue type"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/jira-ink",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Ink components for viewing Jira issues: the board and the issue detail screen, shared by jira-cli's TUI and cockpit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",