+
+ setExpanded(new Set(folderKeys))}
+ />
+ setExpanded(new Set())} />
+
+
+ handleRef={tree}
+ className={styles.filesPopupTree}
+ aria-label={tx("Changed files")}
+ roots={roots}
+ getKey={(n) => n.key}
+ getLabel={(n) => n.label}
+ getChildren={(n) => n.children}
+ isExpandable={(n) => !!n.children}
+ getIcon={(n, open) => (n.children ? (open ? "folder-open" : "folder") : fileIconName(n.label, n.data?.path))}
+ getTooltip={(n) => (n.data ? diffTitle(n.data) : n.label)}
+ expanded={expanded}
+ onExpandedChange={(next) => setExpanded(next)}
+ defaultSelected={[`file:${current}`]}
+ onActivate={(n) => pick(n)}
+ speedSearch
+ speedSearchMode="filter"
+ autoFocus
+ />
+
+ );
+}
diff --git a/src/features/vcs/__tests__/diffToolbar.test.tsx b/src/features/vcs/__tests__/diffToolbar.test.tsx
index f092a47094..2078e5dfd4 100644
--- a/src/features/vcs/__tests__/diffToolbar.test.tsx
+++ b/src/features/vcs/__tests__/diffToolbar.test.tsx
@@ -557,9 +557,9 @@ describe("Compare Previous / Next File buttons (#2492)", () => {
expect(
within(toolbar)
.getAllByRole("button")
- .slice(0, 4)
- .map((b) => b.getAttribute("aria-label")),
- ).toEqual(["Previous Difference", "Next Difference", "Compare Previous File", "Compare Next File"]);
+ .slice(0, 5)
+ .map((b) => b.getAttribute("aria-label") ?? b.textContent),
+ ).toEqual(["Previous Difference", "Next Difference", "Compare Previous File", "2/3 files", "Compare Next File"]);
fireEvent.click(fileButtons()[1]!);
await waitFor(() => expect(openInput).toHaveBeenCalledOnce());
expect(openInput.mock.calls[0]![0].data).toMatchObject({
@@ -577,10 +577,31 @@ describe("Compare Previous / Next File buttons (#2492)", () => {
expect(fileButtons().map((b) => b.hasAttribute("disabled"))).toEqual(disabled);
});
+ it("lists the change set's files under the files counter, as IntelliJ's diff window does", async () => {
+ render(