From bcc16cd53f771ea5b755d1d275900b227e1a3955 Mon Sep 17 00:00:00 2001 From: superdooper86 Date: Wed, 15 Jul 2026 23:26:08 +0200 Subject: [PATCH] fix: stabilize template editor layout --- Meetingnotes.xcodeproj/project.pbxproj | 8 ++-- meetingnotes/MeetingnotesApp.swift | 2 +- meetingnotes/Views/TemplateEditView.swift | 48 +++++++---------------- 3 files changed, 20 insertions(+), 38 deletions(-) diff --git a/Meetingnotes.xcodeproj/project.pbxproj b/Meetingnotes.xcodeproj/project.pbxproj index a3b2394..2fa1a9a 100644 --- a/Meetingnotes.xcodeproj/project.pbxproj +++ b/Meetingnotes.xcodeproj/project.pbxproj @@ -276,7 +276,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 15; + CURRENT_PROJECT_VERSION = 16; DEVELOPMENT_ASSET_PATHS = "\"meetingnotes/Preview Content\""; DEVELOPMENT_TEAM = G9LVHZAJNX; ENABLE_HARDENED_RUNTIME = YES; @@ -290,7 +290,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 15.0; - MARKETING_VERSION = 1.1.3; + MARKETING_VERSION = 1.1.4; ONLY_ACTIVE_ARCH = NO; OTHER_SWIFT_FLAGS = "$(inherited) -D ENABLE_TCC_SPI"; PRODUCT_BUNDLE_IDENTIFIER = net.jamesbone.meetingnotes; @@ -312,7 +312,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 15; + CURRENT_PROJECT_VERSION = 16; DEVELOPMENT_ASSET_PATHS = "\"meetingnotes/Preview Content\""; DEVELOPMENT_TEAM = G9LVHZAJNX; ENABLE_HARDENED_RUNTIME = YES; @@ -326,7 +326,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 15.0; - MARKETING_VERSION = 1.1.3; + MARKETING_VERSION = 1.1.4; ONLY_ACTIVE_ARCH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D ENABLE_TCC_SPI"; PRODUCT_BUNDLE_IDENTIFIER = net.jamesbone.meetingnotes; diff --git a/meetingnotes/MeetingnotesApp.swift b/meetingnotes/MeetingnotesApp.swift index 48d3737..eb91479 100644 --- a/meetingnotes/MeetingnotesApp.swift +++ b/meetingnotes/MeetingnotesApp.swift @@ -38,7 +38,7 @@ struct MeetingnotesApp: App { ContentView() .frame(minWidth: 700, minHeight: 400) } - .windowResizability(.contentSize) + .windowResizability(.automatic) .defaultSize(width: 1000, height: 600) .commands { CommandGroup(after: .appInfo) { diff --git a/meetingnotes/Views/TemplateEditView.swift b/meetingnotes/Views/TemplateEditView.swift index 1879de5..ae2986f 100644 --- a/meetingnotes/Views/TemplateEditView.swift +++ b/meetingnotes/Views/TemplateEditView.swift @@ -33,16 +33,9 @@ struct TemplateEditView: View { .font(.caption) .foregroundColor(.secondary) - TextEditor(text: $template.context) - .scrollContentBackground(.hidden) - .padding(8) - .background(Color.gray.opacity(0.05)) - .cornerRadius(8) - .frame(minHeight: 100) - .overlay( - RoundedRectangle(cornerRadius: 8) - .stroke(Color.gray.opacity(0.3), lineWidth: 1) - ) + TextField("Meeting Context", text: $template.context, axis: .vertical) + .textFieldStyle(.roundedBorder) + .lineLimit(4...10) } // Sections @@ -55,14 +48,12 @@ struct TemplateEditView: View { Spacer() Button { - withAnimation { - template.sections.append( - TemplateSection( - title: "New Section", - description: "Description of this section" - ) + template.sections.append( + TemplateSection( + title: "New Section", + description: "Description of this section" ) - } + ) } label: { HStack(spacing: 4) { Image(systemName: "plus") @@ -77,29 +68,20 @@ struct TemplateEditView: View { .font(.caption) .foregroundColor(.secondary) - ForEach(template.sections.indices, id: \.self) { index in + ForEach($template.sections) { $section in VStack(alignment: .leading, spacing: 8) { HStack { VStack(alignment: .leading, spacing: 8) { - TextField("Section Title", text: $template.sections[index].title) + TextField("Section Title", text: $section.title) .textFieldStyle(.roundedBorder) - TextEditor(text: $template.sections[index].description) - .scrollContentBackground(.hidden) - .padding(8) - .background(Color.gray.opacity(0.05)) - .cornerRadius(8) - .frame(minHeight: 60) - .overlay( - RoundedRectangle(cornerRadius: 8) - .stroke(Color.gray.opacity(0.3), lineWidth: 1) - ) + TextField("Section Description", text: $section.description, axis: .vertical) + .textFieldStyle(.roundedBorder) + .lineLimit(3...8) } Button { - withAnimation { - let _ = template.sections.remove(at: index) - } + template.sections.removeAll { $0.id == section.id } } label: { Image(systemName: "trash") .foregroundColor(.red) @@ -152,4 +134,4 @@ struct TemplateEditView: View { ) ) { _ in } } -} \ No newline at end of file +}