fix(workboard): find cards by their own IDs (#155033)

Closes #154984

## What Problem This Solves

Fixes: Workboard search hides a loaded card when an operator pastes its own ID or a UUID prefix.

## User Impact

Operators can find a card using the identifier supplied by an agent, including case-insensitive prefixes. Existing title, linked-card-ID and other filters remain in effect. No configuration or data migration is required.

## Why This Change Was Made

Include the card's own ID in the existing search candidates. This reuses the current normalization and substring matching rather than adding another search path.

## Evidence

- [Inspected before/after screenshots](https://github.com/openclaw/openclaw/pull/155033#issuecomment-5765615256) show the same full-ID query changing from no matching cards to the exact card.
- Reproduced through the actual registered Workboard page in Chromium on current base `e43f515442db`: the full synthetic UUID, its prefix and uppercase prefix returned no cards, while title and linked-ID searches worked.
- The candidate on the same maintained mocked-Gateway fixture returns the exact card for those ID queries. Title, linked-ID, unrelated-query and status-filter controls also passed. These are real UI interactions with synthetic Gateway data, not a reconstructed page or an operator Gateway.
- The new typed regression fails on the original owner and passes after the one-line repair. It also preserves priority filtering. One focused regression replaces the contributor's five overlapping helper cases; no test-only production seam was added.
- All 173 focused helper/view tests passed. The new case took 2 ms; the two-file run took 8.43 s wall time, including runner preparation.
- Retained scoped type-aware lint, formatting, both source-size ratchets and whitespace checks passed for the unchanged browser source and regression.
- Hosted CI caught a stale generated Workboard UI asset declaration. Regenerated only Workboard through its maintained build hook; a fresh scoped hook run now leaves no changed committed generated outputs.
- The declaration now names the exact `f2cce023158a` asset generation used in the screenshots. Browser source, tests and those JS/CSS bytes are unchanged, so the existing behavior proof is retained rather than replayed. No new repository-wide test or build replay was run for this generated-output correction.

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
This commit is contained in:
Aniket Kumar
2026-09-22 02:10:13 +05:30
committed by GitHub
co-authored by Ayaan Zaidi
parent 53902751b2
commit 267bb9d27f
3 changed files with 15 additions and 2 deletions
@@ -0,0 +1,12 @@
import "../../test/dom.setup.ts";
import { expect, it } from "vitest";
import { createWorkboardCard } from "../../lib/workboard/test/index-helpers.ts";
import { matchesFilter } from "./view-helpers.ts";
it("matches card ID prefixes without bypassing the priority filter", () => {
const card = createWorkboardCard({ id: "123e4567-e89b-12d3-a456-426614174000" });
const query = " 123E4567-E89B ";
expect(matchesFilter(card, { query, priority: "all" })).toBe(true);
expect(matchesFilter(card, { query, priority: "high" })).toBe(false);
});
@@ -187,6 +187,7 @@ export function matchesFilter(
return true;
}
return [
card.id,
card.title,
card.notes,
card.agentId,
+2 -2
View File
@@ -223,9 +223,9 @@
"properties": {}
},
"controlUi": {
"entry": "dist/control-ui/13b6bea13c6ab02980e511c6ede160d1f15d9c27521a6af50c78f5a89ff40fd7/index.js",
"entry": "dist/control-ui/f2cce023158abdb59a5c4d2e54a4d050f7c27c34f7071b5fd48861ea48640668/index.js",
"styles": [
"dist/control-ui/13b6bea13c6ab02980e511c6ede160d1f15d9c27521a6af50c78f5a89ff40fd7/index.css"
"dist/control-ui/f2cce023158abdb59a5c4d2e54a4d050f7c27c34f7071b5fd48861ea48640668/index.css"
]
}
}