Quellcode durchsuchen

Remove the redundant word count toolbar button since the text field already shows the character count.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 vor 1 Monat
Ursprung
Commit
61dd670145

+ 0 - 12
gramora/ViewModels/GrammarCheckerViewModel.swift

@@ -10,22 +10,10 @@ final class GrammarCheckerViewModel: ObservableObject {
 
     var characterCount: Int { text.count }
 
-    var wordCount: Int {
-        let components = text
-            .trimmingCharacters(in: .whitespacesAndNewlines)
-            .components(separatedBy: .whitespacesAndNewlines)
-            .filter { !$0.isEmpty }
-        return components.count
-    }
-
     var characterCountLabel: String {
         "\(characterCount)/\(Self.maxCharacters)"
     }
 
-    var wordCountLabel: String {
-        "\(wordCount)/\(Self.maxCharacters) Words"
-    }
-
     func pasteText() {
         guard let clipboard = NSPasteboard.general.string(forType: .string) else { return }
         text = String(clipboard.prefix(Self.maxCharacters))

+ 0 - 17
gramora/Views/GrammarCheckerView.swift

@@ -105,23 +105,6 @@ struct GrammarCheckerView: View {
 
                 ToolbarButton(title: "Upload File", iconName: "square.and.arrow.up") {}
 
-                HStack(spacing: 6) {
-                    Image(systemName: "textformat")
-                        .font(.system(size: 12))
-
-                    Text(viewModel.wordCountLabel)
-                        .font(.system(size: 12, weight: .medium))
-                }
-                .foregroundStyle(AppTheme.textSecondary)
-                .padding(.horizontal, 12)
-                .padding(.vertical, 7)
-                .background(Color.white)
-                .clipShape(RoundedRectangle(cornerRadius: 8))
-                .overlay(
-                    RoundedRectangle(cornerRadius: 8)
-                        .stroke(AppTheme.border, lineWidth: 1)
-                )
-
                 Spacer()
 
                 ClearButton {