Files
archie/ui/src/dashboard/ActivityRow.vue
T
sam ef623f6c68
Quality / check (push) Successful in 6m40s
deploy / gate (push) Successful in 4m59s
deploy / archied-image (push) Successful in 3m29s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
fix(ui): rows keep table semantics; first-cell link/button is the focus target (#1750)
DataTable, ActivityRow, LiveActivityCard's group row and CaptureRow no
longer put role=link/button, tabindex or aria-label on the <tr>. The row
keeps its mouse click handler; the first cell carries a real RouterLink
(DataTable rowLink) or button with the accessible name, so keyboard and
screen-reader users get a focus target and rows keep row/cell semantics.
The live-activity group row's disclosure button and open button are now
siblings, not nested.
2026-11-07 00:00:41 +11:00

65 lines
2.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { computed } from "vue";
import { TableCell, TableRow } from "@/components/ui/table";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { Timestamp } from "@/components/ui/timestamp";
import { useOrgStore } from "@/stores/org";
import { activityDetail } from "./activity-detail";
import { describeTimelineEvent } from "@/tasks/timeline-event";
import { useTasksStore, type ActivityEvent } from "@/stores/tasks";
const identities = useOrgStore();
identities.watchIdentities();
/**
* One row of the live activity table. A row whose event resolves to a task is
* a link to it, and has to behave like one for a keyboard: Enter and Space both
* open it, which is why it is focusable and carries role="link".
*/
const props = defineProps<{ event: ActivityEvent }>();
const emit = defineEmits<{ open: [taskID: number] }>();
const tasks = useTasksStore();
const taskID = computed(() => tasks.taskIDFor(props.event));
// The detail is cut to one line by activityDetail and clamped again in the
// cell so a long unbroken token (a path, a URL, a hash) cannot widen the column
// past the table.
const detail = computed(() => activityDetail(props.event, identities.identityName));
function open() {
if (taskID.value > 0) emit("open", taskID.value);
}
</script>
<template>
<TableRow
:class="taskID > 0 ? 'cursor-pointer' : ''"
@click="open"
>
<TableCell class="font-medium">
<button
v-if="taskID > 0"
type="button"
class="rounded-sm text-left focus-visible:outline-2 focus-visible:outline-ring"
aria-label="Open task details"
@click.stop="open"
>{{ describeTimelineEvent({ ...props.event, at: undefined, detail: undefined }).title }}</button>
<template v-else>{{ describeTimelineEvent({ ...props.event, at: undefined, detail: undefined }).title }}</template>
</TableCell>
<TableCell class="font-mono">{{
taskID > 0 ? `#${taskID}` : "–"
}}</TableCell>
<TableCell class="w-[55%] max-w-0">
<Tooltip>
<TooltipTrigger as-child>
<span tabindex="0" class="block truncate">{{ detail.text }}</span>
</TooltipTrigger>
<TooltipContent v-if="detail.truncated">{{ detail.full }}</TooltipContent>
</Tooltip>
</TableCell>
<TableCell><Timestamp :at="event.at" /></TableCell>
</TableRow>
</template>