web: fix artifact, chat, attention and timeline accessibility findings
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user