From ed9971f84f0d4d11bcc77b3ede373673d10494b0 Mon Sep 17 00:00:00 2001 From: Askeew Date: Fri, 19 Dec 2025 20:30:18 +0100 Subject: [PATCH] Show Timeline Tip in same way and after other Damus Tips. Changelog-None: Signed-off-by: Askeew --- .../Views/PostingTimelineSwitcherView.swift | 7 ---- .../Timeline/Views/PostingTimelineView.swift | 39 ++++++++++++------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/damus/Features/Timeline/Views/PostingTimelineSwitcherView.swift b/damus/Features/Timeline/Views/PostingTimelineSwitcherView.swift index aa27900f..696598a7 100644 --- a/damus/Features/Timeline/Views/PostingTimelineSwitcherView.swift +++ b/damus/Features/Timeline/Views/PostingTimelineSwitcherView.swift @@ -15,9 +15,6 @@ struct PostingTimelineSwitcherView: View { init(damusState: DamusState, timelineSource: Binding) { self.damusState = damusState self._timelineSource = timelineSource - if #available(iOS 17.0, *) { - try? Tips.configure([.displayFrequency(.daily)]) - } } var body: some View { @@ -47,10 +44,6 @@ struct PostingTimelineSwitcherView: View { struct TimelineSwitcherTip: Tip { static let shared = TimelineSwitcherTip() - var options: [Option] { - [MaxDisplayCount(1)] - } - var title: Text { Text("Timeline switcher", comment: "Title of tip that informs users that they can switch timelines.") } diff --git a/damus/Features/Timeline/Views/PostingTimelineView.swift b/damus/Features/Timeline/Views/PostingTimelineView.swift index 461adf1f..37a8cc67 100644 --- a/damus/Features/Timeline/Views/PostingTimelineView.swift +++ b/damus/Features/Timeline/Views/PostingTimelineView.swift @@ -6,6 +6,7 @@ // import SwiftUI +import TipKit struct PostingTimelineView: View { @@ -29,6 +30,17 @@ struct PostingTimelineView: View { @SceneStorage("PostingTimelineView.filter_state") var filter_state : FilterState = .posts_and_replies @State var timeline_source: TimelineSource = .follows + @State private var damusTips: Any? = { + if #available(iOS 18.0, *) { + return TipGroup(.ordered) { + TrustedNetworkButtonTip.shared + TrustedNetworkRepliesTip.shared + PostingTimelineSwitcherView.TimelineSwitcherTip.shared + } + } + return nil + }() + var loading: Binding { Binding(get: { return home.loading @@ -72,20 +84,12 @@ struct PostingTimelineView: View { HStack(alignment: .center) { SignalView(state: damus_state, signal: home.signal) if damus_state.settings.enable_favourites_feature { - let switchView = PostingTimelineSwitcherView( - damusState: damus_state, - timelineSource: $timeline_source - ) - if #available(iOS 17.0, *) { - Image(systemName: "square.stack") - .foregroundColor(DamusColors.purple) - .overlay( - switchView - .popoverTip(PostingTimelineSwitcherView.TimelineSwitcherTip.shared) - ) - } else { - switchView - } + Image(systemName: "square.stack") + .foregroundColor(DamusColors.purple) + .overlay(PostingTimelineSwitcherView( + damusState: damus_state, + timelineSource: $timeline_source + )) } } } @@ -103,7 +107,12 @@ struct PostingTimelineView: View { } } .padding(.horizontal, 20) - + if #available(iOS 18.0, *), let tipGroup = damusTips as? TipGroup { + TipView(tipGroup.currentTip as? PostingTimelineSwitcherView.TimelineSwitcherTip) + .tipBackground(.clear) + .tipViewStyle(TrustedNetworkButtonTipViewStyle()) + .padding(.horizontal) + } VStack(spacing: 0) { CustomPicker(tabs: [ (NSLocalizedString("Notes", comment: "Label for filter for seeing only notes (instead of notes and replies)."), FilterState.posts),