style: tighten macos chat composer
parent
3b134c8fef
commit
19b847b23b
|
|
@ -18,9 +18,9 @@ struct ClawdisChatComposer: View {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading, spacing: 6) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
if self.showsToolbar {
|
if self.showsToolbar {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 6) {
|
||||||
self.thinkingPicker
|
self.thinkingPicker
|
||||||
Spacer()
|
Spacer()
|
||||||
self.refreshButton
|
self.refreshButton
|
||||||
|
|
@ -134,9 +134,9 @@ struct ClawdisChatComposer: View {
|
||||||
RoundedRectangle(cornerRadius: 12, style: .continuous)
|
RoundedRectangle(cornerRadius: 12, style: .continuous)
|
||||||
.fill(ClawdisChatTheme.composerField))
|
.fill(ClawdisChatTheme.composerField))
|
||||||
.overlay {
|
.overlay {
|
||||||
VStack(alignment: .leading, spacing: 6) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
self.editorOverlay
|
self.editorOverlay
|
||||||
HStack(alignment: .bottom, spacing: 8) {
|
HStack(alignment: .bottom, spacing: 6) {
|
||||||
if self.showsConnectionPill {
|
if self.showsConnectionPill {
|
||||||
self.connectionPill
|
self.connectionPill
|
||||||
}
|
}
|
||||||
|
|
@ -163,8 +163,8 @@ struct ClawdisChatComposer: View {
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 10)
|
.padding(.horizontal, 8)
|
||||||
.padding(.vertical, 6)
|
.padding(.vertical, 4)
|
||||||
.background(ClawdisChatTheme.subtleCard)
|
.background(ClawdisChatTheme.subtleCard)
|
||||||
.clipShape(Capsule())
|
.clipShape(Capsule())
|
||||||
}
|
}
|
||||||
|
|
@ -174,8 +174,8 @@ struct ClawdisChatComposer: View {
|
||||||
if self.viewModel.input.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
if self.viewModel.input.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||||
Text("Message Clawd…")
|
Text("Message Clawd…")
|
||||||
.foregroundStyle(.tertiary)
|
.foregroundStyle(.tertiary)
|
||||||
.padding(.horizontal, 6)
|
.padding(.horizontal, 4)
|
||||||
.padding(.vertical, 5)
|
.padding(.vertical, 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
|
|
@ -183,14 +183,14 @@ struct ClawdisChatComposer: View {
|
||||||
self.viewModel.send()
|
self.viewModel.send()
|
||||||
}
|
}
|
||||||
.frame(minHeight: self.textMinHeight, idealHeight: self.textMinHeight, maxHeight: self.textMaxHeight)
|
.frame(minHeight: self.textMinHeight, idealHeight: self.textMinHeight, maxHeight: self.textMaxHeight)
|
||||||
.padding(.horizontal, 6)
|
.padding(.horizontal, 4)
|
||||||
.padding(.vertical, 4)
|
.padding(.vertical, 3)
|
||||||
#else
|
#else
|
||||||
TextEditor(text: self.$viewModel.input)
|
TextEditor(text: self.$viewModel.input)
|
||||||
.font(.system(size: 15))
|
.font(.system(size: 15))
|
||||||
.scrollContentBackground(.hidden)
|
.scrollContentBackground(.hidden)
|
||||||
.padding(.horizontal, 6)
|
.padding(.horizontal, 4)
|
||||||
.padding(.vertical, 6)
|
.padding(.vertical, 4)
|
||||||
.focused(self.$isFocused)
|
.focused(self.$isFocused)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -211,7 +211,7 @@ struct ClawdisChatComposer: View {
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
.foregroundStyle(.white)
|
.foregroundStyle(.white)
|
||||||
.padding(8)
|
.padding(6)
|
||||||
.background(Circle().fill(Color.red))
|
.background(Circle().fill(Color.red))
|
||||||
.disabled(self.viewModel.isAborting)
|
.disabled(self.viewModel.isAborting)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -227,7 +227,7 @@ struct ClawdisChatComposer: View {
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
.foregroundStyle(.white)
|
.foregroundStyle(.white)
|
||||||
.padding(8)
|
.padding(6)
|
||||||
.background(Circle().fill(Color.accentColor))
|
.background(Circle().fill(Color.accentColor))
|
||||||
.disabled(!self.viewModel.canSend)
|
.disabled(!self.viewModel.canSend)
|
||||||
}
|
}
|
||||||
|
|
@ -258,27 +258,27 @@ struct ClawdisChatComposer: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private var composerPadding: CGFloat {
|
private var composerPadding: CGFloat {
|
||||||
self.style == .onboarding ? 6 : 8
|
self.style == .onboarding ? 5 : 6
|
||||||
}
|
}
|
||||||
|
|
||||||
private var editorPadding: CGFloat {
|
private var editorPadding: CGFloat {
|
||||||
self.style == .onboarding ? 6 : 8
|
self.style == .onboarding ? 5 : 6
|
||||||
}
|
}
|
||||||
|
|
||||||
private var editorMinHeight: CGFloat {
|
private var editorMinHeight: CGFloat {
|
||||||
self.style == .onboarding ? 38 : 44
|
self.style == .onboarding ? 34 : 40
|
||||||
}
|
}
|
||||||
|
|
||||||
private var editorMaxHeight: CGFloat {
|
private var editorMaxHeight: CGFloat {
|
||||||
self.style == .onboarding ? 72 : 96
|
self.style == .onboarding ? 60 : 84
|
||||||
}
|
}
|
||||||
|
|
||||||
private var textMinHeight: CGFloat {
|
private var textMinHeight: CGFloat {
|
||||||
self.style == .onboarding ? 28 : 32
|
self.style == .onboarding ? 24 : 28
|
||||||
}
|
}
|
||||||
|
|
||||||
private var textMaxHeight: CGFloat {
|
private var textMaxHeight: CGFloat {
|
||||||
self.style == .onboarding ? 60 : 72
|
self.style == .onboarding ? 52 : 64
|
||||||
}
|
}
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
|
|
@ -350,7 +350,7 @@ private struct ChatComposerTextView: NSViewRepresentable {
|
||||||
textView.font = .systemFont(ofSize: 14, weight: .regular)
|
textView.font = .systemFont(ofSize: 14, weight: .regular)
|
||||||
textView.textContainer?.lineBreakMode = .byWordWrapping
|
textView.textContainer?.lineBreakMode = .byWordWrapping
|
||||||
textView.textContainer?.lineFragmentPadding = 0
|
textView.textContainer?.lineFragmentPadding = 0
|
||||||
textView.textContainerInset = NSSize(width: 2, height: 6)
|
textView.textContainerInset = NSSize(width: 2, height: 4)
|
||||||
textView.focusRingType = .none
|
textView.focusRingType = .none
|
||||||
|
|
||||||
textView.minSize = .zero
|
textView.minSize = .zero
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue