fix: stabilize template editor layout

This commit is contained in:
2026-07-15 23:26:08 +02:00
parent 25ae1ae710
commit bcc16cd53f
3 changed files with 20 additions and 38 deletions
+4 -4
View File
@@ -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;
+1 -1
View File
@@ -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) {
+15 -33
View File
@@ -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 }
}
}
}