web: fix artifact, chat, attention and timeline accessibility findings

This commit is contained in:
2026-10-19 18:09:42 +01:00
parent 321e046377
commit 3bd721bc93
6 changed files with 122 additions and 33 deletions
+17 -4
View File
@@ -850,7 +850,14 @@ function renderArtifactTile(artifact, viewable, viewerIndexOf) {
const kind = artifactKind(artifact.content_type, artifact.name);
const media = kind === ArtifactKind.Image || kind === ArtifactKind.Video;
const name = artifact.name || "(unnamed artifact)";
const tile = h("div", { class: "artifact-tile clickable" });
// The tile is the native control (M5): Enter/Space activate it for free, and
// the Copy link / Share buttons are siblings in the wrapper, never children.
const wrap = h("div", { class: "artifact-tile-wrap" });
const tile = h("button", {
class: "artifact-tile clickable",
type: "button",
"aria-label": `Open ${name}`,
});
const openViewer = () => {
const at = viewerIndexOf.get(artifact.url);
if (at != null) openArtifactViewer(viewable, at);
@@ -864,7 +871,13 @@ function renderArtifactTile(artifact, viewable, viewerIndexOf) {
tile.append(img);
tile.addEventListener("click", openViewer);
} else if (kind === ArtifactKind.Video) {
tile.append(h("div", { class: "artifact-poster" }, h("span", { class: "artifact-play", text: "▶" })));
tile.append(
h(
"div",
{ class: "artifact-poster" },
h("span", { class: "artifact-play", "aria-hidden": "true", text: "▶" }),
),
);
tile.append(h("div", { class: "artifact-name", text: name }));
tile.addEventListener("click", openViewer);
} else {
@@ -875,8 +888,8 @@ function renderArtifactTile(artifact, viewable, viewerIndexOf) {
);
tile.addEventListener("click", openTab);
}
tile.append(renderTileActions(resolved, media));
return tile;
wrap.append(tile, renderTileActions(resolved, media));
return wrap;
}
/** The compact per-tile actions: copy-link (non-media tiles) and share. */