| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- import Foundation
- enum CommentWriterTab: String, CaseIterable, Identifiable {
- case compose
- case preview
- case variants
- var id: String { rawValue }
- var title: String {
- switch self {
- case .compose: "Compose"
- case .preview: "Preview"
- case .variants: "Variants"
- }
- }
- }
- enum CommentType: String, CaseIterable, Identifiable {
- case topLevel
- case reply
- var id: String { rawValue }
- var title: String {
- switch self {
- case .topLevel: "Top-Level"
- case .reply: "Reply"
- }
- }
- var subtitle: String {
- switch self {
- case .topLevel: "Comment on the post"
- case .reply: "Reply to a comment"
- }
- }
- var systemImage: String {
- switch self {
- case .topLevel: "text.bubble"
- case .reply: "arrowshape.turn.up.left.fill"
- }
- }
- }
- enum CommentIntent: String, CaseIterable, Identifiable {
- case addValue
- case agree
- case disagree
- case question
- case funny
- case empathetic
- case technical
- case summary
- var id: String { rawValue }
- var title: String {
- switch self {
- case .addValue: "Add Value"
- case .agree: "Agree"
- case .disagree: "Counter"
- case .question: "Question"
- case .funny: "Funny"
- case .empathetic: "Empathetic"
- case .technical: "Technical"
- case .summary: "TL;DR"
- }
- }
- var subtitle: String {
- switch self {
- case .addValue: "Share insight or tips"
- case .agree: "Support the post/comment"
- case .disagree: "Respectful counterpoint"
- case .question: "Ask for clarification"
- case .funny: "Witty or lighthearted"
- case .empathetic: "Personal & relatable"
- case .technical: "Detailed explanation"
- case .summary: "Concise recap"
- }
- }
- var systemImage: String {
- switch self {
- case .addValue: "lightbulb.fill"
- case .agree: "hand.thumbsup.fill"
- case .disagree: "arrow.left.arrow.right"
- case .question: "questionmark.circle.fill"
- case .funny: "face.smiling.fill"
- case .empathetic: "heart.fill"
- case .technical: "wrench.and.screwdriver.fill"
- case .summary: "text.alignleft"
- }
- }
- }
- enum CommentLength: String, CaseIterable, Identifiable {
- case short
- case medium
- case long
- var id: String { rawValue }
- var title: String {
- switch self {
- case .short: "Short"
- case .medium: "Medium"
- case .long: "Long"
- }
- }
- var subtitle: String {
- switch self {
- case .short: "1–2 sentences"
- case .medium: "1–2 paragraphs"
- case .long: "Detailed reply"
- }
- }
- var wordRange: String {
- switch self {
- case .short: "20–60 words"
- case .medium: "60–150 words"
- case .long: "150–300 words"
- }
- }
- }
- enum CommentVariantCount: Int, CaseIterable, Identifiable {
- case three = 3
- case five = 5
- var id: Int { rawValue }
- var label: String { "\(rawValue) variants" }
- }
- struct CommentDraft: Equatable {
- var commentType: CommentType = .topLevel
- var subreddit: String = ""
- var postTitle: String = ""
- var postBody: String = ""
- var postURL: String = ""
- var parentComment: String = ""
- var topic: String = ""
- var tone: PostTone = .casual
- var intent: CommentIntent = .addValue
- var length: CommentLength = .medium
- var body: String = ""
- var includeQuote: Bool = true
- var useMarkdown: Bool = true
- var variantCount: CommentVariantCount = .three
- }
- struct CommentVariant: Identifiable, Equatable {
- let id: UUID
- var body: String
- var score: Int
- var reasoning: String
- init(id: UUID = UUID(), body: String, score: Int, reasoning: String) {
- self.id = id
- self.body = body
- self.score = score
- self.reasoning = reasoning
- }
- }
- struct GeneratedComment: Equatable {
- var body: String
- var variants: [CommentVariant]
- }
|