areibman / areibman/bottleneck

Feature: Show special icon for deleted files in PR diff view

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
156
Forks
21
PR merge metrics
No merged PRs in 30d

Description

## Feature Request

Display a special icon/indicator for deleted files in the PR diff view, similar to how newly added files are shown with a special icon.

## Current Behavior

- New/added files may have a special icon or indicator
- Deleted files don't have a clear visual distinction
- Users need to read the diff header or stats to know a file was deleted

## Expected Behavior

- Deleted files should have a distinctive icon (e.g., πŸ—‘οΈ, ❌, or a red minus icon)
- Visual consistency with how added files are displayed
- Clear visual hierarchy: Added (green/+), Modified (yellow/~), Deleted (red/-)

## Implementation

### File Status Icons
```typescript
interface FileStatus {
type: 'added' | 'modified' | 'deleted' | 'renamed' | 'copied';
icon: string;
className: string;
label: string;
}

const FILE_STATUS_CONFIG: Record = {
added: {
type: 'added',
icon: '✨', // or 'βž•' or custom SVG
className: 'file-added',
label: 'New file'
},
modified: {
type: 'modified',
icon: 'πŸ“', // or '✏️' or custom SVG
className: 'file-modified',
label: 'Modified'
},
deleted: {
type: 'deleted',
icon: 'πŸ—‘οΈ', // or '❌' or 'βž–' or custom SVG
className: 'file-deleted',
label: 'Deleted'
},
renamed: {
type: 'renamed',
icon: 'πŸ“‹', // or '➑️' or custom SVG
className: 'file-renamed',
label: 'Renamed'
},
copied: {
type: 'copied',
icon: 'πŸ“„', // or custom SVG
className: 'file-copied',
label: 'Copied'
}
};
```

### Component Implementation
```tsx
function FileListItem({ file }) {
const status = getFileStatus(file);

return (



{status.icon}



{file.status === 'renamed' ? (
<>
{file.previous_filename}
β†’
{file.filename}

) : (

{file.filename}

)}



{file.status !== 'deleted' && (
+{file.additions}
)}
{file.status !== 'added' && (
-{file.deletions}
)}


);
}

function getFileStatus(file): FileStatus {
if (file.status === 'removed') {
return FILE_STATUS_CONFIG.deleted;
}
if (file.status === 'added') {
return FILE_STATUS_CONFIG.added;
}
if (file.status === 'renamed') {
return FILE_STATUS_CONFIG.renamed;
}
if (file.status === 'copied') {
return FILE_STATUS_CONFIG.copied;
}
return FILE_STATUS_CONFIG.modified;
}
```

### Styling
```css
.file-item {
display: flex;
align-items: center;
padding: 8px 12px;
border-radius: 4px;
transition: background-color 0.2s;
}

.file-item:hover {
background-color: var(--hover-bg);
}

.file-status-icon {
margin-right: 8px;
font-size: 16px;
flex-shrink: 0;
}

/* File status specific styles */
.file-added {
border-left: 3px solid var(--color-success);
}

.file-added .file-status-icon {
color: var(--color-success);
}

.file-modified {
border-left: 3px solid var(--color-warning);
}

.file-modified .file-status-icon {
color: var(--color-warning);
}

.file-deleted {
border-left: 3px solid var(--color-danger);
opacity: 0.8;
}

.file-deleted .file-status-icon {
color: var(--color-danger);
}

.file-deleted .file-path {
text-decoration: line-through;
opacity: 0.7;
}

.file-renamed {
border-left: 3px solid var(--color-info);
}

.file-renamed .file-status-icon {
color: var(--color-info);
}

.rename-arrow {
margin: 0 8px;
color: var(--text-secondary);
}

/* Alternative: Use background colors */
.file-added-alt {
background-color: rgba(46, 160, 67, 0.1);
}

.file-deleted-alt {
background-color: rgba(248, 81, 73, 0.1);
}

.file-modified-alt {
background-color: rgba(250, 179, 0, 0.1);
}
```

### Alternative Icon Approaches

#### 1. SVG Icons
```tsx
const FileStatusIcons = {
added: (

),
deleted: (

),
modified: (

)
};
```

#### 2. Text Indicators
```tsx
const FileStatusBadges = {
added: NEW,
deleted: DELETED,
modified: MODIFIED,
renamed: RENAMED
};
```

### Diff Header Enhancement
```tsx
function DiffFileHeader({ file }) {
const status = getFileStatus(file);

return (




{status.icon}



{file.status === 'deleted' ? (
{file.filename}
) : (
file.filename
)}


{file.status === 'deleted' && (

This file was deleted

)}


{file.status === 'deleted' && (


{file.deletions} lines removed


viewDeletedContent(file)}>
View deleted content


)}

);
}
```

### Accessibility Considerations
```tsx
function AccessibleFileStatus({ file }) {
const status = getFileStatus(file);

return (
<>

{status.icon}


{status.label}: {file.filename}


);
}
```

## Visual Examples

```
File List View:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ✨ src/newFeature.js +150 -0 β”‚ ← Added (green)
β”‚ πŸ“ src/existing.js +20 -15 β”‚ ← Modified (yellow)
β”‚ πŸ—‘οΈ src/deprecated.js -0 -200 β”‚ ← Deleted (red)
β”‚ πŸ“‹ src/old.js β†’ src/new.js +10 -5 β”‚ ← Renamed (blue)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Compact View:
[✨] newFile.js
[πŸ“] modified.js
[πŸ—‘οΈ] deleted.js (strikethrough)
[πŸ“‹] renamed.js
```

## Benefits

- **Visual Clarity**: Instantly see which files were deleted
- **Consistency**: Similar UX pattern to added files
- **Improved Scanning**: Easier to spot deleted files in long PR lists
- **Accessibility**: Clear indicators for all users
- **Reduced Cognitive Load**: No need to parse diff stats

## Acceptance Criteria

- [ ] Deleted files show a distinctive icon
- [ ] Icon is visually consistent with added file icon style
- [ ] Deleted file names may have strikethrough styling
- [ ] Icon has proper accessibility labels
- [ ] Works in all file list views (tree view, flat view)
- [ ] Shows in PR file list
- [ ] Shows in diff headers
- [ ] Color scheme works in both light and dark themes
- [ ] Tooltip shows "Deleted" on hover
- [ ] Visual hierarchy is clear (added vs modified vs deleted)

## Future Enhancements

- Animated transitions when files change status
- Filter to show only deleted files
- Bulk restore deleted files option
- Show deletion reason if available from commit message

πŸ€– Generated with [Claude Code](https://claude.ai/code)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the PR diff view and trace how file entries are rendered in the tree view, flat view, and diff headers. Compare the existing added-file indicator with the requested deleted-file treatment, then verify the acceptance criteria across both light and dark themes, including accessibility labels and the β€œDeleted” tooltip.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
desktop, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.