Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 9 additions & 9 deletions Cotabby/UI/MenuBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,22 @@ struct MenuBarView: View {
.toggleStyle(.switch)
.controlSize(.small)

Toggle("Include Clipboard Context", isOn: clipboardContextEnabledBinding)
.toggleStyle(.switch)
.controlSize(.small)

if let application = focusModel.latestExternalApplication,
!TerminalAppDetector.isTerminal(bundleIdentifier: application.bundleIdentifier) {
Toggle("Enable in \(application.applicationName)", isOn: appEnabledBinding(for: application))
.toggleStyle(.switch)
.controlSize(.small)
}

Toggle("Show Indicator", isOn: showIndicatorBinding)
Toggle("Include Clipboard Context", isOn: clipboardContextEnabledBinding)
.toggleStyle(.switch)
.controlSize(.small)

Toggle("Show Cotabby Indicator", isOn: showIndicatorBinding)
.toggleStyle(.switch)
.controlSize(.small)

Toggle("Allow Multi-line Suggestions", isOn: multiLineEnabledBinding)
.toggleStyle(.switch)
.controlSize(.small)

Expand Down Expand Up @@ -122,10 +126,6 @@ struct MenuBarView: View {
.labelsHidden()
.pickerStyle(.menu)
}

Toggle("Multi-line", isOn: multiLineEnabledBinding)
.toggleStyle(.switch)
.controlSize(.small)
}
.padding(.bottom, 12)
}
Expand Down
13 changes: 13 additions & 0 deletions Cotabby/UI/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct SettingsView: View {
var body: some View {
Form {
settingsHeader
supportSection
updatesSection
uninstallSection
generalSection
Expand Down Expand Up @@ -413,6 +414,18 @@ struct SettingsView: View {
}
}

@ViewBuilder
private var supportSection: some View {
Section("Support") {
LabeledContent {
Link("Buy Me a Coffee", destination: URL(string: "https://buymeacoffee.com/cotabby")!)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Force-unwrapping URL(string:) will crash at runtime if the literal ever becomes invalid (e.g. a typo during a future edit). Since Link requires a non-optional URL, a safe alternative is to declare it as a static constant outside the view body so the crash would surface at app launch rather than silently in a live setting — or use a no-op fallback URL.

Suggested change
Link("Buy Me a Coffee", destination: URL(string: "https://buymeacoffee.com/cotabby")!)
Link("Buy Me a Coffee", destination: URL(string: "https://buymeacoffee.com/cotabby") ?? URL(string: "https://buymeacoffee.com")!)

Fix in Codex Fix in Claude Code

} label: {
Text("Cotabby is free and open source. If it's useful to you, consider supporting development.")
.foregroundStyle(.secondary)
}
}
}

@ViewBuilder
private var updatesSection: some View {
Section("Updates") {
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, bui
- Swift, SwiftUI, and AppKit, which together make the menu bar app, overlays, and settings UI possible
- Everyone who has filed issues, tested prereleases, and contributed pull requests

## Support

If Cotabby is useful to you, consider buying us a coffee:

<a href="https://buymeacoffee.com/cotabby" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

## Built by

<a href="https://github.com/FuJacob">@FuJacob</a> and <a href="https://github.com/jam-cai">@jam-cai</a>
Expand Down
Loading