Skip to content

Commit

Permalink
Re-adds quick link customization, makes intentdefinition localizable (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
boek authored Feb 27, 2021
1 parent df7e340 commit 506fcc1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 15 deletions.
16 changes: 14 additions & 2 deletions Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@
D58A202925C9D96400105D25 /* BookmarkPanel.strings in Resources */ = {isa = PBXBuildFile; fileRef = D58A202725C9D96400105D25 /* BookmarkPanel.strings */; };
D58A202C25C9D96400105D25 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D58A202A25C9D96400105D25 /* Localizable.strings */; };
D58A202F25C9D96400105D25 /* BookmarkPanelDeleteConfirm.strings in Resources */ = {isa = PBXBuildFile; fileRef = D58A202D25C9D96400105D25 /* BookmarkPanelDeleteConfirm.strings */; };
D59431ED25E9912900F0BA82 /* WidgetIntents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = D59431F025E9912900F0BA82 /* WidgetIntents.intentdefinition */; };
D59431EE25E9912900F0BA82 /* WidgetIntents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = D59431F025E9912900F0BA82 /* WidgetIntents.intentdefinition */; };
D59643E325C9B8E000EAB8B9 /* ClearPrivateData.strings in Resources */ = {isa = PBXBuildFile; fileRef = 58E14A8F991610DB13A9F1E1 /* ClearPrivateData.strings */; };
D59643E425C9B8E000EAB8B9 /* 3DTouchActions.strings in Resources */ = {isa = PBXBuildFile; fileRef = 514A4C83AE17612AF3025498 /* 3DTouchActions.strings */; };
D59643E525C9B8E000EAB8B9 /* AuthenticationManager.strings in Resources */ = {isa = PBXBuildFile; fileRef = 32484895B328A342AED539C8 /* AuthenticationManager.strings */; };
Expand Down Expand Up @@ -3254,7 +3256,7 @@
D58A202825C9D96400105D25 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/BookmarkPanel.strings; sourceTree = "<group>"; };
D58A202B25C9D96400105D25 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = "<group>"; };
D58A202E25C9D96400105D25 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/BookmarkPanelDeleteConfirm.strings; sourceTree = "<group>"; };
D595529725D1F5590040B30B /* WidgetIntents.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = WidgetIntents.intentdefinition; sourceTree = "<group>"; };
D59431EF25E9912900F0BA82 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; name = Base; path = Base.lproj/WidgetIntents.intentdefinition; sourceTree = "<group>"; };
D59ED3CB25D1AF6A0074A720 /* dsb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = dsb; path = dsb.lproj/BookmarkPanel.strings; sourceTree = "<group>"; };
D59ED3CC25D1AF6A0074A720 /* dsb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = dsb; path = dsb.lproj/Localizable.strings; sourceTree = "<group>"; };
D59ED3CD25D1AF6A0074A720 /* dsb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = dsb; path = dsb.lproj/BookmarkPanelDeleteConfirm.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4066,7 +4068,7 @@
047F9B2D24E1FE1F00CD7DF7 /* Assets.xcassets */,
047F9B2F24E1FE1F00CD7DF7 /* Info.plist */,
D58A202A25C9D96400105D25 /* Localizable.strings */,
D595529725D1F5590040B30B /* WidgetIntents.intentdefinition */,
D59431F025E9912900F0BA82 /* WidgetIntents.intentdefinition */,
);
path = WidgetKit;
sourceTree = "<group>";
Expand Down Expand Up @@ -7043,6 +7045,7 @@
1DF42682251BDB3A0086386A /* FaviconFetcher.swift in Sources */,
1DDAD13E24F0651C007623C8 /* TopSitesWidget.swift in Sources */,
4392FB20252EC49D00AD3D23 /* SessionData.swift in Sources */,
D59431EE25E9912900F0BA82 /* WidgetIntents.intentdefinition in Sources */,
047F9B4224E1FF4000CD7DF7 /* ImageButtonWithLabel.swift in Sources */,
047F9B2C24E1FE1C00CD7DF7 /* WidgetKit.swift in Sources */,
1DA3CE6724EEE86C00422BB2 /* AppInfo.swift in Sources */,
Expand Down Expand Up @@ -7704,6 +7707,7 @@
E65075571E37F714006961AC /* FaviconFetcher.swift in Sources */,
048B4C8024A53EEB001B56E8 /* ImageButtonWithLabel.swift in Sources */,
D863C8F21F68BFC20058D95F /* GradientProgressBar.swift in Sources */,
D59431ED25E9912900F0BA82 /* WidgetIntents.intentdefinition in Sources */,
CAC458F1249429C20042561A /* LoginListSelectionHelper.swift in Sources */,
EB9A178E20E525DF00B12184 /* ThemeSettingsController.swift in Sources */,
23A50958253F782E008FEBD9 /* NewTabButton.swift in Sources */,
Expand Down Expand Up @@ -9869,6 +9873,14 @@
name = BookmarkPanelDeleteConfirm.strings;
sourceTree = "<group>";
};
D59431F025E9912900F0BA82 /* WidgetIntents.intentdefinition */ = {
isa = PBXVariantGroup;
children = (
D59431EF25E9912900F0BA82 /* Base */,
);
name = WidgetIntents.intentdefinition;
sourceTree = "<group>";
};
F0D8481DAC1E6378ABF1565A /* ClearPrivateDataConfirm.strings */ = {
isa = PBXVariantGroup;
children = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<array>
<dict>
<key>INEnumDisplayName</key>
<string>QuickActionType</string>
<string>Quick Action Type</string>
<key>INEnumDisplayNameID</key>
<string>eV8mOT</string>
<key>INEnumGeneratesHeader</key>
Expand Down Expand Up @@ -73,7 +73,7 @@
<key>INIntentDefinitionNamespace</key>
<string>5W2MbK</string>
<key>INIntentDefinitionSystemVersion</key>
<string>20D64</string>
<string>20E5186d</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>12D4e</string>
<key>INIntentDefinitionToolsVersion</key>
Expand All @@ -84,7 +84,7 @@
<key>INIntentCategory</key>
<string>information</string>
<key>INIntentDescription</key>
<string>Quick Action Description</string>
<string>Quick access to various Firefox acions</string>
<key>INIntentDescriptionID</key>
<string>ctDNmu</string>
<key>INIntentEligibleForWidgets</key>
Expand Down
22 changes: 12 additions & 10 deletions WidgetKit/SearchQuickLinksSmall/SmallQuickLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
import SwiftUI
import WidgetKit

struct IntentProvider: TimelineProvider {
func getSnapshot(in context: Context, completion: @escaping (QuickLinkEntry) -> Void) {
struct IntentProvider: IntentTimelineProvider {
typealias Intent = QuickActionIntent
typealias Entry = QuickLinkEntry

func getSnapshot(for configuration: QuickActionIntent, in context: Context, completion: @escaping (QuickLinkEntry) -> Void) {
let entry = QuickLinkEntry(date: Date(), link: .search)
completion(entry)
}

func getTimeline(in context: Context, completion: @escaping (Timeline<QuickLinkEntry>) -> Void) {
let link = QuickLink.search
let entries = [QuickLinkEntry(date: Date(), link: link)]
let timeline = Timeline(entries: entries, policy: .atEnd)
func getTimeline(for configuration: QuickActionIntent, in context: Context, completion: @escaping (Timeline<QuickLinkEntry>) -> Void) {
let entry = QuickLinkEntry(date: Date(), link: QuickLink(rawValue: configuration.actionType.rawValue)!)
let timeline = Timeline(entries: [entry], policy: .never)
completion(timeline)
}

Expand All @@ -30,7 +32,7 @@ struct QuickLinkEntry: TimelineEntry {
}

struct SmallQuickLinkView : View {
var entry: QuickLinkEntry
var entry: IntentProvider.Entry

@ViewBuilder
var body: some View {
Expand All @@ -44,12 +46,12 @@ struct SmallQuickLinkWidget: Widget {
private let kind: String = "Quick Actions - Small"

public var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: IntentProvider()) { entry in
IntentConfiguration(kind: kind, intent: QuickActionIntent.self, provider: IntentProvider()) { entry in
SmallQuickLinkView(entry: entry)
}
.supportedFamilies([.systemSmall])
.configurationDisplayName(String.QuickActionsGalleryTitlev2)
.description(String.SearchInFirefoxTitle)
.configurationDisplayName(String.QuickActionsGalleryTitle)
.description(String.QuickActionGalleryDescription)
}
}

Expand Down
17 changes: 17 additions & 0 deletions l10n_comments.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
2GqvPe=Quick Actions drop down menu item for Go to Copied Link when widget enters edit mode and drop down menu expands
PzSrmZ-2GqvPe=Accessibility label to confirm the go to copied link selection
PzSrmZ-eHmH1H=Accessibility label to confirm the Clear Private Tabs selection
PzSrmZ-scEmjs=Accessibility label to confirm the New Private Search selection
PzSrmZ-xRJbBP=Accessibility label to confirm the New Search selection
ctDNmu=Description of the collection of widgets
eHmH1H=Quick Actions drop down menu item for lear Private Tabs when widget enters edit mode and drop down menu expands
eV8mOT=The description of a customizable section of the widget
eqyNJg=Title of the quick actions widgets
fi3W24-2GqvPe=Label showing how many widgets match ‘Go to Copied Link’. ${count} is a placeholder fo the number of widgets.
fi3W24-eHmH1H=Label showing how many widgets match ‘Clear Private Tabs’. ${count} is a placeholder fo the number of widgets.
fi3W24-scEmjs=Label showing how many widgets match ‘New Private Search’. ${count} is a placeholder fo the number of widgets.
fi3W24-xRJbBP=Label showing how many widgets match ‘New Search’. ${count} is a placeholder fo the number of widgets.
scEmjs=Quick Actions drop down menu item for new private search when widget enters edit mode and drop down menu expands
w9jdPK=Quick Actions left label text for dropdown menu when widget enters edit mode
xRJbBP=Quick Actions drop down menu item for new search when widget enters edit mode and drop down menu expands

0 comments on commit 506fcc1

Please sign in to comment.