Порівняти коміти

..
Автор SHA1 Повідомлення Дата
l0ng-ai cd89f57c5f fix(app): Close Project asks about untitled buffers instead of dropping them 2026-11-16 18:37:14 +08:00
6 змінених файлів з 13 додано та 26 видалено

No files matched your search

+1 -2
Переглянути файл
@@ -295,10 +295,9 @@ export const lspTheme = EditorView.theme({
padding: "6px 10px",
borderRadius: "var(--radius-popup)",
boxShadow: "var(--shadow-popup)",
maxWidth: "480px",
whiteSpace: "pre-wrap",
},
// The hint is the tooltip element itself: beat the editor theme's `.cm-tooltip` width.
".cm-tooltip.cm-lsp-hint": { maxWidth: "min(480px, 100%)" },
".cm-lsp-hint-error": {
backgroundColor: "var(--bg-feedback-error, color-mix(in srgb, var(--danger) 8%, var(--bg-popup)))",
borderColor: "color-mix(in srgb, var(--danger) 35%, var(--border-popup))",
-3
Переглянути файл
@@ -71,9 +71,6 @@
display: flex;
flex-direction: column;
}
.body[hidden] {
display: none;
}
/* Space a block takes before its diff loads, so the scrollbar is roughly right. */
.placeholder {
height: 160px;
+8 -9
Переглянути файл
@@ -98,15 +98,14 @@ function Block({
/>
)}
</div>
{/* A collapsed block keeps its loaded diff, hidden: unmounting it would release the
working-tree document and, with autosave off, drop its unsaved edits. */}
{near ? (
<div className={styles.body} hidden={collapsed}>
<DiffEditor input={input} fit />
</div>
) : (
!collapsed && <div className={styles.placeholder} />
)}
{!collapsed &&
(near ? (
<div className={styles.body}>
<DiffEditor input={input} fit />
</div>
) : (
<div className={styles.placeholder} />
))}
</section>
);
}
+4 -8
Переглянути файл
@@ -83,24 +83,20 @@ describe("the all-in-one diff tab", () => {
expect(screen.getAllByText("src")).toHaveLength(2);
});
it("collapses a file and all files, keeping their diffs (and unsaved edits) loaded", () => {
it("collapses a file and all files", () => {
render(<CombinedDiffTab input={input} />);
const shown = () => screen.queryAllByTestId("block-diff").filter((b) => !b.closest("[hidden]"));
const first = screen.getAllByTestId("block-diff")[0]!;
act(() => {
fireEvent.click(screen.getAllByRole("button", { name: "Collapse File" })[0]!);
});
expect(shown()).toHaveLength(2);
expect(screen.getAllByTestId("block-diff")).toHaveLength(2);
act(() => {
fireEvent.click(screen.getByRole("button", { name: "Collapse All Files" }));
});
expect(shown()).toHaveLength(0);
expect(screen.queryAllByTestId("block-diff")).toHaveLength(0);
act(() => {
fireEvent.click(screen.getByRole("button", { name: "Expand All Files" }));
});
expect(shown()).toHaveLength(3);
// The same diff all along: collapsing never released its document.
expect(screen.getAllByTestId("block-diff")[0]).toBe(first);
expect(screen.getAllByTestId("block-diff")).toHaveLength(3);
});
it("switches every block between side-by-side and unified", () => {
-1
Переглянути файл
@@ -105,7 +105,6 @@
display: flex;
gap: 10px;
width: 340px;
max-width: 100%;
/* Never grow past the window: the close button must stay reachable. */
max-height: calc(100vh - 48px);
padding: 14px 34px 14px 14px;
-3
Переглянути файл
@@ -2,8 +2,6 @@
position: fixed;
/* Inside the editor island's bottom-right corner, clear of the right stripe. */
right: 78px;
/* A narrow window narrows the balloons instead of pushing them off its left edge. */
left: 16px;
bottom: calc(var(--h-statusbar) + 16px);
/* Balloons belong to the main window: modal dialogs cover them, like IDEA. */
z-index: calc(var(--z-dialog) - 1);
@@ -14,7 +12,6 @@
pointer-events: none;
}
.balloon {
max-width: 100%;
pointer-events: auto;
animation: slideIn var(--dur) var(--ease);
}