Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Sources/ClickIt/UI/Components/PresetActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
.help("Create a new preset from current settings")
.help("Create a new template from current settings")


// Load selected preset
Button(action: {
Expand Down Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While the UI placeholder is now correctly set to 'Template Name', the underlying state variable is still newPresetName. To improve code consistency and maintainability, I recommend renaming this variable to newTemplateName. Similarly, the saveCurrentPreset() function, which is called when creating the template, could be renamed to something like createTemplate() to align the code with the new UI terminology.

.textFieldStyle(.roundedBorder)
.onSubmit {
saveCurrentPreset()
Expand All @@ -154,8 +155,8 @@ struct PresetActions: View {
newPresetName = ""
}
.buttonStyle(.bordered)
Button("Save") {

Button("Create") {
saveCurrentPreset()
}
.buttonStyle(.borderedProminent)
Expand All @@ -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)"
}
}

Expand Down
Loading