Collapsible Room List - Clicking on separator should expand to last set width (#32909)

* Expand panel to last known width

* Update test
This commit is contained in:
R Midhun Suresh
2026-03-29 12:23:53 +00:00
committed by GitHub
parent efed7f4e2a
commit 1dbad6101e
2 changed files with 4 additions and 2 deletions
@@ -75,7 +75,8 @@ export class ResizerViewModel
public onSeparatorClick = (): void => { public onSeparatorClick = (): void => {
if (this.panelHandle?.isCollapsed()) { if (this.panelHandle?.isCollapsed()) {
this.panelHandle.resize(`100%`); const lastSize = SettingsStore.getValue("RoomList.panelSize");
this.panelHandle.resize(`${lastSize}%`);
} }
}; };
@@ -70,6 +70,7 @@ describe("LeftPanelResizerViewModel", () => {
it("should expand panel on onSeparatorClick()", () => { it("should expand panel on onSeparatorClick()", () => {
const vm = new ResizerViewModel(); const vm = new ResizerViewModel();
SettingsStore.setValue("RoomList.panelSize", null, SettingLevel.DEVICE, 34);
const mockHandle = { const mockHandle = {
resize: jest.fn(), resize: jest.fn(),
isCollapsed: jest.fn().mockReturnValue(true), isCollapsed: jest.fn().mockReturnValue(true),
@@ -78,7 +79,7 @@ describe("LeftPanelResizerViewModel", () => {
vm.onSeparatorClick(); vm.onSeparatorClick();
expect(mockHandle.resize).toHaveBeenCalledWith("100%"); expect(mockHandle.resize).toHaveBeenCalledWith("34%");
}); });
it("should set isFocusedViaKeyboard state correctly", () => { it("should set isFocusedViaKeyboard state correctly", () => {