feat(web): enhanced file panel — side-by-side diff, hide whitespace, inline review
Adds DiffSplitView component for side-by-side diff mode, whitespace-only change filtering, inline review comments with thread/gutter cell UI, diff preferences persistence, and write-file API support for in-browser editing. Backend: hideWhitespace param on git diff endpoint, write_file route.
This commit is contained in:
43
apps/web/src/components/InlineReviewGutterCell.tsx
Normal file
43
apps/web/src/components/InlineReviewGutterCell.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { cn } from '@/lib/utils';
|
||||
import { Plus } from 'lucide-react';
|
||||
|
||||
interface InlineReviewGutterCellProps {
|
||||
lineNumber: number | null;
|
||||
type: 'add' | 'remove' | 'context' | 'header' | null;
|
||||
hasComments: boolean;
|
||||
canComment: boolean;
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
export function InlineReviewGutterCell({
|
||||
lineNumber,
|
||||
type,
|
||||
hasComments,
|
||||
canComment,
|
||||
onClick,
|
||||
}: InlineReviewGutterCellProps) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'relative flex items-center justify-end pr-1 min-w-[40px] h-5 text-[11px] font-mono select-none',
|
||||
type === 'add' && 'bg-green-950/30',
|
||||
type === 'remove' && 'bg-red-950/30',
|
||||
type === 'context' && 'bg-muted/10',
|
||||
canComment && 'cursor-pointer group',
|
||||
)}
|
||||
onClick={canComment ? onClick : undefined}
|
||||
>
|
||||
<span className="text-muted-foreground/70">
|
||||
{lineNumber != null ? lineNumber : ''}
|
||||
</span>
|
||||
{canComment && (
|
||||
<span className="absolute left-0.5 hidden group-hover:flex items-center justify-center w-4 h-4 rounded text-muted-foreground hover:text-foreground">
|
||||
<Plus size={12} />
|
||||
</span>
|
||||
)}
|
||||
{hasComments && (
|
||||
<span className="absolute left-0.5 w-1.5 h-1.5 rounded-full bg-blue-400" />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user