feat(replay-ui): show spec filename with full path on hover

RunList and RunDetail now render the basename of spec_path (e.g.
login.spec.ts) with the full path available as a title tooltip.
This commit is contained in:
pj committed 2026-06-03 16:16:58 +05:30
1 parent 4f381841dd
commit f0d84cb794
2 files changed
+12 -2

No files matched your search

+6 -1
View File
@@ -15,6 +15,11 @@ import { useStep } from "../hooks/useStep";
import { useKeyboardNav } from "../hooks/useKeyboardNav";
import { useTheme } from "../hooks/useTheme";
function basename(specPath: string): string {
const index = specPath.lastIndexOf("/");
return index >= 0 ? specPath.slice(index + 1) : specPath;
}
interface RunHistory {
names: string[];
lanes: PropertyLane[];
@@ -242,7 +247,7 @@ export default function RunDetail() {
<Link to="/">runs</Link>
<span>{run.id}</span>
<span>
<strong>{run.spec_path}</strong> seed={run.seed}
<strong title={run.spec_path}>{basename(run.spec_path)}</strong> seed={run.seed}
</span>
<span>
step {stepIndex} / {stepCount ?? 0}
+6 -1
View File
@@ -28,6 +28,11 @@ function formatStartedAt(value: string): string {
return date.toLocaleString();
}
function basename(specPath: string): string {
const index = specPath.lastIndexOf("/");
return index >= 0 ? specPath.slice(index + 1) : specPath;
}
export default function RunList() {
const [runs, setRuns] = useState<RunSummary[] | null>(null);
const [error, setError] = useState<string | null>(null);
@@ -76,7 +81,7 @@ export default function RunList() {
<td>
<Link to={`/runs/${run.id}`}>{formatStartedAt(run.started_at)}</Link>
</td>
<td>{run.spec_path}</td>
<td title={run.spec_path}>{basename(run.spec_path)}</td>
<td>{run.seed}</td>
<td>{run.platform}</td>
<td>{formatDuration(run.duration_millis)}</td>