Skip to content

Commit

Permalink
Merge branch 'main' into sam/add-rmf-message-shown-attribute
Browse files Browse the repository at this point in the history
# By Alexey Martemyanov (2) and others
# Via Alexey Martemyanov (2) and GitHub (1)
* main:
  Enable favorites reordering on New Tab Page (#3169)
  [DuckPlayer]. 15. Move DuckPlayer code to BSK (#3171)
  Update autoconsent to v10.13.0 (#3178)
  application lock test and tab switcher test (#3163)
  Release 7.131.0-1 (#3179)
  restore CrashLogMessageExtractor with disabled __cxa_throw swapper (#3133)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • Loading branch information
samsymons committed Aug 4, 2024
2 parents 0edad82 + dd24158 commit 682fca9
Show file tree
Hide file tree
Showing 21 changed files with 240 additions and 355 deletions.
57 changes: 57 additions & 0 deletions .maestro/release_tests/application-lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# application-lock.yaml
appId: com.duckduckgo.mobile.ios
tags:
- release

---

# Set up
- runFlow:
file: ../shared/setup.yaml

- tapOn: "Settings"
- scrollUntilVisible:
element: "General"
direction: DOWN
- tapOn: "General"

- tapOn:
text: "0"
index: "0"

- stopApp

- launchApp

- assertVisible: "Unlock DuckDuckGo."
- inputText: "password"
- pressKey: Enter

- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://privacy-test-pages.site"
- pressKey: Enter

# Manage onboarding
- runFlow:
file: ../shared/onboarding_browsing.yaml

- tapOn: "Browsing Menu"
- tapOn: "Settings"
- scrollUntilVisible:
element: "General"
direction: DOWN
- tapOn: "General"

- tapOn:
text: "1"
index: "0"


- stopApp

- launchApp

- assertVisible: "Privacy Test Pages"
60 changes: 60 additions & 0 deletions .maestro/release_tests/tabswitcher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# tabswitcher.yaml
appId: com.duckduckgo.mobile.ios
tags:
- release

---

# Set up
- runFlow:
file: ../shared/setup.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://privacy-test-pages.site"
- pressKey: Enter

# Manage onboarding
- runFlow:
file: ../shared/onboarding_browsing.yaml

- assertVisible: ".*Privacy Test Pages.*"

# Add tab
- assertVisible: Tab Switcher
- tapOn: Tab Switcher
- assertVisible: ".*Privacy Test Pages.*"
- assertVisible:
id: "Add"
- tapOn:
id: "Add"
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site"
- pressKey: Enter
- assertVisible: "Search engine"

# Bookmark all
- assertVisible: Tab Switcher
- tapOn: Tab Switcher
- tapOn: "Add all tabs as bookmarks"
- assertVisible: "Bookmark All Tabs?"
- tapOn: "Bookmark"

# can't really tell if it works, but at least it won't crash
- tapOn: "Toggle between grid and list view"

# Check bookmarks were added
- tapOn: "Done"

- tapOn: "Browsing menu"
- tapOn: "Bookmarks"
- assertVisible: "Privacy Test Pages - Home"
- assertVisible: "Ad Click Flow"


76 changes: 38 additions & 38 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"branch" : "sam/add-rmf-message-shown-attribute",
"revision" : "eed68fe76825b427a2fbc10435b4df1a9bf2737b"
"revision" : "ebad3db46e09913ac4c0e0c62085dcb40a6d6253",
"version" : "178.0.0"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/AddressDisplayHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
//

import Foundation
import DuckPlayer

extension OmniBar {

Expand Down
6 changes: 6 additions & 0 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ import WebKit

override init() {
super.init()

if !didCrashDuringCrashHandlersSetUp {
didCrashDuringCrashHandlersSetUp = true
CrashLogMessageExtractor.setUp(swapCxaThrow: false)
didCrashDuringCrashHandlersSetUp = false
}
}

// swiftlint:disable:next function_body_length
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Autoconsent/autoconsent-bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import WebKit
import Core
import Common
import BrowserServicesKit
import DuckPlayer

final class DuckPlayerNavigationHandler {

Expand Down
165 changes: 0 additions & 165 deletions DuckDuckGo/DuckPlayer/DuckPlayerURLExtension.swift

This file was deleted.

1 change: 1 addition & 0 deletions DuckDuckGo/DuckPlayer/YoutubeOverlayUserScript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import UserScript
import Combine
import Core
import BrowserServicesKit
import DuckPlayer

final class YoutubeOverlayUserScript: NSObject, Subfeature {

Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Favorite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import Bookmarks
import SwiftUI

struct Favorite: Identifiable, Equatable {
struct Favorite: Identifiable, Equatable, Hashable {
let id: String
let title: String
let domain: String
Expand Down
13 changes: 13 additions & 0 deletions DuckDuckGo/FavoritesDefaultModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ final class FavoritesDefaultModel: FavoritesModel {
onFavoriteEdit?(entity)
}

func moveFavorites(from indexSet: IndexSet, to index: Int) {
guard indexSet.count == 1,
let fromIndex = indexSet.first else { return }

let favorite = allFavorites[fromIndex]
guard let entity = lookupEntity(for: favorite) else { return }

// adjust for different target index handling
let toIndex = index > fromIndex ? index - 1 : index
interactionModel.moveFavorite(entity, fromIndex: fromIndex, toIndex: toIndex)
allFavorites.move(fromOffsets: IndexSet(integer: fromIndex), toOffset: index)
}

private func lookupEntity(for favorite: Favorite) -> BookmarkEntity? {
interactionModel.favorites.first {
$0.uuid == favorite.id
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/FavoritesModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protocol FavoritesModel: AnyObject, ObservableObject {
func favoriteSelected(_ favorite: Favorite)
func editFavorite(_ favorite: Favorite)
func deleteFavorite(_ favorite: Favorite)
func moveFavorites(from indexSet: IndexSet, to index: Int)
}

struct FavoritesSlice {
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/FavoritesPreviewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ final class FavoritesPreviewModel: FavoritesModel {

}

func moveFavorites(from indexSet: IndexSet, to index: Int) {
allFavorites.move(fromOffsets: indexSet, toOffset: index)
}

func loadFavicon(for favorite: Favorite, size: CGFloat) async {

}
Expand Down
Loading

0 comments on commit 682fca9

Please sign in to comment.