@@ -164,6 +164,10 @@ struct Suggestions: View {
164164 /// When true, show a fixed set of static cards and ignore taps (e.g. widget preview).
165165 var isPreview : Bool = false
166166
167+ /// When editing the home grid, keep the widget visible (and reorderable/removable) by falling
168+ /// back to the static preview set when there are no live cards to show.
169+ var isEditing : Bool = false
170+
167171 var previewCardIds : [ String ] ?
168172
169173 static let previewSheetCardIds = [ " backupSeedPhrase " , " pin " , " transferToSpending " , " support " ]
@@ -250,8 +254,30 @@ struct Suggestions: View {
250254 )
251255 }
252256
257+ private var isEditingFallback : Bool {
258+ isEditing && !isPreview && visibleCards. isEmpty
259+ }
260+
261+ private var cardsToShow : [ SuggestionCardData ] {
262+ guard isEditingFallback else { return visibleCards }
263+ return Self . visibleCards (
264+ wallet: wallet,
265+ app: app,
266+ settings: settings,
267+ suggestionsManager: suggestionsManager,
268+ pubkyProfile: pubkyProfile,
269+ isPaykitUIEnabled: isPaykitUIActive,
270+ isPreview: true ,
271+ previewCardIds: Self . previewSheetCardIds
272+ )
273+ }
274+
275+ private var renderStatic : Bool {
276+ isPreview || isEditingFallback
277+ }
278+
253279 var body : some View {
254- if visibleCards . isEmpty {
280+ if cardsToShow . isEmpty {
255281 EmptyView ( )
256282 } else {
257283 LazyVGrid (
@@ -261,25 +287,25 @@ struct Suggestions: View {
261287 ] ,
262288 spacing: 16
263289 ) {
264- ForEach ( visibleCards ) { card in
290+ ForEach ( cardsToShow ) { card in
265291 SuggestionCard (
266292 title: card. title,
267293 description: card. description,
268294 imageName: card. imageName,
269295 accentColor: card. color,
270- onTap: { if !isPreview { onItemTap ( card) } } ,
296+ onTap: { if !renderStatic { onItemTap ( card) } } ,
271297 onDismiss: { dismissCard ( card) }
272298 )
273299 . background {
274- if isPreview {
300+ if renderStatic {
275301 RoundedRectangle ( cornerRadius: 16 ) . fill ( Color . black)
276302 }
277303 }
278304 . accessibilityElement ( children: . contain)
279305 . accessibilityIdentifier ( " Suggestion- \( card. accessibilityId) " )
280306 }
281307 }
282- . allowsHitTesting ( !isPreview )
308+ . allowsHitTesting ( !renderStatic )
283309 . sheet ( isPresented: $showShareSheet) {
284310 ShareSheet ( activityItems: [
285311 t (
0 commit comments