diff --git a/app/androidApp/src/main/kotlin/com/example/aiapp/Markdown.kt b/app/androidApp/src/main/kotlin/com/example/aiapp/Markdown.kt index 7a2448e..0ec3305 100644 --- a/app/androidApp/src/main/kotlin/com/example/aiapp/Markdown.kt +++ b/app/androidApp/src/main/kotlin/com/example/aiapp/Markdown.kt @@ -59,21 +59,28 @@ fun MarkdownText(text: String, modifier: Modifier = Modifier) { bullet = body, list = body, table = body, - // Code in a monospace face: a code block set in the body font stops looking like - // code at all. The colour rides on the style here rather than in `markdownColor`, - // which stopped carrying `codeText`/`inlineCodeText`/`linkText` when the renderer - // moved them onto the typography. + // Code in a monospace face, in the ordinary text colour. The face and the tinted + // background are what say "this is code"; colour is not, and it used to be green + // -- the palette's colour for a *literal*. A block of code is not a literal, it + // is text that happens to be code, and painting all of it green said the whole + // block was one. Where a literal really does appear inside code, the thing that + // should colour it is a syntax highlighter looking at the code, which is exactly + // what a tool call's input already gets from `catppuccinSyntax`. + // + // The colour rides on the style here rather than in `markdownColor`, which + // stopped carrying `codeText`/`inlineCodeText`/`linkText` when the renderer moved + // them onto the typography. code = MaterialTheme.typography.bodyMedium.copy( fontFamily = FontFamily.Monospace, - color = codeColor, + color = MaterialTheme.colorScheme.onSurface, ), inlineCode = body.copy( fontFamily = FontFamily.Monospace, // Unspecified so an inline span keeps the size of the line it sits in. fontSize = TextUnit.Unspecified, - color = codeColor, + color = MaterialTheme.colorScheme.onSurface, ), textLink = TextLinkStyles( diff --git a/app/androidApp/src/main/kotlin/com/example/aiapp/Theme.kt b/app/androidApp/src/main/kotlin/com/example/aiapp/Theme.kt index 4de895d..43847e3 100644 --- a/app/androidApp/src/main/kotlin/com/example/aiapp/Theme.kt +++ b/app/androidApp/src/main/kotlin/com/example/aiapp/Theme.kt @@ -169,15 +169,6 @@ private const val WARNING_PERCENT = 75.0 /** Close enough that the next turn may be the one that is refused. */ private const val OVER_LIMIT_PERCENT = 90.0 -/** - * Code: a fenced block, an inline span, a tool's input. - * - * Green because on this palette it is what a literal is coloured as, and because code sits on - * Surface 0 where the ordinary text colour would say nothing about it being code. - */ -val codeColor: Color - @Composable get() = Mocha.Green - /** * Catppuccin Mocha as a syntax theme, for the highlighter used on a tool call's input. * diff --git a/app/run-android.sh b/app/run-android.sh index 3bc9693..0da7949 100755 --- a/app/run-android.sh +++ b/app/run-android.sh @@ -9,15 +9,22 @@ set -eu APP_ID="com.example.aiapp" -# The AVD shared by this machine's Android projects -- one emulator, not -# one per repo. Override with AVD_NAME=... elsewhere. -AVD_NAME="${AVD_NAME:-tdep}" DEVICE_PROFILE="${DEVICE_PROFILE:-pixel_10}" SYSTEM_IMAGE="${SYSTEM_IMAGE:-system-images;android-36;google_apis;x86_64}" SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) cd "$SCRIPT_DIR" +# One AVD per checkout, named after it -- so two clones of this repo, or a +# clone and a worktree, each get their own rather than fighting over one. +# This used to default to a machine-wide "tdep", which made the emulator the +# one thing here that could not be worked on in parallel: taking it meant +# asking whoever had it, waiting, and handing it back, and installing onto a +# running one steals the foreground from whatever they were looking at. +# Derived rather than written down, so neither clone names the other's. +# Override with AVD_NAME=... to share one deliberately. +AVD_NAME="${AVD_NAME:-$(basename "$(dirname "$SCRIPT_DIR")")}" + # shellcheck source=./android-env.sh . ./android-env.sh