Skip to content

Commit 715d8d7

Browse files
FindHaofacebook-github-bot
authored andcommitted
PR4: file diff mvp (#112)
Summary: - Introduces `FileDiffView` for comparing any two kernels within the same input file. - Supports Single IR (dropdown including Python) and All IRs (collapsible sections including Python) modes. - Synchronizes URL parameters for shareability (debounced) while avoiding local file leakage. #### Key Changes - New file: `website/src/pages/FileDiffView.tsx` with dual-source controls and kernel selectors for left/right. - Debounced sync of `mode`, `ir`, `ignore_ws`, `word_level`, `context`, `wrap`, `only_changed` to URL. - Adds buttons to preview either side in `Kernel Overview` or `IR Code` via FileDiffSession navigation. Pull Request resolved: #112 Reviewed By: sfzhu93 Differential Revision: D82745888 Pulled By: FindHao fbshipit-source-id: a3886ab523753cc20cdaa7b2490423bf638e2d8c
1 parent e72b783 commit 715d8d7

File tree

2 files changed

+651
-4
lines changed

2 files changed

+651
-4
lines changed

website/src/App.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from "./utils/dataLoader";
1010
import { checkFbDirectoryExists } from "./utils/fbDetection";
1111
import CodeView from "./pages/CodeView";
12+
import FileDiffView from "./pages/FileDiffView";
1213
import SingleCodeViewer from "./components/SingleCodeViewer";
1314
import KernelOverview from "./pages/KernelOverview";
1415
import DataSourceSelector from "./components/DataSourceSelector";
@@ -362,10 +363,11 @@ function App() {
362363
}
363364
if (activeTab === "file_diff") {
364365
return (
365-
<div className="p-6 text-gray-700">
366-
<div className="text-lg font-semibold mb-2">File Diff</div>
367-
<div>This view is available. Detailed functionality will be introduced in subsequent changes.</div>
368-
</div>
366+
<FileDiffView
367+
kernelsLeft={kernels}
368+
selectedLeftIndex={Math.max(0, selectedKernel)}
369+
leftLoadedUrl={loadedUrl}
370+
/>
369371
);
370372
}
371373
return null;

0 commit comments

Comments
 (0)