@@ -28,6 +28,12 @@ import { createOpenSessionFileTab, createSessionTabs, getTabReorderIndex, type S
2828import { setSessionHandoff } from "@/pages/session/handoff"
2929import { useSessionLayout } from "@/pages/session/session-layout"
3030
31+ type RenderDiff = ( SnapshotFileDiff & { file : string } ) | VcsFileDiff
32+
33+ function renderDiff ( value : SnapshotFileDiff | VcsFileDiff ) : value is RenderDiff {
34+ return typeof value . file === "string"
35+ }
36+
3137export function SessionSidePanel ( props : {
3238 canReview : ( ) => boolean
3339 diffs : ( ) => ( SnapshotFileDiff | VcsFileDiff ) [ ]
@@ -70,7 +76,8 @@ export function SessionSidePanel(props: {
7076 } )
7177 const treeWidth = createMemo ( ( ) => ( fileOpen ( ) ? `${ layout . fileTree . width ( ) } px` : "0px" ) )
7278
73- const diffFiles = createMemo ( ( ) => props . diffs ( ) . map ( ( d ) => d . file ) )
79+ const diffs = createMemo ( ( ) => props . diffs ( ) . filter ( renderDiff ) )
80+ const diffFiles = createMemo ( ( ) => diffs ( ) . map ( ( d ) => d . file ) )
7481 const kinds = createMemo ( ( ) => {
7582 const merge = ( a : "add" | "del" | "mix" | undefined , b : "add" | "del" | "mix" ) => {
7683 if ( ! a ) return b
@@ -81,7 +88,7 @@ export function SessionSidePanel(props: {
8188 const normalize = ( p : string ) => p . replaceAll ( "\\\\" , "/" ) . replace ( / \/ + $ / , "" )
8289
8390 const out = new Map < string , "add" | "del" | "mix" > ( )
84- for ( const diff of props . diffs ( ) ) {
91+ for ( const diff of diffs ( ) ) {
8592 const file = normalize ( diff . file )
8693 const kind = diff . status === "added" ? "add" : diff . status === "deleted" ? "del" : "mix"
8794
0 commit comments