Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions apps/staged/src/lib/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,16 +802,6 @@ export function getDeletedComments(reviewId: string): Promise<Comment[]> {
return invoke('get_deleted_comments', { reviewId });
}

/** Add a reference file to a review. */
export function addReferenceFile(reviewId: string, path: string): Promise<void> {
return invoke('add_reference_file', { reviewId, path });
}

/** Remove a reference file from a review. */
export function removeReferenceFile(reviewId: string, path: string): Promise<void> {
return invoke('remove_reference_file', { reviewId, path });
}

// =============================================================================
// Auto review
// =============================================================================
Expand Down
22 changes: 3 additions & 19 deletions apps/staged/src/lib/features/diff/DiffModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

Opened from a branch card or timeline item. Contains:
- DiffViewer (renders the selected file's diff)
- File sidebar on the right with tree view, review status, reference files, comments
- File sidebar on the right with tree view, review status, comments

Props: branchId, commitSha (optional), scope, onClose.

State management:
- diffViewerState: file list + on-demand diff cache
- reviewState: lazy review creation, comments, reviewed paths, reference files
- reviewState: lazy review creation, comments, reviewed paths
-->
<script lang="ts">
import { onMount, onDestroy } from 'svelte';
Expand All @@ -30,7 +30,6 @@
import DiffCommentsSection from './DiffCommentsSection.svelte';
import DiffFileTreeSection from './DiffFileTreeSection.svelte';
import DiffCommitSessionLauncher from './DiffCommitSessionLauncher.svelte';
import DiffReferenceSection from './DiffReferenceSection.svelte';
import NewSessionModal from '../sessions/NewSessionModal.svelte';
import { createDiffViewerState } from './diffViewerState.svelte';
import { createReviewState } from './reviewState.svelte';
Expand Down Expand Up @@ -81,7 +80,7 @@
beforeLabel?: string;
/** Label for the after pane header. */
afterLabel?: string;
/** When true, hides commenting, reference files, and review status. */
/** When true, hides commenting and review status. */
readonly?: boolean;
/** Available commits for the context switcher dropdown. */
commits?: CommitTimelineItem[];
Expand Down Expand Up @@ -809,10 +808,6 @@
}
}

async function handleRemoveReferenceFile(path: string) {
await reviewHandle?.removeReferenceFile(path);
}

/** Resolve a comment's path to a file-list path.
* Falls back to the comment's own path if no match is found. */
function resolveCommentPath(commentPath: string): string {
Expand Down Expand Up @@ -1144,17 +1139,6 @@
diffViewerState={diffViewer}
/>
{#if !readonly}
<DiffReferenceSection
referenceFiles={reviewHandle?.state.referenceFiles ?? []}
selectedFile={diffViewer.state.selectedFile}
onSelectFile={(path) => {
selectedCommentId = null;
if (isSmallDiffViewport) showMobileSidebar = false;
diffViewer.selectFile(path);
}}
onRemoveReferenceFile={handleRemoveReferenceFile}
/>

<DiffCommentsSection
comments={currentComments}
deletedComments={reviewHandle?.state.deletedComments ?? []}
Expand Down
224 changes: 0 additions & 224 deletions apps/staged/src/lib/features/diff/DiffReferenceSection.svelte

This file was deleted.

2 changes: 1 addition & 1 deletion apps/staged/src/lib/features/diff/reviewState.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Re-export types from shared package
export { type ReviewState, type ReferenceFile } from '@builderbot/diff-viewer/state';
export { type ReviewState } from '@builderbot/diff-viewer/state';

// Re-export with Staged's Tauri commands pre-bound
import * as commands from '../../api/commands';
Expand Down
2 changes: 1 addition & 1 deletion packages/diff-viewer/src/lib/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export {
type DiffViewerState,
} from './diffViewerState.svelte';

export { createReviewState, type ReviewState, type ReferenceFile } from './reviewState.svelte';
export { createReviewState, type ReviewState } from './reviewState.svelte';

export { createScrollController } from './scrollController.svelte';

Expand Down
Loading