Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix space panel subspace indentation going missing #9167

Merged
merged 7 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions cypress/e2e/spaces/spaces.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,34 @@ describe("Spaces", () => {
cy.contains(".mx_SpaceHierarchy_roomTile", "Gaming").should("exist");
});
});

it("should render subspaces in the space panel only when expanded", () => {
cy.injectAxe();

cy.createSpace({
name: "Child Space",
initial_state: [],
}).then(spaceId => {
cy.createSpace({
name: "Root Space",
initial_state: [
spaceChildInitialState(spaceId),
],
}).as("spaceId");
});
cy.get('.mx_SpacePanel .mx_SpaceButton[aria-label="Root Space"]').should("exist");
cy.get('.mx_SpacePanel .mx_SpaceButton[aria-label="Child Space"]').should("not.exist");

cy.checkA11y();
cy.get(".mx_SpacePanel").percySnapshotElement("Space panel collapsed", { widths: [68] });

cy.get(".mx_SpacePanel_toggleCollapse").click({ force: true }); // button shows only on hover
cy.get(".mx_SpacePanel:not(.collapsed)").should("exist");

cy.contains(".mx_SpaceItem", "Root Space").should("exist")
.contains(".mx_SpaceItem", "Child Space").should("exist");

cy.checkA11y();
cy.get(".mx_SpacePanel").percySnapshotElement("Space panel expanded", { widths: [258] });
});
});
5 changes: 5 additions & 0 deletions res/css/structures/_SpacePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ $activeBorderColor: $primary-content;
visibility: hidden;
}
}

.mx_SpaceTreeLevel {
// Indent subspaces
padding-left: 16px;
}
}

.mx_SpaceButton_avatarWrapper {
Expand Down