taskchef 7.17.0 → 7.17.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "7.17.0",
3
+ "version": "7.17.1",
4
4
  "description": "Dispatch work from a data-only workspace to visible Codex project tasks.",
5
5
  "author": {
6
6
  "name": "Favo Yang",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "7.17.0",
3
+ "version": "7.17.1",
4
4
  "description": "A non-blocking interactive dispatcher for visible Codex tasks.",
5
5
  "license": "MIT",
6
6
  "author": "Favo Yang",
@@ -19,6 +19,7 @@ import { openTaskFromControl } from "./actions.js";
19
19
  import {
20
20
  githubReferenceAccessibleLabel,
21
21
  githubReferenceDisplayLabels,
22
+ groupRelatedGitHubLinks,
22
23
  referenceSegments,
23
24
  } from "./github-links.js";
24
25
  import { formatRelativeTime, RelativeTimeController, parsedTimestamp } from "./time.js";
@@ -116,26 +117,35 @@ function appendLinkedText(container, text, task) {
116
117
  }
117
118
 
118
119
  function relatedGitHubLinks(task, { compact = false } = {}) {
119
- const seen = new Set();
120
- const links = (task.relatedGitHubLinks ?? []).filter((link) => {
121
- if (link.type === "repository" || seen.has(link.label)) return false;
122
- seen.add(link.label);
123
- return true;
124
- });
120
+ const groups = groupRelatedGitHubLinks(task.relatedGitHubLinks);
121
+ const links = groups.flat();
125
122
  const container = document.createElement("nav");
126
123
  container.className = `github-links${compact ? " github-links-compact" : ""}`;
127
124
  container.setAttribute("aria-label", `Related GitHub links for ${task.title}`);
128
125
  const displayLabels = githubReferenceDisplayLabels(links, { related: true });
129
- const children = links.map((link, index) => (
130
- referenceLink(link, { compact, displayLabel: displayLabels[index] })
131
- ));
126
+ let linkIndex = 0;
127
+ const children = groups.map((group) => {
128
+ const line = document.createElement("div");
129
+ line.className = "github-links-group";
130
+ line.replaceChildren(...group.map((link) => {
131
+ const anchor = referenceLink(link, {
132
+ compact,
133
+ displayLabel: displayLabels[linkIndex],
134
+ });
135
+ linkIndex += 1;
136
+ return anchor;
137
+ }));
138
+ return line;
139
+ });
132
140
  if (task.relatedGitHubLinksTruncated) {
133
141
  const more = document.createElement("span");
134
142
  more.className = "github-links-more";
135
143
  more.textContent = "+ more";
136
144
  more.title = "Additional related GitHub references are omitted from this bounded dashboard view.";
137
145
  more.setAttribute("aria-label", more.title);
138
- children.push(more);
146
+ const finalGroup = children.at(-1);
147
+ if (finalGroup) finalGroup.append(more);
148
+ else children.push(more);
139
149
  }
140
150
  container.hidden = children.length === 0;
141
151
  container.replaceChildren(...children);
@@ -52,6 +52,27 @@ export function githubReferenceDisplayLabels(links, { related = false } = {}) {
52
52
  });
53
53
  }
54
54
 
55
+ function compareReferenceNumbers(left, right) {
56
+ const leftNumber = String(left.number ?? "");
57
+ const rightNumber = String(right.number ?? "");
58
+ return leftNumber.length - rightNumber.length || leftNumber.localeCompare(rightNumber);
59
+ }
60
+
61
+ export function groupRelatedGitHubLinks(links) {
62
+ const groups = new Map();
63
+ const seen = new Set();
64
+ for (const link of links ?? []) {
65
+ if (link.type === "repository" || seen.has(link.label)) continue;
66
+ seen.add(link.label);
67
+ const repository = repositoryIdentity(link);
68
+ if (!repository) continue;
69
+ const group = groups.get(repository) ?? [];
70
+ group.push(link);
71
+ groups.set(repository, group);
72
+ }
73
+ return [...groups.values()].map((group) => [...group].sort(compareReferenceNumbers));
74
+ }
75
+
55
76
  export function githubReferenceAccessibleLabel(link) {
56
77
  const repository = repositoryIdentity(link);
57
78
  if (!repository) return link.label ?? link.text;
@@ -97,9 +97,10 @@ select { min-width: 180px; min-height: 36px; padding: 7px 32px 7px 10px; border:
97
97
  .task-title, .task-summary { overflow-wrap: anywhere; }
98
98
  .task-summary { display: grid; max-width: 82ch; margin-bottom: 12px; gap: 2px; font-size: 0.9rem; line-height: 1.45; }
99
99
  .task-summary strong { margin-top: 4px; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; }
100
- .github-links { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; }
100
+ .github-links { display: grid; gap: 7px; margin: 0 0 18px; }
101
101
  .github-links[hidden] { display: none; }
102
102
  .github-links-compact { margin: -2px 0 12px; gap: 5px; }
103
+ .github-links-group { display: flex; min-width: 0; flex-wrap: wrap; gap: inherit; }
103
104
  .github-link { color: var(--accent); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
104
105
  .github-link-compact { padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-muted); font-size: 0.72rem; line-height: 1.35; text-decoration: none; }
105
106
  .github-link:hover { text-decoration-thickness: 2px; }