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.

feat(apps): clearer call conversations and a visible call bar for dark bots

leepokaib4fd3394b6eb
diff --git a/apps/android/WhatsNew.md b/apps/android/WhatsNew.md
index 0d6a0507..40b9e644 100644
--- a/apps/android/WhatsNew.md
+++ b/apps/android/WhatsNew.md
@@ -14,10 +14,11 @@ else a generic "Bug fixes and improvements" line. Delete old sections.
- 介面新增巴西葡萄牙文:可在設定選擇「Português (Brasil)」,或跟隨系統的葡萄牙文語言。
- 新增俄文介面:在設定選擇「Русский」,或跟隨系統的俄文語言。
- 用 QR Code 配對時,如果電腦當下沒能加入你的帳號(例如手機連不上 Codync 雲端,或電腦的雲端關著),下次連上時會自動補上。
+- 語音通話的對話紀錄更好讀,通話列在 bot 沒說話時也會顯示一排靜止的點。
### en-US
- Fixed a crash when the connection to your computer dropped.
- A one-off speech recognition error in a voice call now sends what was heard and keeps listening, instead of ending the call.
-- Choose Português (Brasil) in Settings, or follow your Portuguese system language.
-- Choose Русский in Settings, or follow your Russian system language.
-- A computer you pair with a QR code that couldn't join your account at the time (the phone couldn't reach the Codync cloud, or the computer's cloud was off, say) joins it the next time it connects.
+- Choose Português (Brasil) or Русский in Settings, or follow your system language.
+- A computer you pair by QR code that couldn't join your account at the time joins it when it next connects.
+- A call's conversation is easier to read, and the call bar shows a still row of dots while the bot isn't talking.
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/BotAvatar.kt b/apps/android/app/src/main/kotlin/com/codync/android/BotAvatar.kt
index c19bec72..858baff5 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/BotAvatar.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/BotAvatar.kt
@@ -14,10 +14,11 @@ import androidx.compose.ui.unit.dp
import com.codync.android.core.Bot
import com.codync.android.design.*
-/** A bot's character, or a group's members. */
-@Composable internal fun BotAvatar(bot: Bot, bots: List<Bot>, size: Dp = 44.dp) {
- if (bot.kind == "group" && bot.customIcon == null) GroupAvatar(bot.memberBots(bots).map { AvatarFace(it.avatarShape, it.avatarColor, it.status, it.customIcon?.dataUrl, it.customIcon?.tinted == true) }, size)
- else CharacterAvatar(bot.avatarShape, bot.avatarColor, size, bot.status, customImage = bot.customIcon?.dataUrl, customTinted = bot.customIcon?.tinted == true)
+/** A bot's character, or a group's members; still (idle) unless [animated]. */
+@Composable internal fun BotAvatar(bot: Bot, bots: List<Bot>, size: Dp = 44.dp, animated: Boolean = true) {
+ fun status(of: Bot) = if (animated) of.status else "idle"
+ if (bot.kind == "group" && bot.customIcon == null) GroupAvatar(bot.memberBots(bots).map { AvatarFace(it.avatarShape, it.avatarColor, status(it), it.customIcon?.dataUrl, it.customIcon?.tinted == true) }, size)
+ else CharacterAvatar(bot.avatarShape, bot.avatarColor, size, status(bot), customImage = bot.customIcon?.dataUrl, customTinted = bot.customIcon?.tinted == true)
}
/** The roster's avatar, with its status dot (iOS `AvatarWithStatus`): amber needs you, the accent dot is unread. */
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/CallRows.kt b/apps/android/app/src/main/kotlin/com/codync/android/CallRows.kt
index 8f3ad876..f3fc4622 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/CallRows.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/CallRows.kt
@@ -43,7 +43,7 @@ import kotlinx.serialization.json.longOrNull
/** A voice call's line in the chat (iOS `CallLineRow`): its title, written once the call ends, and length; it opens the call. */
@Composable internal fun CallLineRow(entry: Entry, open: () -> Unit) {
val title = tr(entry.text.ifEmpty { "Voice chat" })
- val length = entry.data["callSeconds"]?.jsonPrimitive?.longOrNull?.let { " · %02d:%02d".format(it / 60, it % 60) }.orEmpty()
+ val length = callLength(entry)
Row(Modifier.fillMaxWidth().plainButton(action = open).semantics(mergeDescendants = true) { contentDescription = title + length }
.padding(vertical = 6.dp), verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(6.dp, Alignment.CenterHorizontally)) {
@@ -73,34 +73,61 @@ import kotlinx.serialization.json.longOrNull
}
val loading = tr("Loading the call")
val messages = line?.let { entries.withCallEntries(fetched.orEmpty()).callConversation(it) }.orEmpty()
+ val note = error ?: if (fetched != null && messages.isEmpty()) "Nothing was said on this call." else null
val list = rememberLazyListState()
- LaunchedEffect(messages.size) { if (messages.isNotEmpty()) list.scrollToItem(messages.lastIndex) }
+ // The header item comes first, so the last message is at messages.size.
+ LaunchedEffect(messages.size) { if (messages.isNotEmpty()) list.scrollToItem(messages.size) }
Column(Modifier.fillMaxSize().background(Palette.background)) {
ModalHeader(tr(line?.text?.ifEmpty { null } ?: "Voice chat"))
- LazyColumn(Modifier.fillMaxSize(), state = list, contentPadding = PaddingValues(start = 16.dp, end = 16.dp, bottom = 12.dp),
- verticalArrangement = Arrangement.spacedBy(10.dp)) {
- if (error != null || fetched != null && messages.isEmpty()) item("empty") {
- Text(tr(error ?: "Nothing was said on this call."), Modifier.fillMaxWidth().padding(top = 24.dp), style = Type.footnote,
- color = if (error != null) Palette.danger else Palette.tertiary, textAlign = TextAlign.Center)
- } else if (fetched == null && call != null) item("loading") {
- Box(Modifier.fillMaxWidth().padding(top = 24.dp).clearAndSetSemantics { contentDescription = loading },
- contentAlignment = Alignment.Center) { Spinner(14.dp) }
+ LazyColumn(Modifier.fillMaxSize(), state = list, contentPadding = PaddingValues(start = 16.dp, end = 16.dp, bottom = 16.dp)) {
+ item("top") {
+ Column {
+ if (line != null) CallHeader(line, state)
+ if (note != null) Text(tr(note), Modifier.fillMaxWidth().padding(bottom = 16.dp), style = Type.footnote,
+ color = if (error != null) Palette.danger else Palette.tertiary, textAlign = TextAlign.Center)
+ else if (fetched == null && call != null) Box(Modifier.fillMaxWidth().padding(bottom = 16.dp)
+ .clearAndSetSemantics { contentDescription = loading }, contentAlignment = Alignment.Center) { Spinner(14.dp) }
+ }
+ }
+ itemsIndexed(messages) { i, message ->
+ Box(Modifier.padding(top = if (i == 0) 0.dp else message.gap(after = messages[i - 1]))) { CallMessageRow(message) }
}
- itemsIndexed(messages) { _, message -> CallMessageRow(message) }
}
}
}
+/** Who the call was with, when it ended and how long it lasted, above what was said (iOS `CallHeader`). */
+@Composable private fun CallHeader(line: Entry, state: AppState) {
+ val bot = state.bots.firstOrNull { it.id == line.botId }
+ Column(Modifier.fillMaxWidth().padding(top = 12.dp, bottom = 28.dp).semantics(mergeDescendants = true) {},
+ horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(4.dp)) {
+ if (bot != null) {
+ Box(Modifier.padding(bottom = 8.dp)) { BotAvatar(bot, state.bots, 52.dp, animated = false) }
+ Text(bot.name, style = Type.headline, color = Palette.text)
+ }
+ Text(RelativeTime.separator(line.createdAt, tr("Today"), tr("Yesterday")) + callLength(line),
+ style = Type.footnote.monospacedDigit, color = Palette.tertiary)
+ }
+}
+
+/** The space above a message: wide where you start a new exchange, close within one. */
+private fun CallMessage.gap(after: CallMessage) =
+ if (speaker == CallMessage.Speaker.User && after.speaker != CallMessage.Speaker.User) 24.dp else 8.dp
+
+/** A call line's length after its title or time: " · 00:16"; empty while it has none. */
+internal fun callLength(line: Entry) =
+ line.data["callSeconds"]?.jsonPrimitive?.longOrNull?.let { " · %02d:%02d".format(it / 60, it % 60) }.orEmpty()
+
@Composable private fun CallMessageRow(message: CallMessage) {
when (message.speaker) {
- CallMessage.Speaker.User -> Box(Modifier.fillMaxWidth().padding(start = 40.dp), contentAlignment = Alignment.CenterEnd) {
+ CallMessage.Speaker.User -> Box(Modifier.fillMaxWidth().padding(start = 56.dp), contentAlignment = Alignment.CenterEnd) {
SelectionContainer {
- Text(message.text, Modifier.clip(RoundedRectangle(18.dp)).background(Palette.bubbleUser).padding(horizontal = 14.dp, vertical = 9.dp),
+ Text(message.text, Modifier.clip(RoundedRectangle(18.dp)).background(Palette.bubbleUser).padding(horizontal = 16.dp, vertical = 10.dp),
style = Type.body, color = Palette.text)
}
}
CallMessage.Speaker.Voice -> SelectionContainer {
- Text(message.text, Modifier.fillMaxWidth().padding(end = 40.dp), style = Type.body, color = Palette.secondary)
+ Text(message.text, Modifier.fillMaxWidth().padding(end = 40.dp), style = Type.body, color = Palette.text)
}
CallMessage.Speaker.VoiceToBot -> SelectionContainer { Text("↳ " + message.text, style = Type.footnote, color = Palette.secondary) }
CallMessage.Speaker.Bot -> Box(Modifier.fillMaxWidth().padding(end = 40.dp), contentAlignment = Alignment.CenterStart) {
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ChatRows.kt b/apps/android/app/src/main/kotlin/com/codync/android/ChatRows.kt
index 8ebf8afc..d805b674 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/ChatRows.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/ChatRows.kt
@@ -64,7 +64,6 @@ import kotlinx.serialization.json.decodeFromJsonElement
import kotlinx.serialization.json.jsonArray
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
-import kotlinx.serialization.json.longOrNull
/** One row of a conversation, as iOS `ChatItem` builds them. */
internal sealed interface ChatItem {
val id: String
@@ -334,12 +333,12 @@ internal val Entry.botReactions: Map<String, List<String>> get() =
/** A line from the computer. `addFallback`, on a failure the bot's fallbacks could have carried, opens them. */
@Composable private fun NoticeRow(entry: Entry, addFallback: (() -> Unit)?) {
val text = entry.text
- val seconds = entry.data["callSeconds"]?.jsonPrimitive?.longOrNull
+ val length = callLength(entry)
when {
- seconds != null -> Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center, verticalAlignment = Alignment.CenterVertically) {
+ length.isNotEmpty() -> Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center, verticalAlignment = Alignment.CenterVertically) {
Symbol("waveform", size = 15.dp, tint = Palette.secondary)
Spacer(Modifier.width(6.dp))
- Text("$text · %02d:%02d".format(seconds / 60, seconds % 60), style = Type.footnote.monospacedDigit, color = Palette.secondary)
+ Text(text + length, style = Type.footnote.monospacedDigit, color = Palette.secondary)
}
entry.data.text("style") == "error" -> Row(Modifier.fillMaxWidth().clip(RoundedRectangle(12.dp))
.background(Palette.danger.copy(alpha = 0.12f)).padding(12.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/DictationControls.kt b/apps/android/app/src/main/kotlin/com/codync/android/DictationControls.kt
index 95d09520..a735dc85 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/DictationControls.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/DictationControls.kt
@@ -104,7 +104,7 @@ import kotlinx.coroutines.delay
LaunchedEffect(dictation.startedAt) { while (true) { now = SystemClock.elapsedRealtime(); delay(500) } }
val seconds = ((now - dictation.startedAt) / 1000).coerceAtLeast(0)
Text("%d:%02d".format(seconds / 60, seconds % 60), style = Type.subheadline.monospacedDigit, color = Palette.text)
- LevelDots(dictation.level, speaking = false, working = false, connecting = false, color = Palette.text,
+ LevelDots(dictation.level, speaking = false, working = false, connecting = false,
modifier = Modifier.size(32.dp, 12.dp).semantics { contentDescription = "Listening" })
}
}
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/VoiceControls.kt b/apps/android/app/src/main/kotlin/com/codync/android/VoiceControls.kt
index 16a94d3f..8ab8ccbd 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/VoiceControls.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/VoiceControls.kt
@@ -69,7 +69,6 @@ internal fun openAppSettings(context: android.content.Context) =
@Composable internal fun CallBar(call: VoiceCallViewState, state: AppState, store: AppStore) {
val voice = call.state
val bot = state.bots.firstOrNull { it.id == call.botId }
- val color = bot?.let { AvatarPalette.tint(it.avatarColor) } ?: Palette.accent
var settings by remember { mutableStateOf(false) }
val speaking = voice.phase == VoicePhase.Speaking
Column(Modifier.padding(horizontal = 12.dp), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(6.dp)) {
@@ -83,7 +82,7 @@ internal fun openAppSettings(context: android.content.Context) =
.semantics { contentDescription = if (speaking) "Interrupt" else bot?.name.orEmpty() }) {
if (bot != null) BotAvatar(bot, state.bots, 34.dp)
}
- LevelDots(voice.level, speaking, bot?.status == "working", voice.phase.connecting, color,
+ LevelDots(voice.level, speaking, bot?.status == "working", voice.phase.connecting,
Modifier.weight(1f).height(20.dp).semantics { contentDescription = statusText(voice, bot?.status == "working") })
// Audio leaves the phone: say where.
voice.provider?.let { provider ->
@@ -134,11 +133,12 @@ private const val CONNECTING_PERIOD = 2.4f
/**
* The dotted line in the call bar: it follows your voice while listening, ripples while the bot
- * talks, breathes while it works, and rests as faint dots otherwise. While the call connects it shows
+ * talks, breathes while it works, and rests as a still row of dots otherwise, in the ink color so a dark
+ * bot's line stays visible on the dark bar. While the call connects it shows
* an indeterminate progress line instead (a short segment gliding back and forth along a faint track,
* resting at the left with reduced motion), and fades back to the dots.
*/
-@Composable internal fun LevelDots(level: Float, speaking: Boolean, working: Boolean, connecting: Boolean, color: Color, modifier: Modifier) {
+@Composable internal fun LevelDots(level: Float, speaking: Boolean, working: Boolean, connecting: Boolean, modifier: Modifier) {
val still = reduceMotion()
var time by remember { mutableFloatStateOf(0f) }
if (!still) LaunchedEffect(Unit) { while (true) withFrameNanos { time = it / 1e9f } }
@@ -158,7 +158,7 @@ private const val CONNECTING_PERIOD = 2.4f
else -> 0.08f
}
val height = 4.dp.toPx() + amount * (size.height - 4.dp.toPx())
- drawRoundRect((if (speaking) accent else color).copy(alpha = (0.5f + 0.5f * amount) * (1 - mix)),
+ drawRoundRect(accent.copy(alpha = (0.5f + 0.5f * amount) * (1 - mix)),
Offset(i * spacing + spacing / 2 - width / 2, (size.height - height) / 2), Size(width, height), CornerRadius(width / 2))
}
}
diff --git a/apps/desktop/e2e/call-conversation.spec.ts b/apps/desktop/e2e/call-conversation.spec.ts
new file mode 100644
index 00000000..22ee62d4
--- /dev/null
+++ b/apps/desktop/e2e/call-conversation.spec.ts
@@ -0,0 +1,113 @@
+import { test, expect, type Page } from '@playwright/test'
+import { randomUUID } from 'node:crypto'
+import { tmpdir } from 'node:os'
+import type { HostSnapshot } from '../src/shared/ipc.ts'
+import { attach } from './sandbox.ts'
+
+type Host = {
+ snapshot(): Promise<HostSnapshot>
+ call(baseURL: string, token: string, method: string, body: unknown, timeoutMs: number): Promise<unknown>
+}
+
+/** POST /api/<method> on the sandbox host, through the bridge the renderer uses. */
+function api<T>(page: Page, method: string, body: unknown): Promise<T> {
+ return page.evaluate(async ([method, body]) => {
+ const host = (window as unknown as { codync: { host: Host } }).codync.host
+ const local = (await host.snapshot()).local
+ if (!local) throw new Error('The sandbox host has not answered yet.')
+ return host.call(local.baseURL, local.token, method, body, 30_000)
+ }, [method, body] as const) as Promise<T>
+}
+
+/** A call the host has ended, with what was said on it, as its line in the chat. */
+async function endedCall(page: Page, botId: string, seconds: number, said: ['user' | 'voice', string][]) {
+ const callId = randomUUID()
+ await api(page, 'startCall', { botId, callId, mode: 'device' })
+ const at = Date.now()
+ const lines = said.map(([from, text], i) => ({ from, text, at: at + i * 1000, id: randomUUID() }))
+ await api(page, 'endCall', { botId, callId, seconds, lines })
+}
+
+/** The colors of the call bar's dots, by how many opaque pixels have each. */
+const dotColors = (page: Page) =>
+ page.locator('canvas.call-dots').evaluate((canvas: HTMLCanvasElement) => {
+ const data = canvas.getContext('2d')!.getImageData(0, 0, canvas.width, canvas.height).data
+ const colors: Record<string, number> = {}
+ for (let i = 0; i < data.length; i += 4) {
+ if (data[i + 3] > 100) colors[`${data[i]},${data[i + 1]},${data[i + 2]}`] = (colors[`${data[i]},${data[i + 1]},${data[i + 2]}`] ?? 0) + 1
+ }
+ return Object.keys(colors)
+ })
+
+test("a call's conversation shows who and when on top, and a black bot's call dots stay visible", async () => {
+ const { browser, page } = await attach()
+ const name = `Call check ${randomUUID().slice(0, 6)}`
+ const { bot } = await api<{ bot: { id: string } }>(page, 'createBot', {
+ name, avatarColor: 'black', avatarShape: 'blob', backend: 'claude', cwd: tmpdir(), connectors: [], skills: [],
+ })
+ try {
+ await endedCall(page, bot.id, 3, [])
+ await endedCall(page, bot.id, 16, [
+ ['user', 'Can you check the build?'],
+ ['voice', 'Sure, it passed a minute ago.'],
+ ['voice', 'Two tests were skipped.'],
+ ['user', 'Thanks, that is all.'],
+ ['voice', 'You are welcome.'],
+ ])
+ await endedCall(page, bot.id, 185, Array.from({ length: 20 }, (_, i): ['user' | 'voice', string][] => [
+ ['user', `Question ${i + 1} about the release?`],
+ ['voice', `Answer ${i + 1}: it goes out once the review is green.`],
+ ]).flat())
+
+ await page.getByText(name, { exact: true }).first().click()
+ const lines = page.locator('.call-line-row')
+ await expect(lines).toHaveCount(3)
+ const sheet = page.locator('.bot-conversation')
+ const scroller = sheet.locator('.bot-conversation-scroll')
+
+ // A short call: the header, then what was said, read from the top.
+ await lines.nth(1).click()
+ const header = sheet.locator('.call-header')
+ await expect(header).toContainText(name)
+ await expect(header).toContainText(/Today .+ · 00:16/)
+ await expect(header.locator('.call-header-avatar > *').first()).toHaveCSS('width', '52px')
+ await expect(sheet.getByText('You are welcome.')).toBeVisible()
+ expect(await scroller.evaluate((el) => el.scrollTop)).toBe(0)
+ // The voice's words in the text color, like the bot's name.
+ const ink = await header.getByText(name).evaluate((el) => getComputedStyle(el).color)
+ await expect(sheet.getByText('Sure, it passed a minute ago.')).toHaveCSS('color', ink)
+ // Close within an exchange, wide where you speak after the other side.
+ await expect(sheet.locator('.call-gap', { hasText: 'Two tests were skipped.' })).toHaveCSS('padding-top', '8px')
+ await expect(sheet.locator('.call-gap-wide', { hasText: 'Thanks, that is all.' })).toHaveCSS('padding-top', '24px')
+ await page.keyboard.press('Escape')
+ await expect(sheet).toHaveCount(0)
+
+ // A long call opens at its end.
+ await lines.nth(2).click()
+ await expect(sheet.getByText('Answer 20: it goes out once the review is green.')).toBeVisible()
+ await expect.poll(() => scroller.evaluate((el) => el.scrollHeight - el.clientHeight - el.scrollTop)).toBeLessThan(2)
+ await page.keyboard.press('Escape')
+ await expect(sheet).toHaveCount(0)
+
+ // A call where nothing was said says so under its header.
+ await lines.nth(0).click()
+ await expect(sheet.locator('.call-header')).toContainText(/· 00:03/)
+ await expect(sheet.getByText('Nothing was said on this call.')).toBeVisible()
+ await page.keyboard.press('Escape')
+ await expect(sheet).toHaveCount(0)
+
+ // The call bar's dots are the ink color, never the bot's black, so they show on the dark bar too.
+ await page.getByRole('button', { name: 'Call', exact: true }).click()
+ await expect(page.locator('canvas.call-dots')).toBeVisible()
+ for (const [scheme, ink] of [['light', '0,0,0'], ['dark', '255,255,255']] as const) {
+ await page.emulateMedia({ colorScheme: scheme })
+ await expect.poll(() => dotColors(page)).toEqual([ink])
+ }
+ await page.getByRole('button', { name: 'End call' }).click()
+ await expect(page.locator('canvas.call-dots')).toHaveCount(0)
+ } finally {
+ await page.emulateMedia({ colorScheme: null })
+ await api(page, 'deleteBot', { botId: bot.id }).catch(() => {})
+ await browser.close()
+ }
+})
diff --git a/apps/desktop/src/renderer/components/Avatar.tsx b/apps/desktop/src/renderer/components/Avatar.tsx
index 6703149f..0d665a39 100644
--- a/apps/desktop/src/renderer/components/Avatar.tsx
+++ b/apps/desktop/src/renderer/components/Avatar.tsx
@@ -288,11 +288,16 @@ export function GroupAvatar({ members, size = 40, animated = true }: { members:
return <div aria-hidden className="avatar-frame" style={{ width: size, height: size }}>{content}</div>
}
+/** A bot's character, or a group's members (Android `BotAvatar`). */
+export function BotOrGroupAvatar({ bot, members = [], size = 44, animated = true }: { bot: Bot; members?: Bot[]; size?: number; animated?: boolean }) {
+ return isGroup(bot) && !bot.customIcon ? <GroupAvatar members={members} size={size} animated={animated} /> : <BotAvatar bot={bot} size={size} animated={animated} />
+}
+
/** Avatar with the roster status dot: filled = unread, amber = needs you. A group shows its members. */
export function AvatarWithStatus({ bot, members = [], size = 44 }: { bot: Bot; members?: Bot[]; size?: number }) {
return (
<div className={`avatar-frame ${bot.lead ? 'lead-avatar' : ''}`} style={{ width: size, height: size }}>
- {isGroup(bot) && !bot.customIcon ? <GroupAvatar members={members} size={size} /> : <BotAvatar bot={bot} size={size} />}
+ <BotOrGroupAvatar bot={bot} members={members} size={size} />
{bot.lead ? <LeadAgentBadge size={Math.max(12, size * 0.34)} /> : null}
{needsInput(bot) ? (
<div className="avatar-badge needs-you" style={{ width: size * 0.36, height: size * 0.36 }}>
diff --git a/apps/desktop/src/renderer/components/LevelDots.tsx b/apps/desktop/src/renderer/components/LevelDots.tsx
index 769dda2a..b7ed290b 100644
--- a/apps/desktop/src/renderer/components/LevelDots.tsx
+++ b/apps/desktop/src/renderer/components/LevelDots.tsx
@@ -16,14 +16,14 @@ const PERIOD = 2.4
/**
* A dotted line that follows your voice while listening, ripples while the other side talks,
- * breathes while work goes on, and rests as faint dots otherwise. While a call connects it shows an
+ * breathes while work goes on, and rests as a still row of dots otherwise. While a call connects it shows an
* indeterminate progress line instead (a short segment gliding back and forth along a faint track, resting
* at the left with reduced motion), and fades back to the dots. `sample` is read every frame.
- * `color` null is the text color.
+ * `color` defaults to the ink color, so a dark bot's line stays visible on the dark call bar.
*/
export function LevelDots({ sample, color, width, height = 16, label, className }: {
sample: () => LevelSample
- color: string | null
+ color?: string
width: number
height?: number
label: string
@@ -51,7 +51,7 @@ export function LevelDots({ sample, color, width, height = 16, label, className
const { level, speaking = false, working = false, connecting = false } = sample()
const t = reduceMotion ? 0 : now / 1000
const accent = dark ? '#ffffff' : '#000000'
- const tint = speaking ? accent : (color ?? accent)
+ const tint = color ?? accent
const target = connecting ? 1 : 0
mix = reduceMotion || !last ? target : mix + (target - mix) * Math.min(1, ((now - last) / 1000) * 8)
last = now
diff --git a/apps/desktop/src/renderer/components/RecordingPill.tsx b/apps/desktop/src/renderer/components/RecordingPill.tsx
index 04573e13..abd10e72 100644
--- a/apps/desktop/src/renderer/components/RecordingPill.tsx
+++ b/apps/desktop/src/renderer/components/RecordingPill.tsx
@@ -22,14 +22,14 @@ function useElapsed(startedAt: number) {
/**
* Dictation in progress, in place of the mic: stop, the time since it started, and dots that
* follow the microphone's level; `transcribing` once a recording waits for its transcript.
- * `color` null is the text color.
+ * `color` defaults to the text color.
*/
-export function RecordingPill({ startedAt, sample, onStop, transcribing = false, color = null, className = '' }: {
+export function RecordingPill({ startedAt, sample, onStop, transcribing = false, color, className = '' }: {
startedAt: number
sample: () => LevelSample
onStop: () => void
transcribing?: boolean
- color?: string | null
+ color?: string
className?: string
}) {
const tr = useTr()
diff --git a/apps/desktop/src/renderer/views/call/CallRows.tsx b/apps/desktop/src/renderer/views/call/CallRows.tsx
index 24b6b448..92443735 100644
--- a/apps/desktop/src/renderer/views/call/CallRows.tsx
+++ b/apps/desktop/src/renderer/views/call/CallRows.tsx
@@ -1,6 +1,7 @@
import { callConversation, withCallEntries, type CallMessage } from '@shared/calls'
import type { Entry } from '@shared/models'
import { useEffect, useRef } from 'react'
+import { BotOrGroupAvatar } from '../../components/Avatar'
import { Spinner } from '../../components/Controls'
import { Icon } from '../../components/Icon'
import { ModalHeader } from '../../components/Overlay'
@@ -10,21 +11,20 @@ import { useFetched } from '../../lib/use-fetched'
import { useTr } from '../../lib/use-language'
import { useStore } from '../../store/context'
import { Bubble } from '../thread/ChatRows'
+import { callLength, relativeTime } from '../thread/chat-items'
import { MarkdownText } from '../thread/Markdown'
import '../thread/bot-conversation.css'
-
-const length = (seconds?: number) =>
- seconds === undefined ? '' : ` · ${String(Math.floor(seconds / 60)).padStart(2, '0')}:${String(seconds % 60).padStart(2, '0')}`
+import './call.css'
/** A voice call's line in the chat: its title (written once the call ends) and length; it opens the call. */
export function CallLineRow({ entry, open }: { entry: Entry; open: () => void }) {
const tr = useTr()
const title = tr(entry.data.text || 'Voice chat')
return (
- <button className="press call-line-row" onClick={open} title={tr('Open the call')} aria-label={`${title}${length(entry.data.callSeconds)}`}>
+ <button className="press call-line-row" onClick={open} title={tr('Open the call')} aria-label={`${title}${callLength(entry.data.callSeconds)}`}>
<Icon name="waveform" size={10} color="var(--secondary)" />
<Text size="footnote" tone="text" truncate>{title}</Text>
- <Text size="footnote" tone="secondary" tabular>{length(entry.data.callSeconds)}</Text>
+ <Text size="footnote" tone="secondary" tabular>{callLength(entry.data.callSeconds)}</Text>
<Icon name="chevron.right" size={10} color="var(--tertiary)" />
</button>
)
@@ -52,17 +52,43 @@ export function CallConversationView({ botId, lineId }: { botId: string; lineId:
<div className="bot-conversation">
<ModalHeader title={tr(line?.data.text || 'Voice chat')} />
<div className="bot-conversation-scroll" ref={scroller}>
- <VStack gap={10} className="bot-conversation-rows">
- {error ? <Text as="div" size="footnote" tone="danger" className="bot-conversation-note">{error}</Text> : null}
- {fetched === null && !error && call ? <div className="bot-conversation-note" aria-label={tr('Loading the call')}><Spinner /></div> : null}
- {!error && fetched !== null && messages.length === 0 ? <Text as="div" size="footnote" tone="tertiary" className="bot-conversation-note">{tr('Nothing was said on this call.')}</Text> : null}
- {messages.map((m, i) => <CallMessageRow key={i} message={m} />)}
+ <VStack className="bot-conversation-rows">
+ {line ? <CallHeader botId={botId} line={line} /> : null}
+ {error ? <Text as="div" size="footnote" tone="danger" className="call-note">{error}</Text> : null}
+ {fetched === null && !error && call ? <div className="call-note" aria-label={tr('Loading the call')}><Spinner /></div> : null}
+ {!error && fetched !== null && messages.length === 0 ? <Text as="div" size="footnote" tone="tertiary" className="call-note">{tr('Nothing was said on this call.')}</Text> : null}
+ {messages.map((m, i) => (
+ <div key={i} className={i === 0 ? undefined : opensExchange(m, messages[i - 1]) ? 'call-gap-wide' : 'call-gap'}>
+ <CallMessageRow message={m} />
+ </div>
+ ))}
</VStack>
</div>
</div>
)
}
+/** Who the call was with, when it ended and how long it lasted, above what was said. */
+function CallHeader({ botId, line }: { botId: string; line: Entry }) {
+ const tr = useTr()
+ const store = useStore()
+ const bot = store.bots.get(botId)
+ return (
+ <VStack gap={4} align="center" className="call-header">
+ {bot ? (
+ <>
+ <div className="call-header-avatar"><BotOrGroupAvatar bot={bot} members={store.members(bot)} size={52} animated={false} /></div>
+ <Text size="headline" tone="text">{bot.name}</Text>
+ </>
+ ) : null}
+ <Text size="footnote" tone="tertiary" tabular>{relativeTime.separator(line.createdAt, tr)}{callLength(line.data.callSeconds)}</Text>
+ </VStack>
+ )
+}
+
+/** Whether `message` starts a new exchange (you speak after the other side), which gets more room above it. */
+const opensExchange = (message: CallMessage, previous?: CallMessage) => message.speaker === 'user' && previous?.speaker !== 'user'
+
function CallMessageRow({ message }: { message: CallMessage }) {
const copy = () => [{ title: 'Copy', icon: 'square.on.square', action: () => window.codync.app.copy(message.text) }]
switch (message.speaker) {
@@ -73,7 +99,7 @@ function CallMessageRow({ message }: { message: CallMessage }) {
</div>
)
case 'voice':
- return <Text as="div" tone="secondary" className="selectable">{message.text}</Text>
+ return <Text as="div" tone="text" className="selectable">{message.text}</Text>
case 'voiceToBot':
return <Text as="div" size="footnote" tone="secondary" className="selectable">↳ {message.text}</Text>
case 'bot':
diff --git a/apps/desktop/src/renderer/views/call/CallView.tsx b/apps/desktop/src/renderer/views/call/CallView.tsx
index 6da05028..1e44cfa8 100644
--- a/apps/desktop/src/renderer/views/call/CallView.tsx
+++ b/apps/desktop/src/renderer/views/call/CallView.tsx
@@ -8,7 +8,6 @@ import { LevelDots } from '../../components/LevelDots'
import { Sheet } from '../../components/Overlay'
import { Text } from '../../components/Text'
import { useModel } from '../../lib/observable'
-import { avatarColor } from '../../lib/theme'
import { analytics } from '../../store/analytics'
import { useStore } from '../../store/context'
import { VoiceChatSettingsView } from '../settings/VoiceChatSettingsView'
@@ -77,7 +76,6 @@ export function CallView({ botId, onSpeaking, interrupt, onEnd }: {
const engineName = useRef<VoiceCallEngine>('on_device')
const counted = useRef(false)
const bot = store.bots.get(botId)
- const color = bot ? avatarColor(bot.avatarColor) : null
/** The call on the computer, which runs it. */
const link = useRef<CallLink | null>(null)
link.current ??= new CallLink(store, botId, crypto.randomUUID())
@@ -247,7 +245,6 @@ export function CallView({ botId, onSpeaking, interrupt, onEnd }: {
</button>
<LevelDots
sample={() => ({ level: session?.level ?? 0, speaking: session?.phase === 'speaking', working, connecting: connecting && !blocked })}
- color={color}
width={120}
label={statusText(phase, muted, working)}
className="call-dots"
diff --git a/apps/desktop/src/renderer/views/call/call.css b/apps/desktop/src/renderer/views/call/call.css
index ca47d8ba..6135ab8e 100644
--- a/apps/desktop/src/renderer/views/call/call.css
+++ b/apps/desktop/src/renderer/views/call/call.css
@@ -92,3 +92,22 @@
padding: 6px 0;
max-width: 100%;
}
+
+/* The call's conversation: who it was with and when on top, then what was said. */
+.call-header {
+ padding: 12px 0 28px;
+}
+.call-header-avatar {
+ padding-bottom: 8px;
+}
+.call-note {
+ text-align: center;
+ padding-bottom: 16px;
+}
+/* Close within an exchange, wide where you start the next one. */
+.call-gap {
+ padding-top: 8px;
+}
+.call-gap-wide {
+ padding-top: 24px;
+}
diff --git a/apps/desktop/src/renderer/views/thread/ChatRows.tsx b/apps/desktop/src/renderer/views/thread/ChatRows.tsx
index 08eda016..74af248e 100644
--- a/apps/desktop/src/renderer/views/thread/ChatRows.tsx
+++ b/apps/desktop/src/renderer/views/thread/ChatRows.tsx
@@ -14,7 +14,7 @@ import { avatarColor } from '../../lib/theme'
import { useStore as useLiveStore, useStoreRef as useStore } from '../../store/context'
import { QUICK_REACTIONS, type BotStore } from '../../store/bot-store'
import { AttachmentList } from './Attachments'
-import { relativeTime } from './chat-items'
+import { callLength, relativeTime } from './chat-items'
import { MarkdownText } from './Markdown'
import { PermissionCard } from './PermissionCard'
import { ConnectionRequestCard } from '../marketplace/ConnectionRequestCard'
@@ -206,11 +206,10 @@ export function AgentBubble({ entry, openTrace, reply, openArtifact }: { entry:
export function NoticeRow({ entry, addFallback }: { entry: Entry; addFallback?: () => void }) {
const text = entry.data.text ?? ''
if (entry.data.callSeconds !== undefined) {
- const s = entry.data.callSeconds
return (
<HStack justify="center" gap={6}>
<Icon name="waveform" size={10} color="var(--secondary)" />
- <Text size="footnote" tone="secondary" tabular>{`${text} · ${String(Math.floor(s / 60)).padStart(2, '0')}:${String(s % 60).padStart(2, '0')}`}</Text>
+ <Text size="footnote" tone="secondary" tabular>{text + callLength(entry.data.callSeconds)}</Text>
</HStack>
)
}
diff --git a/apps/desktop/src/renderer/views/thread/chat-items.ts b/apps/desktop/src/renderer/views/thread/chat-items.ts
index ef89492d..aaa617f0 100644
--- a/apps/desktop/src/renderer/views/thread/chat-items.ts
+++ b/apps/desktop/src/renderer/views/thread/chat-items.ts
@@ -65,6 +65,10 @@ const weekday = new Intl.DateTimeFormat(undefined, { weekday: 'long' })
const sameDay = (a: Date, b: Date) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()
+/** A call's length after its title or time: " · 00:16"; empty while it has none. */
+export const callLength = (seconds?: number) =>
+ seconds === undefined ? '' : ` · ${String(Math.floor(seconds / 60)).padStart(2, '0')}:${String(seconds % 60).padStart(2, '0')}`
+
export const relativeTime = {
time: (ms: number) => time.format(new Date(ms)),
/** Chat separator: Today 3:27 AM · Yesterday 5:20 PM · Sep 16 9:02 AM */
diff --git a/apps/ios/Kit/Sources/CodyncKit/Design/CharacterAvatar.swift b/apps/ios/Kit/Sources/CodyncKit/Design/CharacterAvatar.swift
index 24a65db0..d6b01c16 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Design/CharacterAvatar.swift
+++ b/apps/ios/Kit/Sources/CodyncKit/Design/CharacterAvatar.swift
@@ -321,6 +321,29 @@ public struct GroupAvatar: View {
}
}
+/// A bot's character, or a group's `members` (Android `BotAvatar`).
+public struct BotAvatar: View {
+ let bot: Bot
+ let members: [Bot]
+ let size: CGFloat
+ let animated: Bool
+
+ public init(bot: Bot, members: [Bot] = [], size: CGFloat = 44, animated: Bool = true) {
+ self.bot = bot
+ self.members = members
+ self.size = size
+ self.animated = animated
+ }
+
+ public var body: some View {
+ if bot.isGroup && bot.customIcon == nil {
+ GroupAvatar(members: members, size: size, animated: animated)
+ } else {
+ CharacterAvatar(bot: bot, size: size, animated: animated)
+ }
+ }
+}
+
/// Avatar with the roster status dot: lime = unread, orange = needs you.
/// A group shows its `members`.
public struct AvatarWithStatus: View {
@@ -335,9 +358,7 @@ public struct AvatarWithStatus: View {
}
public var body: some View {
- Group {
- if bot.isGroup && bot.customIcon == nil { GroupAvatar(members: members, size: size) } else { CharacterAvatar(bot: bot, size: size) }
- }
+ BotAvatar(bot: bot, members: members, size: size)
.overlay(alignment: bot.lead ? .topTrailing : .bottomTrailing) {
if bot.needsInput {
Image(systemName: "exclamationmark")
diff --git a/apps/ios/Kit/Sources/CodyncUI/Call/CallRows.swift b/apps/ios/Kit/Sources/CodyncUI/Call/CallRows.swift
index 50afa526..2f92cd0e 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Call/CallRows.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Call/CallRows.swift
@@ -8,7 +8,7 @@ struct CallLineRow: View {
var body: some View {
let title = L10n.tr(entry.data.text ?? "Voice chat")
- let length = entry.data.callSeconds.map { String(format: " · %02d:%02d", $0 / 60, $0 % 60) } ?? ""
+ let length = callLength(entry.data.callSeconds)
Button(action: open) {
HStack(spacing: 6) {
Image(systemName: "waveform").foregroundStyle(Palette.secondary)
@@ -43,23 +43,30 @@ struct CallConversationView: View {
VStack(spacing: 0) {
ModalHeader(entry.data.text ?? "Voice chat")
ScrollView {
- LazyVStack(alignment: .leading, spacing: 10) {
- if let error {
- Text(L10n.tr(error)).font(.footnote).foregroundStyle(Palette.danger)
- .frame(maxWidth: .infinity).padding(.top, 24)
- } else if fetched == nil, line.data.call != nil {
- Spinner(size: 14).frame(maxWidth: .infinity).padding(.top, 24)
- .accessibilityLabel(L10n.tr("Loading the call"))
- } else if messages.isEmpty {
- Text(L10n.tr("Nothing was said on this call.")).font(.footnote).foregroundStyle(Palette.tertiary)
- .frame(maxWidth: .infinity).padding(.top, 24)
+ LazyVStack(alignment: .leading, spacing: 0) {
+ CallHeader(line: entry)
+ Group {
+ if let error {
+ Text(L10n.tr(error)).font(.footnote).foregroundStyle(Palette.danger)
+ } else if fetched == nil, line.data.call != nil {
+ Spinner(size: 14).accessibilityLabel(L10n.tr("Loading the call"))
+ } else if messages.isEmpty {
+ Text(L10n.tr("Nothing was said on this call.")).font(.footnote).foregroundStyle(Palette.tertiary)
+ }
+ }
+ .frame(maxWidth: .infinity)
+ .padding(.bottom, 16)
+ ForEach(Array(messages.enumerated()), id: \.offset) { i, message in
+ row(message).padding(.top, i == 0 ? 0 : message.gap(after: messages[i - 1]))
}
- ForEach(Array(messages.enumerated()), id: \.offset) { _, message in row(message) }
}
.padding(.horizontal, 16)
- .padding(.bottom, 12)
+ .padding(.bottom, 16)
}
- .defaultScrollAnchor(.bottom)
+ // A short call reads from the top; a long one opens at its end.
+ .defaultScrollAnchor(.top, for: .alignment)
+ .defaultScrollAnchor(.bottom, for: .initialOffset)
+ .defaultScrollAnchor(.bottom, for: .sizeChanges)
}
.background(Palette.background)
.task(id: line.id) {
@@ -77,13 +84,14 @@ struct CallConversationView: View {
switch message.speaker {
case .user:
Text(message.text)
- .padding(.horizontal, 14).padding(.vertical, 9)
+ .foregroundStyle(Palette.text)
+ .padding(.horizontal, 16).padding(.vertical, 10)
.background(Palette.bubbleUser, in: RoundedRectangle(cornerRadius: 18, style: .continuous))
.frame(maxWidth: .infinity, alignment: .trailing)
- .padding(.leading, 40)
+ .padding(.leading, 56)
case .voice:
Text(message.text)
- .foregroundStyle(Palette.secondary)
+ .foregroundStyle(Palette.text)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.trailing, 40)
case .voiceToBot:
@@ -101,3 +109,39 @@ struct CallConversationView: View {
}
}
}
+
+/// Who the call was with, when it ended and how long it lasted, above what was said.
+private struct CallHeader: View {
+ let line: Entry
+ @Environment(BotStore.self) private var model
+
+ var body: some View {
+ VStack(spacing: 4) {
+ if let bot = model.bots[line.botId] {
+ BotAvatar(bot: bot, members: model.members(of: bot), size: 52, animated: false)
+ .padding(.bottom, 8)
+ Text(bot.name).font(.headline).foregroundStyle(Palette.text)
+ }
+ Text(RelativeTime.separator(Date(milliseconds: line.createdAt)) + callLength(line.data.callSeconds))
+ .font(.footnote)
+ .monospacedDigit()
+ .foregroundStyle(Palette.tertiary)
+ }
+ .frame(maxWidth: .infinity)
+ .padding(.top, 12)
+ .padding(.bottom, 28)
+ .accessibilityElement(children: .combine)
+ }
+}
+
+private extension CallMessage {
+ /// The space above this message: wide where you start a new exchange, close within one.
+ func gap(after previous: CallMessage) -> CGFloat {
+ speaker == .user && previous.speaker != .user ? 24 : 8
+ }
+}
+
+/// A call's length after its title or time: " · 00:16"; empty while it has none.
+func callLength(_ seconds: Int?) -> String {
+ seconds.map { String(format: " · %02d:%02d", $0 / 60, $0 % 60) } ?? ""
+}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift b/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift
index 1617d218..feb019d4 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift
@@ -33,7 +33,6 @@ struct CallView: View {
private var bot: Bot? { model.bots[botId] }
private var call: String { callID.uuidString }
- private var color: Color { bot.map { AvatarPalette.color($0.avatarColor) } ?? Palette.accent }
var body: some View {
VStack(spacing: 6) {
@@ -185,7 +184,7 @@ struct CallView: View {
avatar
LevelDots(level: session?.level ?? 0, speaking: session?.phase == .speaking,
working: bot?.isWorking == true, connecting: session?.phase.isConnecting ?? true,
- color: color, reduceMotion: reduceMotion)
+ reduceMotion: reduceMotion)
.frame(minWidth: Self.dotsWidth, maxWidth: Self.dotsMaxWidth, minHeight: Self.dotsHeight, maxHeight: Self.dotsHeight)
.accessibilityLabel(statusText)
// Audio leaves the phone: say where.
diff --git a/apps/ios/Kit/Sources/CodyncUI/LevelDots.swift b/apps/ios/Kit/Sources/CodyncUI/LevelDots.swift
index ad9134af..a8d5950f 100644
--- a/apps/ios/Kit/Sources/CodyncUI/LevelDots.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/LevelDots.swift
@@ -2,14 +2,14 @@ import CodyncKit
import SwiftUI
/// A dotted line (the call bar, the composer's recording pill): it follows your voice while
-/// listening, ripples while the bot talks, breathes while it works, and rests as faint dots otherwise.
+/// listening, ripples while the bot talks, breathes while it works, and rests as a still row of dots
+/// otherwise. In the ink color, so a dark bot's line stays visible on the dark bar.
/// While a call connects it shows an indeterminate progress line instead, and fades back to the dots.
struct LevelDots: View {
let level: Float
let speaking: Bool
let working: Bool
var connecting = false
- let color: Color
let reduceMotion: Bool
var body: some View {
@@ -40,8 +40,7 @@ struct LevelDots: View {
}
let height = 4 + CGFloat(amount) * (size.height - 4)
let rect = CGRect(x: x - 1.25, y: (size.height - height) / 2, width: 2.5, height: height)
- let tint = speaking ? Palette.accent : color
- canvas.fill(Path(roundedRect: rect, cornerRadius: 1.25), with: .color(tint.opacity(0.5 + 0.5 * amount)))
+ canvas.fill(Path(roundedRect: rect, cornerRadius: 1.25), with: .color(Palette.accent.opacity(0.5 + 0.5 * amount)))
}
}
}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/ChatRows.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/ChatRows.swift
index 7b2b4e9d..8e0215af 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Thread/ChatRows.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/ChatRows.swift
@@ -232,7 +232,7 @@ struct NoticeRow: View {
let text = entry.data.text ?? ""
// A call an older app logged, with no conversation to open.
if let seconds = entry.data.callSeconds {
- Label("\(L10n.tr(text)) · \(String(format: "%02d:%02d", seconds / 60, seconds % 60))", systemImage: "waveform")
+ Label(L10n.tr(text) + callLength(seconds), systemImage: "waveform")
.font(.footnote.monospacedDigit())
.foregroundStyle(Palette.secondary)
.frame(maxWidth: .infinity)
diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/RecordingPill.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/RecordingPill.swift
index 1ca35657..6de6a1ee 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Thread/RecordingPill.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/RecordingPill.swift
@@ -31,7 +31,7 @@ struct RecordingPill: View {
Text(timerInterval: dictation.startedAt...Date.distantFuture, countsDown: false)
.font(.subheadline.monospacedDigit())
.foregroundStyle(Palette.text)
- LevelDots(level: dictation.level, speaking: false, working: false, color: Palette.text, reduceMotion: reduceMotion)
+ LevelDots(level: dictation.level, speaking: false, working: false, reduceMotion: reduceMotion)
.frame(width: 32, height: 12)
.accessibilityLabel("Listening")
}
diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.md
index 77491f4a..ce9170ae 100644
--- a/apps/ios/WhatsNew.md
+++ b/apps/ios/WhatsNew.md
@@ -9,6 +9,8 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o
## 2.38.1
### zh-Hant
- 修正語音通話中,bot 唸完回覆、要再聽你說話時 app 可能閃退的問題。
+- 語音通話的對話紀錄更好讀:最上方顯示是跟哪個 bot、什麼時候、通話多久,語音說的話也更清楚。
+- 通話列在 bot 沒說話時會顯示一排靜止的點,深色頭像的 bot 也看得到。
- 語音辨識出問題時,語音通話和聽寫會告訴你,不再一直停在聆聽或默默結束。
- 介面新增巴西葡萄牙文:可在設定選擇「Português (Brasil)」,或跟隨系統的葡萄牙文語言。
- 新增俄文介面:在設定選擇「Русский」,或跟隨系統的俄文語言。
@@ -16,6 +18,8 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o
### en-US
- Fixed a crash in voice calls when the bot finished reading a reply and started listening again.
+- A call's conversation is easier to read: the bot, when the call ended and how long it lasted sit at the top, and the voice's words are clearer.
+- The call bar shows a still row of dots while the bot isn't talking, for dark bots too.
- When speech recognition stops working, voice calls and dictation tell you, instead of listening forever or ending without a word.
- Choose Português (Brasil) in Settings, or follow your Portuguese system language.
- Choose Русский in Settings, or follow your Russian system language.
diff --git a/apps/maestro/call-conversation.js b/apps/maestro/call-conversation.js
new file mode 100644
index 00000000..2f4ecc1b
--- /dev/null
+++ b/apps/maestro/call-conversation.js
@@ -0,0 +1,40 @@
+// Makes the bot and the three ended calls `call-conversation.yaml` opens, on the host the phone is paired with
+// (HOST_PORT and HOST_TOKEN, passed with `-e`), or (`CLEANUP`, when the flow completes) deletes that bot again.
+const api = (method, body) => {
+ const res = http.post(`http://127.0.0.1:${HOST_PORT}/api/${method}`, {
+ headers: { Authorization: `Bearer ${HOST_TOKEN}`, 'Content-Type': 'application/json' },
+ body: JSON.stringify(body),
+ })
+ if (res.status !== 200) throw new Error(`${method}: ${res.status} ${res.body}`)
+ return json(res.body)
+}
+const id = () => `maestro-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`
+
+/** A call the host has ended, with what was said on it, as its line in the chat. */
+function endedCall(botId, seconds, said) {
+ const callId = id()
+ api('startCall', { botId, callId, mode: 'device' })
+ const at = Date.now()
+ api('endCall', { botId, callId, seconds, lines: said.map(([from, text], i) => ({ from, text, at: at + i * 1000 })) })
+}
+
+if (typeof CLEANUP !== 'undefined') {
+ if (output.bot) api('deleteBot', { botId: output.bot.id })
+} else {
+ const name = `Call check ${Math.random().toString(36).slice(2, 6)}`
+ const bot = api('createBot', {
+ name, avatarColor: 'black', avatarShape: 'blob', backend: 'claude', cwd: '/tmp', connectors: [], skills: [],
+ }).bot
+ endedCall(bot.id, 3, [])
+ endedCall(bot.id, 16, [
+ ['user', 'Can you check the build?'],
+ ['voice', 'Sure, it passed a minute ago.'],
+ ['voice', 'Two tests were skipped.'],
+ ['user', 'Thanks, that is all.'],
+ ['voice', 'You are welcome.'],
+ ])
+ const long = []
+ for (let i = 1; i <= 20; i++) long.push(['user', `Question ${i} about the release?`], ['voice', `Answer ${i}: it goes out once the review is green.`])
+ endedCall(bot.id, 185, long)
+ output.bot = { name, id: bot.id }
+}
diff --git a/apps/maestro/call-conversation.yaml b/apps/maestro/call-conversation.yaml
new file mode 100644
index 00000000..a72ba181
--- /dev/null
+++ b/apps/maestro/call-conversation.yaml
@@ -0,0 +1,46 @@
+# A voice call's line opens its conversation: who it was with and when on top, then what was said; a long call
+# opens at its end, and a call where nothing was said says so. The phone must already be signed in and paired with
+# the host (a worktree's sandbox, docs/guides/dev-app.md#worktree-sandboxes), so run it apart from `welcome`, whose
+# clearState undoes that; the flow makes its own bot and calls there:
+# maestro --device "<simulator udid>,<adb serial>" test --shard-all 2 --include-tags call \
+# -e HOST_PORT=<sandbox port> -e HOST_TOKEN="$(cat ~/.codync-dev-<sandbox name>/token)" apps/maestro
+appId: com.pokai.Codync.ios.dev
+tags:
+ - call
+onFlowComplete:
+ - runScript:
+ file: call-conversation.js
+ env:
+ CLEANUP: "true"
+---
+- runScript: call-conversation.js
+- runFlow:
+ when:
+ platform: iOS
+ commands:
+ - launchApp:
+ appId: com.pokai.Codync.ios.dev
+- runFlow:
+ when:
+ platform: Android
+ commands:
+ - launchApp:
+ appId: com.pokai.Codync.android.dev
+- tapOn: ${output.bot.name}
+# A short call: the header (the bot, the time and the length), then everything said, read from the top.
+- tapOn: ".*· 00:16"
+- assertVisible: "Today.*· 00:16"
+- assertVisible: "Can you check the build\\?"
+- assertVisible: "You are welcome\\."
+- takeScreenshot: call-short
+- tapOn: "Close"
+# A long call opens at its end.
+- tapOn: ".*· 03:05"
+- assertVisible: "Answer 20: it goes out once the review is green\\."
+- assertNotVisible: "Today.*· 03:05"
+- takeScreenshot: call-long
+- tapOn: "Close"
+- tapOn: ".*· 00:03"
+- assertVisible: "Today.*· 00:03"
+- assertVisible: "Nothing was said on this call\\."
+- tapOn: "Close"
diff --git a/docs/features/voice-call.md b/docs/features/voice-call.md
index 4a150579..aecf0501 100644
--- a/docs/features/voice-call.md
+++ b/docs/features/voice-call.md
@@ -17,7 +17,8 @@ way open with a sentence or two, read aloud like any reply and part of the call
- UI follows Grok Bot: a floating capsule over the top of the chat (`ThreadView` overlay), and the
chat stays readable and usable underneath. Left to right: the bot's avatar (pulses while
speaking; tap it to interrupt), a dotted level line (your voice while listening, a ripple while
- the bot speaks, a slow breath while it works; while the engine connects, an indeterminate progress
+ the bot speaks, a slow breath while it works, a still row otherwise, always in the text color so a dark bot's line
+ doesn't vanish on the dark bar; while the engine connects, an indeterminate progress
line instead: a short segment gliding back and forth along a faint track, easing at both ends
(white in dark mode, black in light), still at the left under Reduce Motion, fading back to the dots
once the call is really connected), gear (call settings), mic (mute), red ✕ (end). Connected means
@@ -307,8 +308,10 @@ carries audio and talks to these methods:
across a reconnect; an ended call can't start again. The call's actors (a group's members) hear `CallEnded`. A one-shot of the bot's harness (`chat::oneshot`) titles it from the conversation, in the user's
language, into the notice's `text` ("Voice chat" until then, or when there's nothing to sum up); older apps
show the title too. The line shows a waveform, the title and the length; tapping it opens the conversation
- (iPhone and Android sheets, the desktop `Sheet`, `o` in the terminal): the user's lines, the voice's lines, what
- it relayed and the bot's messages, in order. The chat an app holds may not reach back to an older call (the
+ (iPhone and Android sheets, the desktop `Sheet`, `o` in the terminal): under a header with the bot's avatar and name,
+ the line's time and the call's length (not in the terminal), the user's lines, the voice's lines, what it relayed and
+ the bot's messages, in order; a short call reads from the top, a long one opens at its end, and each time you speak
+ after the other side starts an exchange with more room above it. The chat an app holds may not reach back to an older call (the
desktop mirror keeps the newest 200 entries), so opening the conversation fetches the call's own messages,
`callEntries {botId, callId}` → the newest 500, and merges them with the loaded chat, each entry once; it shows
a spinner until they arrive and the error if they can't. `logCall` stays for older apps.
diff --git a/web/content/docs/voice.mdx b/web/content/docs/voice.mdx
index 67c69a8c..a09b4abd 100644
--- a/web/content/docs/voice.mdx
+++ b/web/content/docs/voice.mdx
@@ -14,13 +14,13 @@ When the message box is empty and the bot isn't working, the send button becomes
The call bar floats at the top of the chat, and the chat stays readable and usable underneath. From left to right:
- the bot's avatar: it pulses while the bot speaks, and tapping it then interrupts the reply
-- a line of dots that follows your voice while you speak, ripples while the bot speaks, and breathes slowly while it works; while the call connects, a line gliding back and forth takes its place until the voice can really hear you
+- a line of dots that follows your voice while you speak, ripples while the bot speaks, breathes slowly while it works, and rests as a still row otherwise; while the call connects, a line gliding back and forth takes its place until the voice can really hear you
- the provider's name, whenever audio leaves your device (see "What goes where" below)
- **Call settings** (the gear), **Mute**, and **End call** (the red ✕)
Most bots wait for you to speak. Your [lead bot](/docs/bots#your-lead-bot) speaks first: once the call connects, it tells you in a sentence or two what deserves your attention, or greets you. If it's busy working, its reply comes when the work is done instead.
-What you say on a call, and the bot's replies during it, don't fill up the chat. When the call ends, the chat gets one line instead: a waveform, a short title for what the call was about (such as "Release plan · 03:12"; "Voice chat" until the title is written), and its length. Tap it to read the whole call: what you said, what the voice said, and what went to the bot and back. Your other devices keep the call out of the chat too. If the app closes before the call ends (or loses its connection), the line appears once the call has been quiet for 2 hours.
+What you say on a call, and the bot's replies during it, don't fill up the chat. When the call ends, the chat gets one line instead: a waveform, a short title for what the call was about (such as "Release plan · 03:12"; "Voice chat" until the title is written), and its length. Tap it to read the whole call: the bot, when the call ended and how long it lasted at the top, then what you said, what the voice said, and what went to the bot and back. Your other devices keep the call out of the chat too. If the app closes before the call ends (or loses its connection), the line appears once the call has been quiet for 2 hours.
The bot remembers what matters from the call like from any conversation: its memory picks up what you said, not the voice's wording.