Improve notification view filtering UX
- Add subtitle below the toolbar title to indicate the state of the filter - Add settings icon to take user to the notification settings page, and thus make that more discoverable Testing ------- PASS Device: iPhone 13 mini iOS: 17.6.1 Coverage: 1. Switching back and forth between the notifications tab and other tabs causes subtitle to show/hide as expected in both filter options (all, friends) 2. Subtitle follows the friends filter 3. Subtitle shows after restarting the app 4. Settings icon appears and takes user to the notification setting view 5. Notification settings can be updated from that view. Changelog-Changed: Improve notification view filtering UX Closes: https://github.com/damus-io/damus/issues/2480 Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -77,7 +77,12 @@ struct ContentView: View {
|
||||
|
||||
@State var active_sheet: Sheets? = nil
|
||||
@State var damus_state: DamusState!
|
||||
@SceneStorage("ContentView.selected_timeline") var selected_timeline: Timeline = .home
|
||||
@State var menu_subtitle: String? = nil
|
||||
@SceneStorage("ContentView.selected_timeline") var selected_timeline: Timeline = .home {
|
||||
willSet {
|
||||
self.menu_subtitle = nil
|
||||
}
|
||||
}
|
||||
@State var muting: MuteItem? = nil
|
||||
@State var confirm_mute: Bool = false
|
||||
@State var hide_bar: Bool = false
|
||||
@@ -159,9 +164,16 @@ struct ContentView: View {
|
||||
isSideBarOpened = false
|
||||
}
|
||||
|
||||
var timelineNavItem: Text {
|
||||
return Text(timeline_name(selected_timeline))
|
||||
.bold()
|
||||
var timelineNavItem: some View {
|
||||
VStack {
|
||||
Text(timeline_name(selected_timeline))
|
||||
.bold()
|
||||
if let menu_subtitle {
|
||||
Text(menu_subtitle)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func MainContent(damus: DamusState) -> some View {
|
||||
@@ -180,7 +192,7 @@ struct ContentView: View {
|
||||
PostingTimelineView
|
||||
|
||||
case .notifications:
|
||||
NotificationsView(state: damus, notifications: home.notifications)
|
||||
NotificationsView(state: damus, notifications: home.notifications, subtitle: $menu_subtitle)
|
||||
|
||||
case .dms:
|
||||
DirectMessagesView(damus_state: damus_state!, model: damus_state!.dms, settings: damus_state!.settings)
|
||||
|
||||
Reference in New Issue
Block a user