diff --git a/apps/web/playwright/snapshots/left-panel/room-list-panel/room-list-panel.spec.ts/room-list-panel-smallscreen-linux.png b/apps/web/playwright/snapshots/left-panel/room-list-panel/room-list-panel.spec.ts/room-list-panel-smallscreen-linux.png index dd26980a18..ef53f1d6fb 100644 Binary files a/apps/web/playwright/snapshots/left-panel/room-list-panel/room-list-panel.spec.ts/room-list-panel-smallscreen-linux.png and b/apps/web/playwright/snapshots/left-panel/room-list-panel/room-list-panel.spec.ts/room-list-panel-smallscreen-linux.png differ diff --git a/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-bubble-layout-linux.png b/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-bubble-layout-linux.png index 0acbbbe6f6..9fe134e7f6 100644 Binary files a/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-bubble-layout-linux.png and b/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-bubble-layout-linux.png differ diff --git a/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-irc-layout-linux.png b/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-irc-layout-linux.png index e561564182..04e0a88ffa 100644 Binary files a/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-irc-layout-linux.png and b/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-irc-layout-linux.png differ diff --git a/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-modern-layout-linux.png b/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-modern-layout-linux.png index 01c094c6d0..311df4e505 100644 Binary files a/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-modern-layout-linux.png and b/apps/web/playwright/snapshots/timeline/timeline.spec.ts/long-strings-with-reply-modern-layout-linux.png differ diff --git a/apps/web/src/viewmodels/structures/ResizerViewModel.ts b/apps/web/src/viewmodels/structures/ResizerViewModel.ts index 724bb6fd6e..7e14523590 100644 --- a/apps/web/src/viewmodels/structures/ResizerViewModel.ts +++ b/apps/web/src/viewmodels/structures/ResizerViewModel.ts @@ -57,6 +57,12 @@ export class ResizerViewModel }, 50); public onLeftPanelResized = (newSize: number): void => { + // We don't want the panels to have fractional widths as that can cause blurry UI elements. + if (!Number.isInteger(newSize)) { + this.panelHandle?.resize(`${Math.round(newSize)}%`); + return; + } + const isCollapsed = newSize === 0; // Store the size if the panel isn't collapsed. if (!isCollapsed) { diff --git a/apps/web/test/viewmodels/structures/ResizerViewModel-test.ts b/apps/web/test/viewmodels/structures/ResizerViewModel-test.ts index ea514fdafb..c913eb6fc3 100644 --- a/apps/web/test/viewmodels/structures/ResizerViewModel-test.ts +++ b/apps/web/test/viewmodels/structures/ResizerViewModel-test.ts @@ -105,4 +105,15 @@ describe("LeftPanelResizerViewModel", () => { vm.onBlur(); expect(vm.getSnapshot().isFocusedViaKeyboard).toStrictEqual(false); }); + + it("should resize to nearest whole number", () => { + const vm = new ResizerViewModel(); + const mockHandle = { + resize: jest.fn(), + } as unknown as PanelImperativeHandle; + vm.setPanelHandle(mockHandle); + + vm.onLeftPanelResized(25.515); + expect(mockHandle.resize).toHaveBeenCalledWith("26%"); + }); });