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