From f8bf08eb04cd021db522b3ef22f6143beded4725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20=C5=9Apiewak?= Date: Mon, 18 Nov 2024 11:23:30 +0100 Subject: [PATCH] Fix button shapes on New Tab Page (#3586) Task/Issue URL: https://app.asana.com/0/1206226850447395/1208777193348112/f Tech Design URL: CC: **Description**: Default button style in SwiftUI is defining a border shape which is visible when "Button Shapes" are enabled in _Accessibility -> Display & Text Size_. This sets custom button styles to plain in order to prevent them from appearing. **Steps to test this PR**: 1. Enable _Accessibility -> Display & Text Size -> Button Shapes_ 2. Make sure there is no gray-ish shape around Favorites 3. Enable NTP Sections in Debug settings 4. Check there's no border around shortcuts on New Tab Page and in Customize view. **Definition of Done (Internal Only)**: * [ ] Does this PR satisfy our [Definition of Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)? **Device Testing**: * [ ] iPhone SE (1st Gen) * [ ] iPhone 8 * [ ] iPhone X * [ ] iPhone 14 Pro * [ ] iPad **OS Testing**: * [ ] iOS 15 * [ ] iOS 16 * [ ] iOS 17 **Theme Testing**: * [ ] Light theme * [ ] Dark theme --- ###### Internal references: [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) --- DuckDuckGo/EditableShortcutsView.swift | 1 + DuckDuckGo/FavoritesView.swift | 1 + DuckDuckGo/ShortcutsView.swift | 1 + 3 files changed, 3 insertions(+) diff --git a/DuckDuckGo/EditableShortcutsView.swift b/DuckDuckGo/EditableShortcutsView.swift index df40c9cbc8..40a00a6e73 100644 --- a/DuckDuckGo/EditableShortcutsView.swift +++ b/DuckDuckGo/EditableShortcutsView.swift @@ -37,6 +37,7 @@ struct EditableShortcutsView: View { ShortcutItemView(shortcut: setting.item, accessoryType: isEnabled ? .selected : .add) .frame(width: NewTabPageGrid.Item.edgeSize) } + .buttonStyle(.plain) .padding([.horizontal, .top], 6) // Adjust for the accessory being cut-off when lifting for preview .previewShape() } preview: { setting in diff --git a/DuckDuckGo/FavoritesView.swift b/DuckDuckGo/FavoritesView.swift index a8a7620052..b12123857f 100644 --- a/DuckDuckGo/FavoritesView.swift +++ b/DuckDuckGo/FavoritesView.swift @@ -108,6 +108,7 @@ struct FavoritesView: View { .background(.clear) .frame(width: NewTabPageGrid.Item.edgeSize) }) + .buttonStyle(.plain) case .addFavorite: Button(action: { isAddingFavorite = true diff --git a/DuckDuckGo/ShortcutsView.swift b/DuckDuckGo/ShortcutsView.swift index 0b83fc7b22..867461fb42 100644 --- a/DuckDuckGo/ShortcutsView.swift +++ b/DuckDuckGo/ShortcutsView.swift @@ -33,6 +33,7 @@ struct ShortcutsView: View { } label: { ShortcutItemView(shortcut: shortcut, accessoryType: nil) } + .buttonStyle(.plain) } } }