Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
210907e
feat(workhub): add versioned routing strategies
ARE404 Aug 29, 2026
ee1da20
feat(workhub): add filtered anchor rail
ARE404 Aug 29, 2026
823770e
fix(workhub): derive rail from active linkage
ARE404 Sep 5, 2026
ffc6e5a
test(workhub): prove routing strategy interchangeability
ARE404 Sep 5, 2026
7a89ac0
refactor(workhub): honor renderer feature boundaries
ARE404 Sep 5, 2026
b182479
refactor(workhub): retire legacy route policy seam
ARE404 Sep 5, 2026
e9a77c5
refactor(workhub): keep rail copy type private
ARE404 Sep 5, 2026
8fb8c0c
fix(workhub): address adversarial review findings
ARE404 Sep 5, 2026
bce8343
docs(workhub): record slice 6 and 8 validation
ARE404 Sep 5, 2026
e50d762
fix(workhub): derive rail linkage from durable assignments
ARE404 Sep 6, 2026
bbaf25f
merge: sync main and preserve WorkHub routing strategies
ARE404 Sep 6, 2026
f8de285
test(workhub): move anchor rail layout checks to Storybook
ARE404 Sep 6, 2026
0179428
docs(workhub): add missing ASF validation report header
ARE404 Sep 6, 2026
f99648e
docs(workhub): register anchor rail in Astryx surface inventory
ARE404 Sep 6, 2026
f63463f
refactor(workhub): compose intent and resolver behind fixed policy
ARE404 Sep 7, 2026
ce72891
fix(workhub): use Astryx list items for anchor navigation
ARE404 Sep 7, 2026
39e1bb1
feat(workhub): add conversation prompt anchors
ARE404 Sep 7, 2026
61a8b30
fix(workhub): preserve full-text routing and simplify experiments
ARE404 Sep 7, 2026
24bb315
merge: sync main and preserve WorkHub chat radius
ARE404 Sep 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions apps/desktop/renderer-architecture.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"src/renderer/locales/shell-copy.ts",
"src/renderer/locales/shell-remaining-copy.ts",
"src/renderer/locales/task-readiness-copy.ts",
"src/renderer/locales/workhub-copy.ts",
"src/renderer/main.tsx",
"src/renderer/mcp-brand-contrast.ts",
"src/renderer/mcp-brand-marks.tsx",
Expand Down Expand Up @@ -247,7 +248,6 @@
"src/renderer/workhub-coordination-host-scope.ts",
"src/renderer/workhub-coordination-lifecycle.ts",
"src/renderer/workhub-coordination-port.ts",
"src/renderer/workhub-route-policy.ts",
"src/renderer/workhub-send-lease.ts",
"src/renderer/workhub-session-port.ts",
"src/renderer/workhub-surface.tsx",
Expand Down Expand Up @@ -1791,6 +1791,15 @@
"actionFactories": [],
"dependencyPaths": {}
},
"src/renderer/locales/workhub-copy.ts": {
"bridgePaths": {},
"environmentCapabilities": {},
"hookCalls": {},
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
},
"src/renderer/mcp-brand-contrast.ts": {
"bridgePaths": {},
"environmentCapabilities": {},
Expand Down Expand Up @@ -4565,7 +4574,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./workhub-route-policy.js": 1
"./features/workhub/index.js": 1
}
},
"src/renderer/workhub-coordination-host-scope.ts": {
Expand Down Expand Up @@ -4603,17 +4612,6 @@
"@maka/core/session": 1
}
},
"src/renderer/workhub-route-policy.ts": {
"bridgePaths": {},
"environmentCapabilities": {},
"hookCalls": {},
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./application/contracts/workhub-request-intent.js": 1
}
},
"src/renderer/workhub-send-lease.ts": {
"bridgePaths": {},
"environmentCapabilities": {
Expand Down Expand Up @@ -4656,6 +4654,8 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./features/workhub/index.js": 1,
"./locales/workhub-copy.js": 1,
"./workhub-coordination-port.js": 1,
"./workhub-send-lease.js": 1,
"@astryxdesign/core": 1,
Expand Down
133 changes: 133 additions & 0 deletions apps/desktop/src/main/__tests__/workhub-anchor-rail.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import assert from "node:assert/strict";
import test from "node:test";
import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import type { WorkHubSessionSummary } from "../../renderer/workhub-controller.js";
import {
deriveWorkHubAnchors,
matchesWorkHubFilter,
MAX_WORKHUB_ANCHORS,
WorkHubNavigationRail,
} from "../../renderer/features/workhub/index.js";
import { getWorkHubRailCopy } from "../../renderer/locales/workhub-copy.js";

function session(
sessionId: string,
state: WorkHubSessionSummary["state"],
updatedAt: number,
archived = false,
): WorkHubSessionSummary {
return {
target: { sessionId },
projectName: "Maka",
sessionName: sessionId,
archived,
state,
updatedAt,
};
}

const sessions = [
session("recent", "active", 100),
session("focus", "running", 10),
session("delegated", "waiting_for_user", 20),
session("blocked", "blocked", 90),
session("stopped", "aborted", 80),
session("archived", "active", 110, true),
];

test("anchors prioritize focus and delegation before recent Session facts", () => {
const before = structuredClone(sessions);
const anchors = deriveWorkHubAnchors({
sessions,
focusSessionId: "focus",
delegatedSessionIds: ["delegated", "focus", "missing"],
filter: "all",
});
assert.deepEqual(sessions, before);
assert.deepEqual(anchors.map((value) => value.target.sessionId),
["focus", "delegated", "archived", "recent", "blocked", "stopped"]);
assert.deepEqual(deriveWorkHubAnchors({ sessions, delegatedSessionIds: ["delegated"], filter: "all" })[0], sessions[2]);
});

test("filters are derived from Session state and archive facts only", () => {
assert.deepEqual(
sessions
.filter((value) => matchesWorkHubFilter(value, "active"))
.map((value) => value.target.sessionId),
["recent", "focus"],
);
assert.deepEqual(
sessions
.filter((value) => matchesWorkHubFilter(value, "attention"))
.map((value) => value.target.sessionId),
["delegated", "blocked"],
);
assert.deepEqual(
sessions
.filter((value) => matchesWorkHubFilter(value, "stopped"))
.map((value) => value.target.sessionId),
["stopped", "archived"],
);
});

test("anchor projection is deduplicated and hard-bounded", () => {
const many = Array.from({ length: 20 }, (_, index) =>
session(`session-${index}`, "active", index),
);
const anchors = deriveWorkHubAnchors({
sessions: [...many, many[0]!, many[4]!],
delegatedSessionIds: [...many, many[0]!].map((value) => value.target.sessionId),
filter: "all",
});
assert.equal(anchors.length, MAX_WORKHUB_ANCHORS);
assert.equal(
new Set(anchors.map((value) => value.target.sessionId)).size,
anchors.length,
);
});

test("rail copy distinguishes bounded anchors from all matching work", () => {
const many = Array.from({ length: 20 }, (_, index) =>
session(`session-${index}`, "active", index),
);
const markup = renderToStaticMarkup(createElement(WorkHubNavigationRail, {
locale: "en",
sessions: many,
delegatedSessionIds: [],
copy: getWorkHubRailCopy("en"),
onOpenSession: () => undefined,
}));

assert.match(markup, /8\/20 anchors · 20 total/u);
assert.equal(markup.match(/<li[ >]/gu)?.length, 8);
});


test("focus display is derived from the selected Session ID, not delegation priority", () => {
const markup = renderToStaticMarkup(createElement(WorkHubNavigationRail, {
locale: "en", sessions, focusSessionId: "focus", delegatedSessionIds: ["delegated"],
copy: getWorkHubRailCopy("en"), onOpenSession: () => undefined,
}));
assert.equal(markup.match(/aria-current="page"/gu)?.length, 1);
assert.equal(markup.match(/Focused · Running/gu)?.length, 1);
});
Loading