-
Notifications
You must be signed in to change notification settings - Fork 0
Add 'Create New Template' button to Presets tab #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,16 +30,17 @@ struct PresetActions: View { | |
| VStack(spacing: 8) { | ||
| // Primary actions row | ||
| HStack(spacing: 12) { | ||
| // Save current settings | ||
| // Create new template | ||
| Button(action: { | ||
| showingSaveDialog = true | ||
| }) { | ||
| Label("Save Current", systemImage: "plus.circle.fill") | ||
| Label("Create New Template", systemImage: "plus.circle.fill") | ||
| .font(.subheadline) | ||
| .frame(maxWidth: .infinity) | ||
| } | ||
| .buttonStyle(.borderedProminent) | ||
| .disabled(viewModel.isRunning) | ||
| .help("Create a new preset from current settings") | ||
|
|
||
| // Load selected preset | ||
| Button(action: { | ||
|
|
@@ -133,16 +134,16 @@ struct PresetActions: View { | |
| Image(systemName: "bookmark.circle.fill") | ||
| .font(.system(size: 40)) | ||
| .foregroundColor(.blue) | ||
| Text("Save Current Configuration") | ||
|
|
||
| Text("Create New Template") | ||
| .font(.title2) | ||
| .fontWeight(.bold) | ||
| Text("Enter a name for this preset configuration:") | ||
|
|
||
| Text("Enter a name for this template:") | ||
| .font(.subheadline) | ||
| .foregroundColor(.secondary) | ||
| TextField("Preset Name", text: $newPresetName) | ||
|
|
||
| TextField("Template Name", text: $newPresetName) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While the UI placeholder is now correctly set to 'Template Name', the underlying state variable is still |
||
| .textFieldStyle(.roundedBorder) | ||
| .onSubmit { | ||
| saveCurrentPreset() | ||
|
|
@@ -154,8 +155,8 @@ struct PresetActions: View { | |
| newPresetName = "" | ||
| } | ||
| .buttonStyle(.bordered) | ||
| Button("Save") { | ||
|
|
||
| Button("Create") { | ||
| saveCurrentPreset() | ||
| } | ||
| .buttonStyle(.borderedProminent) | ||
|
|
@@ -164,12 +165,12 @@ struct PresetActions: View { | |
| } | ||
| .padding(24) | ||
| .frame(width: 350) | ||
| .navigationTitle("Save Preset") | ||
| .navigationTitle("Create Template") | ||
| } | ||
| .onAppear { | ||
| // Generate a default name | ||
| let timestamp = DateFormatter.presetName.string(from: Date()) | ||
| newPresetName = "Preset \(timestamp)" | ||
| newPresetName = "Template \(timestamp)" | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new tooltip is helpful, but it uses the term 'preset' while the button label and the rest of the creation dialog now use 'template'. For consistency, it would be better to use 'template' in the tooltip as well.