Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve kebab menu in session overview (PSG-832) #7001

Merged
merged 3 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,14 @@ class UserSessionOverviewUITests: MockScreenTestCase {
XCTAssertTrue(app.staticTexts[VectorL10n.userSessionPushNotifications].exists)
XCTAssertTrue(app.staticTexts[VectorL10n.userSessionPushNotificationsMessage].exists)
}

func test_whenSessionSelected_kebabMenuShows() {
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.otherSession.title)
let navTitle = VectorL10n.userSessionOverviewSessionTitle
let barButton = app.navigationBars[navTitle].buttons["Menu"]
XCTAssertTrue(barButton.exists)
barButton.tap()
XCTAssertTrue(app.buttons[VectorL10n.signOut].exists)
XCTAssertTrue(app.buttons[VectorL10n.manageSessionRename].exists)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,31 @@ struct UserSessionOverview: View {
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Menu {
Button { viewModel.send(viewAction: .renameSession) } label: {
Label(VectorL10n.manageSessionRename, systemImage: "pencil")
SwiftUI.Section {
Button { viewModel.send(viewAction: .renameSession) } label: {
Label(VectorL10n.manageSessionRename, systemImage: "pencil")
}
.accessibilityIdentifier(VectorL10n.manageSessionRename)
}

if #available(iOS 15, *) {
Button(role: .destructive) { viewModel.send(viewAction: .logoutOfSession) } label: {
Label(VectorL10n.signOut, systemImage: "rectangle.portrait.and.arrow.right.fill")
}
.accessibilityIdentifier(VectorL10n.signOut)
} else {
Button { viewModel.send(viewAction: .logoutOfSession) } label: {
Label(VectorL10n.signOut, systemImage: "rectangle.righthalf.inset.fill.arrow.right")
}
.accessibilityIdentifier(VectorL10n.signOut)
}
} label: {
Image(systemName: "ellipsis")
.padding(.horizontal, 4)
.padding(.vertical, 12)
}
.offset(x: 4) // Re-align the symbol after applying padding.
.accessibilityIdentifier("Menu")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this identifier could be a bit more specific ?

}
}
.accentColor(theme.colors.accent)
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-7001.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the sign out option in the menu in the session overview.