Quellcode durchsuchen

Refocus AI Companion cards on notes generation.

Remove audio and transcript actions from previous meeting cards and present only meeting title, date, saved time, and Get Notes status to match a notes-first experience.

Co-authored-by: Cursor <cursoragent@cursor.com>
huzaifahayat12 vor 1 Monat
Ursprung
Commit
650602ee3a
1 geänderte Dateien mit 14 neuen und 55 gelöschten Zeilen
  1. 14 55
      meetings_app/ViewController.swift

+ 14 - 55
meetings_app/ViewController.swift

@@ -2624,7 +2624,7 @@ private extension ViewController {
2624
         titleLabel.alignment = .left
2624
         titleLabel.alignment = .left
2625
         contentStack.addArrangedSubview(titleLabel)
2625
         contentStack.addArrangedSubview(titleLabel)
2626
 
2626
 
2627
-        let subtitle = textLabel("Ended meetings with local recordings", font: typography.fieldLabel, color: palette.textSecondary)
2627
+        let subtitle = textLabel("Get notes from your previous meetings", font: typography.fieldLabel, color: palette.textSecondary)
2628
         subtitle.alignment = .left
2628
         subtitle.alignment = .left
2629
         contentStack.addArrangedSubview(subtitle)
2629
         contentStack.addArrangedSubview(subtitle)
2630
         contentStack.setCustomSpacing(14, after: subtitle)
2630
         contentStack.setCustomSpacing(14, after: subtitle)
@@ -2640,7 +2640,7 @@ private extension ViewController {
2640
 
2640
 
2641
         if aiCompanionLocalRecordings.isEmpty {
2641
         if aiCompanionLocalRecordings.isEmpty {
2642
             let emptyLabel = textLabel(
2642
             let emptyLabel = textLabel(
2643
-                "No saved recordings yet. Start a meeting from this app and allow consent to store local audio here.",
2643
+                "No previous meetings yet. End a meeting to save it here and generate notes.",
2644
                 font: typography.fieldLabel,
2644
                 font: typography.fieldLabel,
2645
                 color: palette.textMuted
2645
                 color: palette.textMuted
2646
             )
2646
             )
@@ -2650,6 +2650,12 @@ private extension ViewController {
2650
             contentStack.addArrangedSubview(emptyLabel)
2650
             contentStack.addArrangedSubview(emptyLabel)
2651
             emptyLabel.widthAnchor.constraint(equalTo: contentStack.widthAnchor).isActive = true
2651
             emptyLabel.widthAnchor.constraint(equalTo: contentStack.widthAnchor).isActive = true
2652
         } else {
2652
         } else {
2653
+            let previousMeetingsLabel = textLabel("Previous meetings", font: NSFont.systemFont(ofSize: 14, weight: .semibold), color: palette.textPrimary)
2654
+            previousMeetingsLabel.alignment = .left
2655
+            contentStack.addArrangedSubview(previousMeetingsLabel)
2656
+            previousMeetingsLabel.widthAnchor.constraint(equalTo: contentStack.widthAnchor).isActive = true
2657
+            contentStack.setCustomSpacing(10, after: previousMeetingsLabel)
2658
+
2653
             for recording in aiCompanionLocalRecordings {
2659
             for recording in aiCompanionLocalRecordings {
2654
                 let card = aiCompanionMeetingCard(recording)
2660
                 let card = aiCompanionMeetingCard(recording)
2655
                 contentStack.addArrangedSubview(card)
2661
                 contentStack.addArrangedSubview(card)
@@ -2735,56 +2741,13 @@ private extension ViewController {
2735
         title.maximumNumberOfLines = 2
2741
         title.maximumNumberOfLines = 2
2736
         title.lineBreakMode = .byTruncatingTail
2742
         title.lineBreakMode = .byTruncatingTail
2737
 
2743
 
2738
-        let dateText = DateFormatter.localizedString(from: recording.endedAt, dateStyle: .medium, timeStyle: .short)
2739
-        let dateLabel = textLabel("Saved: \(dateText)", font: typography.fieldLabel, color: palette.textSecondary)
2744
+        let dateText = DateFormatter.localizedString(from: recording.endedAt, dateStyle: .medium, timeStyle: .none)
2745
+        let dateLabel = textLabel("Date: \(dateText)", font: typography.fieldLabel, color: palette.textSecondary)
2740
         dateLabel.alignment = .left
2746
         dateLabel.alignment = .left
2741
 
2747
 
2742
-        let audioURL = URL(fileURLWithPath: recording.audioFilePath)
2743
-        let audioLink = audioURL.lastPathComponent
2744
-        let audioButton = NSButton(title: "Play Audio", target: self, action: #selector(aiCompanionAudioTapped(_:)))
2745
-        audioButton.translatesAutoresizingMaskIntoConstraints = false
2746
-        audioButton.isBordered = false
2747
-        audioButton.bezelStyle = .inline
2748
-        audioButton.font = NSFont.systemFont(ofSize: 13, weight: .semibold)
2749
-        audioButton.contentTintColor = palette.primaryBlue
2750
-        audioButton.alignment = .left
2751
-        audioButton.setButtonType(.momentaryPushIn)
2752
-        aiCompanionAudioURLByView[ObjectIdentifier(audioButton)] = audioURL
2753
-        let trimmedSubtitle: String? = nil
2754
-        let speechText = {
2755
-            let base = "Ended meeting: \(recording.title)."
2756
-            guard let trimmedSubtitle, trimmedSubtitle.isEmpty == false else { return base }
2757
-            return "\(base) \(trimmedSubtitle)."
2758
-        }()
2759
-        aiCompanionSpeechTextByView[ObjectIdentifier(audioButton)] = speechText
2760
-
2761
-        let audioURLLabel = textLabel(audioLink, font: typography.fieldLabel, color: palette.textMuted)
2762
-        audioURLLabel.alignment = .left
2763
-        audioURLLabel.maximumNumberOfLines = 2
2764
-        audioURLLabel.lineBreakMode = .byTruncatingTail
2765
-
2766
-        let audioStatusLabel = textLabel("Not playing", font: typography.fieldLabel, color: palette.textMuted)
2767
-        audioStatusLabel.alignment = .left
2768
-        audioStatusLabel.maximumNumberOfLines = 1
2769
-        audioStatusLabel.lineBreakMode = .byTruncatingTail
2770
-        aiCompanionAudioStatusLabelByView[ObjectIdentifier(audioButton)] = audioStatusLabel
2771
-
2772
-        let transcriptButton = NSButton(title: "View transcript", target: self, action: #selector(aiCompanionTranscriptTapped(_:)))
2773
-        transcriptButton.translatesAutoresizingMaskIntoConstraints = false
2774
-        transcriptButton.isBordered = false
2775
-        transcriptButton.bezelStyle = .inline
2776
-        transcriptButton.font = NSFont.systemFont(ofSize: 13, weight: .semibold)
2777
-        transcriptButton.contentTintColor = palette.primaryBlue
2778
-        transcriptButton.alignment = .left
2779
-        transcriptButton.setButtonType(.momentaryPushIn)
2780
-
2781
-        aiCompanionTranscriptMeetingIdByView[ObjectIdentifier(transcriptButton)] = recording.id
2782
-
2783
-        let transcriptStatusLabel = textLabel(aiCompanionTranscriptStatusText(for: recording), font: typography.fieldLabel, color: palette.textMuted)
2784
-        transcriptStatusLabel.alignment = .left
2785
-        transcriptStatusLabel.maximumNumberOfLines = 2
2786
-        transcriptStatusLabel.lineBreakMode = .byTruncatingTail
2787
-        aiCompanionTranscriptStatusLabelByView[ObjectIdentifier(transcriptButton)] = transcriptStatusLabel
2748
+        let savedTimeText = DateFormatter.localizedString(from: recording.endedAt, dateStyle: .none, timeStyle: .short)
2749
+        let savedTimeLabel = textLabel("Saved time: \(savedTimeText)", font: typography.fieldLabel, color: palette.textMuted)
2750
+        savedTimeLabel.alignment = .left
2788
 
2751
 
2789
         let notesButton = NSButton(title: "Get notes", target: self, action: #selector(aiCompanionNotesTapped(_:)))
2752
         let notesButton = NSButton(title: "Get notes", target: self, action: #selector(aiCompanionNotesTapped(_:)))
2790
         notesButton.translatesAutoresizingMaskIntoConstraints = false
2753
         notesButton.translatesAutoresizingMaskIntoConstraints = false
@@ -2804,11 +2767,7 @@ private extension ViewController {
2804
 
2767
 
2805
         stack.addArrangedSubview(title)
2768
         stack.addArrangedSubview(title)
2806
         stack.addArrangedSubview(dateLabel)
2769
         stack.addArrangedSubview(dateLabel)
2807
-        stack.addArrangedSubview(audioButton)
2808
-        stack.addArrangedSubview(audioURLLabel)
2809
-        stack.addArrangedSubview(audioStatusLabel)
2810
-        stack.addArrangedSubview(transcriptButton)
2811
-        stack.addArrangedSubview(transcriptStatusLabel)
2770
+        stack.addArrangedSubview(savedTimeLabel)
2812
         stack.addArrangedSubview(notesButton)
2771
         stack.addArrangedSubview(notesButton)
2813
         stack.addArrangedSubview(notesStatusLabel)
2772
         stack.addArrangedSubview(notesStatusLabel)
2814
 
2773