Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

Merge remote-tracking branch 'origin/main' into pr-41

leepokaice061d9807ad
diff --cc kit/Sources/CodyncUI/Thread/Composer.swift
index 1c6d6a03,aed3b86c..dc67acaa
--- a/kit/Sources/CodyncUI/Thread/Composer.swift
+++ b/kit/Sources/CodyncUI/Thread/Composer.swift
@@@ -162,9 -166,70 +169,70 @@@ struct Composer: View
#endif
}
+ private enum Trailing: Equatable {
+ case interrupt, stop, call, send
+ }
+
+ private var trailing: Trailing {
+ if onInterrupt != nil, draft.isEmpty, files.isEmpty { return .interrupt }
+ if working, draft.isEmpty { return .stop }
+ if onCall != nil, draft.isEmpty, files.isEmpty { return .call }
+ return .send
+ }
+
+ /// One button that morphs between call, send, stop and interrupt: its symbol replaces itself,
+ /// its fill crossfades and the capsule narrows to a circle, so switching never pops.
+ private var trailingButton: some View {
+ let state = trailing
+ let enabled = state != .send || canSend
+ let (symbol, label, size): (String, String, CGFloat) = switch state {
+ case .interrupt: ("stop.fill", "Interrupt", 12)
+ case .stop: ("stop.fill", "Stop", 12)
+ case .call: ("waveform", "Call", 15)
+ case .send: ("arrow.up", "Send", 14)
+ }
+ let fill: Color = switch state {
+ case .interrupt: Palette.danger
+ case .send: canSend ? Palette.accentFill : Palette.accentDim
+ case .stop, .call: Palette.accentFill
+ }
+ let ink: Color = switch state {
+ case .interrupt: .white
+ case .send: canSend ? Palette.onAccent : Palette.tertiary
+ case .stop, .call: Palette.onAccent
+ }
+ return Button {
+ switch state {
+ case .interrupt: onInterrupt?()
+ case .stop: model.stop(botId)
+ case .call: onCall?()
+ case .send: submit()
+ }
+ } label: {
+ Image(systemName: symbol)
+ .appFont(.system(size: size, weight: .bold))
+ .contentTransition(.symbolEffect(.replace))
+ .foregroundStyle(ink)
+ .frame(width: InterfaceMetrics.value(mac: buttonSize, mobile: state == .call ? buttonSize * 1.35 : buttonSize), height: buttonSize)
+ .background(fill, in: Capsule())
+ .contentShape(Capsule())
+ }
+ .buttonStyle(PressScale())
+ .disabled(!enabled)
+ .accessibilityLabel(label)
+ .help(label)
+ .animation(Motion.reduced(Motion.morph, reduceMotion), value: state)
+ .animation(Motion.reduced(Motion.morph, reduceMotion), value: canSend)
+ }
+
private var box: some View {
HStack(alignment: .bottom, spacing: 8) {
+ #if os(macOS)
+ if canAttach {
+ addButton.padding(.bottom, max(0, (textLineHeight + 2 * fieldPadding - buttonSize) / 2))
+ }
+ #endif
- TextField(placeholder, text: $draft, axis: .vertical)
+ TextField(placeholder, text: Binding(get: { draft }, set: { draft = $0 }), axis: .vertical)
.lineLimit(1...8)
.font(typography.body)
.textFieldStyle(.plain)