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
8 changes: 6 additions & 2 deletions ios/Xum/Design/Components/ComposerControls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ struct ComposerRoundModifier: ViewModifier {
struct ComposerChipModifier: ViewModifier {
var isOn: Bool
var isPresented: Bool
/// Off the composer's glass, over the transcript: the chip brings its own glass, or the
/// text scrolling behind its faint fill shows through its label.
var floating: Bool
@ScaledMetric(relativeTo: .subheadline) private var height = ComposerMetrics.chipHeight
@ScaledMetric(relativeTo: .subheadline) private var padding = ComposerMetrics.chipPadding
@Environment(\.composerChipsTight) private var tight
Expand All @@ -60,6 +63,7 @@ struct ComposerChipModifier: ViewModifier {
.padding(.horizontal, tight ? padding - 2 : padding)
.frame(height: height)
.background(background, in: RoundedRectangle(cornerRadius: height / 2))
.glassEffect(floating ? .regular : .identity, in: RoundedRectangle(cornerRadius: height / 2))
.contentShape(ComposerHitShape(outset: 0))
}

Expand All @@ -74,8 +78,8 @@ extension View {
modifier(ComposerRoundModifier(isProminent: prominent))
}

func composerChip(isOn: Bool = false, isPresented: Bool = false) -> some View {
modifier(ComposerChipModifier(isOn: isOn, isPresented: isPresented))
func composerChip(isOn: Bool = false, isPresented: Bool = false, floating: Bool = false) -> some View {
modifier(ComposerChipModifier(isOn: isOn, isPresented: isPresented, floating: floating))
}
}

Expand Down
10 changes: 5 additions & 5 deletions ios/Xum/Screens/Chat/ActivityLine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,26 @@ struct ActivityLine: View {
// whatever the line leaves (PLAIN_CHIP_RESERVE_PX).
.frame(minWidth: 40, idealWidth: 104, maxWidth: .infinity, alignment: .leading)
}
.composerChip(isPresented: open == kind)
.composerChip(isPresented: open == kind, floating: true)
case .subAgents:
HStack(spacing: 5) {
Image(systemName: state.tray.namesWorkflows ? "point.3.connected.trianglepath.dotted" : "person.2")
.font(.system(size: 12, weight: .semibold))
Text("\(state.tray.count)").monospacedDigit()
if state.tray.isLive { LiveDot() }
}
.composerChip(isPresented: open == kind)
.composerChip(isPresented: open == kind, floating: true)
case .bashes:
HStack(spacing: 5) {
Image(systemName: "terminal").font(.system(size: 12, weight: .semibold))
Text("\(state.bashes.count)").monospacedDigit()
if state.bashes.contains(where: \.isRunning) { LiveDot() }
}
.composerChip(isPresented: open == kind)
.composerChip(isPresented: open == kind, floating: true)
case .instructions:
Image(systemName: "book")
.font(.system(size: 12, weight: .semibold))
.composerChip(isPresented: open == kind)
.composerChip(isPresented: open == kind, floating: true)
}
}

Expand All @@ -101,7 +101,7 @@ struct ActivityLine: View {
}
} label: {
Text("+\(hidden.count)").monospacedDigit()
.composerChip(isPresented: open.map { hidden.contains($0) } ?? false)
.composerChip(isPresented: open.map { hidden.contains($0) } ?? false, floating: true)
}
.accessibilityLabel("\(hidden.count) more")
}
Expand Down
Loading