diff --git a/apps/android/src/screens/bot/view-card.tsx b/apps/android/src/screens/bot/view-card.tsx
new file mode 100644
index 0000000..68ba2a6
--- /dev/null
+++ b/apps/android/src/screens/bot/view-card.tsx
@@ -0,0 +1,147 @@
+import { useMemo, useRef, useState } from 'react'
+import { PanResponder, ScrollView, Text, TextInput, View } from 'react-native'
+import { Toggle } from '../../ui/toggle'
+import { Minus, Plus } from 'lucide-react-native'
+import { strings as s } from '../../locales/i18n'
+import { object, objects, text, type BotObject } from '../../services/bot-catalog'
+import { checkedBotView } from '../../services/bot-view'
+import { Button, IconButton } from '../../ui/components'
+import { NativeMarkdown } from '../../ui/markdown'
+import { useTheme } from '../../ui/theme-context'
+import { useThemedStyles } from '../../ui/use-themed-styles'
+import { asText, choiceValue, inputDefault, resolve, validateViewAnswer, viewInputs, viewScope, type Scope } from '../../vendor/ds-bot/views.js'
+import { BotChoice } from './controls'
+import { createBotStyles } from './styles'
+import { BotChart } from './view-chart'
+
+type Reply = (action: string, values: BotObject) => void
+
+/** Native components and a bounded expression interpreter; HTML never executes. */
+export function BotViewCard({ pending, busy, reply }: { pending: BotObject; busy: boolean; reply: Reply }) {
+ const styles = useThemedStyles(createBotStyles)
+ const blueprint = useMemo(() => checkedBotView(pending), [pending.view, pending.title])
+ return
+ {!!text(pending.title) && {text(pending.title)}}
+ {blueprint ? : {s.bots.unknownCard}}
+
+}
+function ViewContent({ view, busy, reply }: { view: BotObject; busy: boolean; reply: Reply }) {
+ const styles = useThemedStyles(createBotStyles)
+ const [inputs, setInputs] = useState({})
+ const [error, setError] = useState(false)
+ const scope = viewScope(view, inputs)
+ const answer: Reply = (action, own) => {
+ if (busy) return
+ const values = viewInputs(view).length ? { ...own, inputs } : own
+ if (validateViewAnswer(view, action, values).error) { setError(true); return }
+ setError(false)
+ reply(action, values)
+ }
+ return
+ { setInputs(current => ({ ...current, [id]: value })); setError(false) }} />
+ {error && {s.bots.invalidViewAnswer}}
+
+}
+type NodeProps = { node: BotObject; busy: boolean; reply: Reply; scope: Scope; inputs: BotObject; change: (id: string, value: unknown) => void }
+function ViewNode(props: NodeProps) {
+ const { node, busy, reply, scope, inputs, change } = props
+ const styles = useThemedStyles(createBotStyles)
+ const { colors } = useTheme()
+ const [selected, setSelected] = useState([])
+ const [fields, setFields] = useState>({})
+ const id = text(node.id)
+ const value = (item: unknown) => resolve(item, scope, '')
+ const display = (item: unknown) => asText(value(item))
+ const input = Object.hasOwn(inputs, id) ? inputs[id] : inputDefault(node)
+ const resolvedTone = value(node.tone)
+ const tone = resolvedTone === 'bad' ? colors.danger : resolvedTone === 'warn' ? colors.warning : resolvedTone === 'good' ? colors.success : resolvedTone === 'muted' ? colors.muted : colors.ink
+ switch (node.type) {
+ // Rows wrap on narrow screens instead of compressing labels and controls.
+ case 'stack': case 'row': return {objects(node.children).map((child, index) => )}
+ case 'text': case 'callout': return {display(node.text)}
+ case 'metric': return {text(node.label)}{display(node.value)}{!!node.caption && {display(node.caption)}}
+ case 'progress': {
+ const percent = node.percent !== undefined ? Number(value(node.percent)) : Number(value(node.max)) > 0 ? Number(value(node.value)) / Number(value(node.max)) * 100 : 0
+ const bounded = Number.isFinite(percent) ? Math.max(0, Math.min(100, percent)) : 0
+ return {text(node.label)} · {Math.round(bounded)}%{node.valueLabel ? ` · ${display(node.valueLabel)}` : ''}
+ }
+ case 'table': return
+ {objects(node.columns).map((column, i) => {text(column.label) || text(column.key)})}
+ {(node.rows as unknown[][]).map((row, i) => {row.map((cell, j) => {display(cell)})})}
+
+ case 'chart': return
+ case 'sources': return {objects(node.items).map((item, i) => {text(item.label)}`} />)}
+ case 'html': return {!!text(node.summary) && {text(node.summary)}}{s.bots.htmlFallback}
+ case 'slider': case 'number': return change(id, value)} />
+ case 'toggle': return {text(node.label)} change(id, value)} trackColor={{ true: colors.primary }} />
+ case 'choice': return {text(node.label)}{objects(node.options).map((option, i) => change(id, choiceValue(option))} />)}
+ case 'options': return
+ {objects(node.options).map((option, i) => {
+ const label = text(option.label)
+ return setSelected(current => node.multi === true ? current.includes(label) ? current.filter(item => item !== label) : [...current, label] : [label])} />
+ })}
+
+
+ case 'confirm': return
+
+ case 'form': return
+ {objects(node.fields).map((field, i) =>
+ {text(field.label)} setFields(current => ({ ...current, [text(field.id)]: value }))} />
+ )}
+ reply(id, { fields })} />
+
+ case 'submit': return reply(id, {})} />
+ default: return {s.bots.unknownCard}
+ }
+}
+function NumberInput({ node, value, change }: { node: BotObject; value: unknown; change: (value: number) => void }) {
+ const styles = useThemedStyles(createBotStyles)
+ const { colors } = useTheme()
+ const [draft, setDraft] = useState(String(value ?? ''))
+ const min = typeof node.min === 'number' ? node.min : undefined
+ const max = typeof node.max === 'number' ? node.max : undefined
+ const step = typeof node.step === 'number' ? node.step : 1
+ const number = Number(value)
+ const valid = Number.isFinite(number) && (min === undefined || number >= min) && (max === undefined || number <= max)
+ const update = (next: number) => { setDraft(String(next)); change(next) }
+ const increment = (direction: number) => update(Math.max(min ?? -Infinity, Math.min(max ?? Infinity, Number(((Number.isFinite(number) ? number : min ?? 0) + direction * step).toPrecision(12)))))
+ const label = text(node.label)
+ return
+ {label}{node.unit ? ` (${text(node.unit)})` : ''}
+ increment(-1)} />
+ { setDraft(text); change(text.trim() ? Number(text) : NaN) }} />
+ = max} onPress={() => increment(1)} />
+
+ {node.type === 'slider' && min !== undefined && max !== undefined && max > min && }
+ {(min !== undefined || max !== undefined) && {min ?? '−∞'} – {max ?? '∞'}}
+ {!valid && {s.bots.invalidNumber}}
+
+}
+function LocalSlider({ label, min, max, step, value, change }: { label: string; min: number; max: number; step: number; value: number; change: (value: number) => void }) {
+ const { colors } = useTheme()
+ const width = useRef(1)
+ const start = useRef(0)
+ const latest = useRef({ min, max, step, change })
+ latest.current = { min, max, step, change }
+ const fromX = (x: number) => {
+ const { min, max, step, change } = latest.current
+ const ratio = Math.max(0, Math.min(1, x / width.current))
+ change(Math.max(min, Math.min(max, Number((min + Math.round(ratio * (max - min) / step) * step).toPrecision(12)))))
+ }
+ const responder = useMemo(() => PanResponder.create({
+ onStartShouldSetPanResponder: () => true,
+ onMoveShouldSetPanResponder: () => true,
+ onPanResponderGrant: event => { start.current = event.nativeEvent.locationX; fromX(start.current) },
+ onPanResponderMove: (_event, gesture) => fromX(start.current + gesture.dx),
+ }), [])
+ const ratio = Math.max(0, Math.min(1, (value - min) / (max - min)))
+ return { width.current = Math.max(1, event.nativeEvent.layout.width) }}
+ accessible accessibilityRole="adjustable" accessibilityLabel={label} accessibilityValue={{ min, max, now: Math.max(min, Math.min(max, value)) }}
+ accessibilityActions={[{ name: 'increment' }, { name: 'decrement' }]} onAccessibilityAction={event => change(Math.max(min, Math.min(max, value + (event.nativeEvent.actionName === 'increment' ? step : -step))))}
+ style={{ height: 48, justifyContent: 'center', paddingHorizontal: 0 }}>
+
+
+
+}