Переглянути джерело

Google Forms: distinct create links and drop medium widget

Use forms.new, g.co/createaquiz, and docs template gallery for Form /
Quiz / Survey. Remove forms_medium variant so only small and large remain.

Made-with: Cursor
huzaifahayat12 3 місяців тому
батько
коміт
909ce4b1bd

+ 15 - 4
google_apps/Widgets/FormsDesktopWidgetView.swift

@@ -4,6 +4,16 @@ import SwiftUI
 private let formsAccent = Color(red: 0.45, green: 0.28, blue: 0.72)
 private let formsPanelBg = Color(red: 0.09, green: 0.08, blue: 0.14)
 
+/// Distinct Google entry points so Form / Quiz / Survey are not identical redirects.
+private enum FormsCreateURL {
+    /// Blank form (Google `.new` shortcut).
+    static let blankForm = "https://forms.new"
+    /// Quiz-focused create flow (official short link).
+    static let quiz = "https://g.co/createaquiz"
+    /// Template gallery filtered to Forms — pick survey, RSVP, feedback, etc.
+    static let surveyTemplates = "https://docs.google.com/templates?type=forms"
+}
+
 /// Large Google Forms dashboard: find + create shortcuts (opens real Forms URLs in-app).
 struct FormsDesktopWidgetView: View {
     let app: LauncherApp
@@ -97,14 +107,14 @@ struct FormsDesktopWidgetView: View {
         VStack(alignment: .leading, spacing: 6) {
             sectionLabel("Create")
             HStack(spacing: 6) {
-                createPill(title: "Form", systemImage: "doc.badge.plus", urlString: "https://docs.google.com/forms/create")
-                createPill(title: "Quiz", systemImage: "checkmark.circle.fill", urlString: "https://docs.google.com/forms/u/0/create")
-                createPill(title: "Survey", systemImage: "chart.bar.doc.horizontal", urlString: "https://docs.google.com/forms/u/0/create?usp=forms_home")
+                createPill(title: "Form", systemImage: "doc.badge.plus", urlString: FormsCreateURL.blankForm, help: "New blank form (forms.new)")
+                createPill(title: "Quiz", systemImage: "checkmark.circle.fill", urlString: FormsCreateURL.quiz, help: "Start a quiz (g.co/createaquiz)")
+                createPill(title: "Survey", systemImage: "chart.bar.doc.horizontal", urlString: FormsCreateURL.surveyTemplates, help: "Form templates including surveys")
             }
         }
     }
 
-    private func createPill(title: String, systemImage: String, urlString: String) -> some View {
+    private func createPill(title: String, systemImage: String, urlString: String, help: String) -> some View {
         Button {
             openAbsolute(urlString)
         } label: {
@@ -124,6 +134,7 @@ struct FormsDesktopWidgetView: View {
             )
         }
         .buttonStyle(.plain)
+        .help(help)
     }
 
     private func sectionLabel(_ text: String) -> some View {

+ 0 - 6
google_apps/Widgets/WidgetTemplates.swift

@@ -242,12 +242,6 @@ enum WidgetTemplates {
         case .forms:
             return [
                 v("forms_small", "Forms", .small, false, .iconOnly(title: "Forms"), [a("home", "Open", "list.bullet.rectangle.fill", "/forms/u/0/")]),
-                v("forms_medium", "Forms Shortcuts", .medium, true, .actionsGrid(columns: 2), [
-                    a("recent", "Recent", "clock.arrow.circlepath", "/forms/u/0/"),
-                    a("new", "New form", "plus", "https://docs.google.com/forms/create"),
-                    a("contacts", "Contacts", "person.crop.circle", "/forms/u/0/contacts"),
-                    a("search", "Search", "magnifyingglass", "/forms/u/0/search"),
-                ]),
                 v("forms_large", "Forms dashboard", .large, false, .forms(.dashboard), []),
             ]
         case .calendar: