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 17:53:53 +05:30
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 => {
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()", () => {
const vm = new ResizerViewModel();
SettingsStore.setValue("RoomList.panelSize", null, SettingLevel.DEVICE, 34);
const mockHandle = {
resize: jest.fn(),
isCollapsed: jest.fn().mockReturnValue(true),
@@ -78,7 +79,7 @@ describe("LeftPanelResizerViewModel", () => {
vm.onSeparatorClick();
expect(mockHandle.resize).toHaveBeenCalledWith("100%");
expect(mockHandle.resize).toHaveBeenCalledWith("34%");
});
it("should set isFocusedViaKeyboard state correctly", () => {