make the jobs back button a link, delete the backbutton nobody used
The audit said adopt the shared BackButton. It is not shared: zero importers since the initial commit, no barrel entry, and a label-plus-underline shape that fits none of the icon-only back controls here. Adopting it would have redesigned the Jobs header under cover of a navigation fix. So: a Link, matching what ScriptJobDetail and DownloadJobDetail already do, and the dead component goes. useNavigate had no other caller in PipelineJobDetail and goes with it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useRef, useCallback, useMemo, createContext, useContext } from 'react';
|
||||
import { useParams, useNavigate, Link } from 'react-router';
|
||||
import { useParams, Link } from 'react-router';
|
||||
import {
|
||||
ArrowLeft, CheckCircle2, AlertCircle, Loader2, StopCircle, AlertTriangle, Clock, Square,
|
||||
ChevronRight, Wrench,
|
||||
@@ -332,7 +332,6 @@ const OutputPanel = () => {
|
||||
|
||||
export const PipelineJobDetail = () => {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const navigate = useNavigate();
|
||||
const client = useClient();
|
||||
|
||||
const [job, setJob] = useState<JobData | null>(null);
|
||||
@@ -706,9 +705,10 @@ export const PipelineJobDetail = () => {
|
||||
{/* Header + stats bar */}
|
||||
<Card className="px-4 py-3 shrink-0">
|
||||
<div className="flex items-center gap-3">
|
||||
<button onClick={() => navigate('/jobs')} className="p-1 rounded hover:bg-duck-dark/10 cursor-pointer">
|
||||
{/* The other two job detail panes already do this; this was the last imperative back in Jobs. */}
|
||||
<Link to="/jobs" aria-label="Back to jobs" className="p-1 rounded hover:bg-duck-dark/10 cursor-pointer">
|
||||
<ArrowLeft className="h-4 w-4 text-duck-dark/60" />
|
||||
</button>
|
||||
</Link>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<StatusIcon status={displayStatus} className="h-5 w-5" />
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import { Link } from 'react-router';
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
import { cn } from 'helpers/cn';
|
||||
|
||||
type BackButtonProps = { label: string; href: string; className?: string };
|
||||
export const BackButton = ({ label, href, className }: BackButtonProps) => {
|
||||
return (
|
||||
<Link to={href} className={cn('flex items-center text-lg text-gray-600 underline dark:text-gray-300', className)}>
|
||||
<ArrowLeft className="mr-1 h-4 w-4" />
|
||||
{label}
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user