docs/native-chat-presentation.md
Native chat presentation
This revision supersedes the early literal-Markdown-only presentation and the visual review's optional “keep markers” recommendation. The goal is a readable agent conversation on a phone, not a terminal transcript embedded in Android. Wire data, transport, image intake and remote action semantics are unchanged.
Rendering and safety
- CommonMark Java 0.24.0, with its GFM tables and strikethrough extensions, supplies the JVM AST. Java library desugaring preserves minSDK 26. Parsing and immutable span/block projection happen on the existing formatting worker, only when row text changes. Native TextViews/layouts are built on main.
- Assistant, user and thinking prose supports ATX/setext headings, paragraphs, emphasis/strong/strike, inline code, fenced/indented code, quotes, ordered and unordered nested lists, thematic rules, explicit links and GFM pipe tables. Soft breaks remain readable line breaks. There is no syntax highlighting, task-checkbox interactivity, footnote or math extension. Consecutive flowing paragraphs, headings, list items and quotes share one selectable native spanned TextView, rather than one widget per Markdown block. Heading sizes, inline styles, hanging list gutters, nesting and quote treatment remain rendered formatting. List markers are presentation gutters, not copied body characters. Code/table-first and adjacent numbered items retain their separate native gutters outside selectable content and horizontal scrolling.
- Tables use a native TableLayout in its own HorizontalScrollView. Columns are
not shrunk to fit the phone: cells wrap within content-sized 64–240dp columns; headers,
alignments and inline spans remain cells. The hint explains horizontal motion.
GFM requires literal pipes inside cells (including inline code) to be escaped
as
\|; unescaped pipes delimit cells. Malformed/unfinished tables remain text until the parser recognizes them. Fenced code and tool text use their own horizontal scrolling, without widening the transcript/page. - Literal HTML is displayed as inert text, including script/img/a tags. Markdown images become alt-text placeholders marked “not loaded”. Nothing fetches a Markdown resource. This does not alter first-class image input/attachment paths.
- Only absolute HTTP(S) links with a host, no userinfo or whitespace/control characters become clickable. Relative, content/file/intent/javascript/mailto and malformed links remain non-clickable text with their destinations visible. A click shows the complete destination and requires Open browser confirmation; only an ACTION_VIEW + CATEGORY_BROWSABLE web URI is dispatched, without arbitrary intent parsing, components or extras. Rendering itself performs no network IO.
- Presentation budgets: 200,000 UTF-16 source units, 12,000 AST nodes, depth 32, 512 projected Markdown blocks and 512 table cells per prose row. Exceeding any budget uses a whole-row selectable literal presentation, not truncation or a second parser. Before calling CommonMark, an allocation-free linear source preflight bounds potential padded-table expansion: within each physical nonblank run, maximum possible separator width times all lines bounds the cells, summed across runs. It includes short/lazy body rows, CR/LF/CRLF and list/quote container prefixes. It deliberately counts separator/prose lines too and can reject table-looking literal/code text. This conservative admission may fall back below 512 actual cells; it never truncates source. The previous post-parse-only cell guard was insufficient because CommonMark pads rows during AST construction. The input length guard also runs before parsing; AST node/depth/cell checks remain iterative defense in depth after parsing and before recursive span projection. These are UI resource limits, not a universal heap/performance guarantee or wire/schema changes. Device profiling is still needed.
Source, identity and reading
Copy source still copies the exact original row field, including hidden user mode prefixes, Markdown markers, original JSON arguments and whitespace. Details shows full model/provider metadata, canonical/live envelopes and exact source. It does not claim serialized JSON has original frame/key-order whitespace. Native text selection copies displayed text. Native selection handles can cross multiple bullets, paragraphs, headings and quotes within a flowing prose run directly in the formatted transcript; no separate selection screen or source-mode switch is needed. Independently scrolling code blocks, table cells and transcript rows remain separate native selection regions—this is not cross-view/global selection. Selection is not a private-key/import action and normal platform paste elsewhere is untouched. List gutters are non-selectable presentation, outside body text; Copy source still includes the original numbered/bulleted Markdown in full.
Prose links retain the native selectable movement method. Guarded short-tap link activation must not steal long presses, selection dragging or handle interactions; safe destinations still require the existing Open browser confirmation. The Read outline resolves a semantic heading block to its current text-layout offset, rather than assuming every heading owns a standalone view. Merged prose runs do not pretend to be one accessibility heading; the explicit Read outline remains available. Native heading-by-heading TalkBack traversal within merged prose is a separate accessibility limitation, not claimed as preserved by text spans alone.
Rows retain the original length-prefixed keys, unique stable IDs, 50ms non-sliding stream coalescing, stale-generation suppression and captured canonical actions. Known turns use canonical sequence order like the TUI boxes, regardless of body arrival or coverage-validation timing; unsequenced live turns retain stable arrival order until their sequence is known. Coverage still fences unloaded islands and controls action authority, independently of this ordering. A read/outline callback never invokes a turn action or RPC. An actual origin or selection-visit identity replacement clears view-local state; equal-but-distinct origin objects do not inherit another origin's disclosures.
- Transcript blocks share one width budget (available width minus 24dp, capped at 840dp), not narrow role-specific columns. User blocks sit 8dp right of center, assistant blocks 8dp left, and thinking/tools/results/notices are centered. These are box offsets only: ordinary text remains left-aligned and left-to-right; code/table scrolling and deliberate table-cell alignment remain local to their native content. Subtle outlines, accent rails and space between blocks distinguish every turn type. A matched tool exchange occupies one block at the result position, with input and result inside the same expanded surface. Only the exact occurrence-matched call card disappears; parallel operations remain separate exchanges. Call-only assistants do not leave empty cards behind.
- Assistant and user prose remain expanded. Coding work is first-class content,
not a secondary activity hidden to privilege assistant prose.
Assistant model/provider strings are not repeated in labels; they remain in
Details. Tools lead with bounded nonblank
friendly_callmetadata, then deterministic known operation summaries, then the faithful unknown tool name. They use whitespace-normalized literal headings; newlines/tabs become spaces and other control/format characters become visible�replacements without losing the rest of the label. Source metadata is unchanged. They use monospace literal input/output and an explicit Error prefix/error tint when appropriate, so truncating a long action cannot hide failure status. Canonical system turns are suppressed in normal chat, matching the TUI; inspect them explicitly through/tree→ turn → Canonical details. This is display-only: canonical history, tip identity and paging remain intact. Compaction markers, thinking, attachments and local notices have separate treatment. Attachment filenames appear once, sizes are human-readable, and raw metadata remains in Details. Canonicalkind="error"also receives error treatment without requiring or inventingother_meta.is_error; that metadata retains its original semantics. - Every tool starts as just one compact action heading wrapping to at most two end-ellipsized lines, with chevron and overflow. Its surface is at least 48dp high, with zero vertical body padding and the existing subtle inter-block gap. There are no visible Input/Result labels, options or body beneath it. Closed native body/input/options views are empty and GONE, rather than laying out huge hidden strings. The old 2/5-line ToolPreview implementation is removed. Heading tap or context-menu Expand reveals the complete available input, options and output, preserving indentation with local horizontal scrolling; Collapse hides and clears all native tool content again. This disclosure is unconditional for pending, merged, unmatched, short, empty and failed tools. The same heading disclosure opens both fields in a matched exchange. Input text selection never retargets canonical actions to the assistant: the result turn owns the whole block's actions. Pending calls and unmatched results remain visible as headings; expanded unmatched results explain missing arguments without inventing status. Disclosure is presentation only: explicit Copy arguments/Copy result choices and Details retain the exact original arguments/output. Details also keeps actual tool names, IDs, occurrence index and both relevant envelopes; serialized call/turn copies are labeled separately from exact string fields. Full remote Bash capture retrieval remains unsupported; expanding never reads capture paths.
- Known tool calls use deterministic operation summaries and decoded technical input rather than JSON escaping around commands, patches or file operations. Actual call options have a separate styled metadata view, never labels embedded in literal command/file content. String options remain explicitly quoted. Multi-field substitutions lead with Substitute but retain raw JSON rather than inventing ambiguous source/replacement delimiters inside a single text field. Unknown/malformed inputs remain inspectable without inventing semantics. Tool responses retain their available output and failures have explicit Error labels.
- Wrapping compaction/error output above 12 source lines or 1,200 characters starts at seven displayed lines. A small heading chevron indicates disclosure; the heading tap and box context menu provide Expand/Collapse, without dedicated Show command/output or Show more/less rows above or below the content. Expanding pins the same row's top offset, rather than following the new bottom. Manual state is keyed per row, isolated from thinking, recycled safely and restored with the existing RAM-only reading state across Activity recreation. No Bundle, preference, migration or disk disclosure persistence is introduced. When an expanded pending call becomes a merged exchange, its explicit choice carries to the result unless that result already has one. Current and saved call anchors follow the occurrence-matched exchange to its new position; offsets reset to the merged header rather than an unrelated numeric row or a stale deep coordinate. Canonical action ownership stays on the result. Collapsing a deeply scrolled row returns to its header rather than preserving an impossible deep offset. Copy/Details and canonical actions remain in the menu; native body text selection remains separate.
- Thinking follows the TUI lifecycle: streaming starts open; completed history starts closed; the streaming-to-complete edge closes once (including answer/tool arrival). A manual collapse survives thinking deltas; a manual reopen after completion survives later answer updates. Reading restoration retains the prior streaming state so completion while the Activity is absent also folds once. Collapsed thinking is a borderless, background-free single title line, using the first nonempty Markdown bold span when present (literal, ellipsized to fit). The invisible row retains a 48dp touch target and its context menu. Manual states survive temporary projection omissions within the same visit, not a new origin. The global thinking toggle does not change tool/compaction/error disclosures.
- Options → Read conversation lists user turns, assistant answers and their headings, skipping tool walls. Selection jumps locally to a stable row and, for headings, its native block. Near the end RecyclerView may clamp the target to keep the last content visible. Latest cancels pending heading navigation. Navigation and restoration keep the existing key/pixel reading anchor during further streaming updates. An outline open on a replaced visit cannot act.
- Latest is a compact bottom-end Material overlay shown only away from the end. A 12dp bottom reading margin replaces the original permanent 72dp clearance; Latest disappears when the last content is reached. A layout observer also updates it after jumps inside an oversized row. Transcript controls and Details use Material widgets, 48dp targets and labels; the overflow surface has an outline/elevation and separates read-only from canonical-action groups where supported by Android.
- The toolbar's info icon opens Session status, separate from the title's
Settings action. A thin, determinate context-used bar below the header shows
reported context tokens against the exact selected model's service-reported
effective
max_context; unknown or stale usage must not imply zero or full. The details show percent, used/limit and remaining tokens first, then state, all ordinary-task/workflow entries and formatted usage. Raw JSON remains an opt-in diagnostic disclosure. Read conversation remains available in Options rather than taking toolbar width. - The duplicate transcript State line and idle footer summary are removed. Meaningful running/queued/progress/error status retains one ellipsized summary and a full preview with one command plus up to five output lines, or up to three task titles and an overflow count. Its content-sized height grows and shrinks over 220 ms, down to no preview area for empty snapshots. New/replaced content fades in and removed lines fade out over 180 ms like arriving chat boxes. Tail-follow clamps inside layout before drawing; pending geometry does not briefly expose Latest before that clamp. Ticks do not restart fades, nor do rapid output updates hide a still-entering line repeatedly. A tap opens readable task/workflow details, not an inline expansion. While the IME is visible the meaningful compact row stays tappable and only the larger preview hides. Toolbar info remains available. See questions-status.md for keyboard/state rules and reporting limits. Transcript boundary dividers and padding separate it from chrome. Vertical fading edges are disabled: with unclipped padding they cut through visible lines above the actual edge. Horizontal scrollbars reserve their own inset strip rather than painting across code/tool text. Outline headings use a restrained hierarchy cue rather than literal Markdown heading markers.
Visual review dispositions
For the local android-ux-review/sonnet-ux-review.md review (2026-10-21):
| Finding | Disposition |
|---|---|
| 1 role structure | Distinct surfaces, shorter labels, error text/tint; full identity in Details. |
| 2 platform transcript buttons/dialog | Material controls and Details; compact Latest overlay. |
| 3 viewport/status | Duplicate State removed; one-line summary, full tap details, IME status hiding. Device viewport percentage not measured. |
| 4 tool/code alignment | Monospace, indentation-preserving local horizontal scroll. Optional diff syntax coloring not added. |
| 5 long output | Header-only tool collapse; seven-line long non-tool error/compaction disclosure; RAM-only restoration. Assistant prose stays expanded. |
| 6 action menus | Transcript popup surface and read-only/action grouping improved. Wholesale Options-sheet icon/risk reorganization deliberately deferred to keep this change focused; action/confirmation semantics untouched. |
| 7 Markdown | Superseded the conservative recommendation with native rich Markdown and real tables, retaining exact source actions. |
| 8 clipping boundaries | Dividers, small reading margins and non-full-width overlay; the padding-relative fade was removed after device testing. |
| 9 labels/attachment metadata | User-facing compaction label, single filename, readable sizes; exact bytes remain in Details. |
Validation boundaries
Regression tests exercise parsing and native widgets (including 360/412dp widths with Robolectric native graphics), escaped pipes/code/headers, source clipboard preservation, unsafe links and explicit web-link confirmation, inert HTML/images, all partial-stream prefixes, bounded fallback, row recycling/disclosure recreation, selection/origin isolation, thinking defaults, captured action generations, reading anchors, heading navigation during streaming, status details and IME insets.
These automated checks are JVM/Robolectric/build checks, not screenshots or phone acceptance. The implementation/review/correction workflow performed no app installation, live session/service, message send, credential/profile change, remote mutation or destructive development reset. Subsequent coordinator device checks are recorded separately below; they do not imply real-phone hardware, TalkBack, large-font or performance acceptance. No release compatibility path was added.
Initial feature validation record — 2026-10-21
Working tree based on port/tui-parity / 08e5c6c; no commit or live deployment.
The final correction pass ran all 22 ConversationRendererTest cases with zero
failures/errors/skips, including explicit Latest focus/anchor handling after the
outline closes and re-resolving headings after canonical replacement. Lint passed
with 0 errors / 67 warnings (supplied baseline: 0 / 69). Its only new API
suppression is documented at the inlined simple-break constant; no unavailable
platform method is called on minSDK 26.
Full gate command:
| 1 | scripts/build --offline :ez-agent-lib:test :app:testDebugUnitTest \ |
| 2 | :app:assembleDebug :app:lintDebug -Pandroid.builder.sdkDownload=false |
Initial local evidence paths: build/native-chat-gate.log,
app/build/test-results/testDebugUnitTest/,
ez-agent-lib/build/test-results/{test,androidJsonTest}/,
app/build/reports/lint-results-debug.html, and
app/build/outputs/apk/debug/app-debug.apk. Build outputs are ignored, not source
or committed artifacts. No prior side-build init script or host installation was
used; new Maven dependencies were resolved normally before the offline gate.
The full offline gate completed BUILD SUCCESSFUL in 1m40s. JUnit reports contain
896 test executions (770 app, 99 library, 27 Android-JSON library), all with
zero failures/errors/skips: 22 more than the supplied 874 baseline. Unchanged
library/lint tasks were reused by Gradle as up-to-date; app tests and final APK
assembly completed successfully. Lint remains 0 errors / 67 warnings and
git diff --check passes. No new lint baseline was introduced.
Initial debug APK SHA-256 (superseded by the bounded-correction build below):
b74eaa03549ba7456c96c27afb6cbfc07f9b2b75b26409d287bb5c3db0b8cfe6.
That initial APK was built only, not installed or launched. Phone/Waydroid visual and
accessibility acceptance remains unperformed, as detailed above.
Bounded independent-review corrections
All three independent findings were supported and corrected in the same uncommitted working tree, without another review loop:
| Finding | Disposition |
|---|---|
| P1 table allocation amplification | Addressed. Pre-parse source admission now precedes the dependency allocator. A parser-call test seam verifies that the review's 87,004-character / potential 20,001,000-cell source and a narrower short-row attack never call CommonMark. Coverage includes container/lazy-row candidates, all newline forms, aggregate runs, ordinary escaped-pipe tables and shell code. Literal fallback is intact. |
| P2 canonical error styling | Addressed. Canonical error kind is classified directly, independently of the unchanged tool error metadata. Row/widget regressions compare canonical errors without metadata against errored tool results, with exact source/Details/clipboard checks. |
| P2 code/table-first list markers | Addressed. Immutable blocks carry separate markers; native gutters remain outside selectable/horizontally scrolling content. Tests cover adjacent numbered fenced code and tables, indented/nested code, headers/cells, scrolling at 360/412dp and canonical source copying. |
Nothing in this correction changes canonical wire data, captured actions, image input, disclosure persistence, connection behavior or local navigation authority. The broader Options-sheet redesign remains carried out of scope, as above. There was no device OOM experiment; allocation protection is verified by the preflight/parser-call boundary and source accounting, not a claim of measured Android heap usage. Device visuals, TalkBack, selection gestures, large fonts and sustained streaming performance remain unverified.
The admission bound is based on the pinned 0.24.0 factory/parser behavior, checked from the cached dependency bytecode: separator columns must be at least the header width, body cells are padded to that header width, and physical blank lines end table continuation. Thus separator width times every line in a run overestimates actual padded cell allocation. No private dependency API is called by production code; this is conservative source accounting, not a fork or legacy parser.
Bounded-correction validation — 2026-10-21
The affected offline conversation run passed 56 tests: 18 parser, 24 renderer,
14 row-projection tests, with zero failures/errors/skips. Log:
build/native-chat-bounded-focused.log (BUILD SUCCESSFUL, 51s).
The same full offline gate command above then passed (BUILD SUCCESSFUL, 2m7s).
Log: build/native-chat-bounded-gate.log. Current JUnit results total 905 test
executions: 779 app + 99 library + 27 Android-JSON, all with zero failures,
errors or skips. This adds 9 regression tests to the independently reviewed
896-execution tree, or 31 above the original 874 baseline. Unchanged library tasks
were reused by Gradle as up-to-date. App tests, APK assembly and lint succeeded;
lint remains 0 errors / 67 warnings, and git diff --check passes.
Current debug APK: app/build/outputs/apk/debug/app-debug.apk.
SHA-256: bf740e20890cc08da82488803c4425ff47f848257b282d23375fd83d2a71208d.
This replaces the initial feature APK hash above. The APK was not installed or
launched. There were no commits, pushes, PRs, additional review sessions, runtime
credential/profile changes, live services or message actions.
Coordinator verification and Android fixture checks
After the bounded workflow, the coordinator independently inspected the changed parser, native block views, row formatter, renderer, tests and JUnit/lint reports. The workflow completed all planned operations; its three independent findings were corrected before the coordinator handoff. No approval verdict was used as a substitute for command or device evidence.
A fresh full offline gate used the same command above with --rerun-tasks:
BUILD SUCCESSFUL in 2m26s, all 56 Gradle tasks executed, rather than relying on
up-to-date test results. Evidence is retained in the task cache under
android-chat-visual/final-fresh-gate.log. Normal production build configuration
was restored after disposable side builds. The canonical manifest was checked
for the correct application ID and absence of the cache-only preview Activity.
The coordinator also used ADB capture/input while the host desktop was locked. A separate package contained a cache-injected offline Activity using the actual conversation renderer and chat layout, constrained to 392dp inside Waydroid's 948×1034px / 180dpi display. Observed behavior included:
- A distinct user surface followed by formatted assistant headings, emphasis, strike-through, inline code and numbered/nested lists, without raw prose markers.
- Native table headers/cells and a horizontal swipe revealing the right-hand column without moving or widening the rest of the conversation.
- A local Read outline listing user/assistant turns and headings; selecting the user turn returned to that content, and selecting a heading reached its section.
- A compact Latest overlay, monospace technical output, an explicit error label, inert literal HTML and an image-alt placeholder rather than a network fetch.
Representative captures in that task cache are 08-table-scrolled.png,
09-outline-visible.png and 10-user-and-prose.png. The fixture includes a
500-line synthetic tool result, but this initial pass did not establish its
expand/selection behavior or live streaming performance. Its keyboard handling
only mirrors part of the real Activity's inset setup and is not evidence for
production ChatActivity keyboard acceptance. A fixed-width view inside a larger
display is likewise not a real phone or a narrow-dialog test. Actual ChatActivity
runtime checks, when performed, are recorded separately from this fixture pass.
Actual ChatActivity runtime acceptance and final corrections
A separate system tester (claude/claude-sonnet-5-5, verified from session
metadata) exercised the real ChatActivity over SSH in an isolated side package,
using ADB only while the host desktop stayed locked. The viewport was temporarily
set to 360×800dp (405×900px at 180dpi), then restored. Navigation was read-only:
no prompts were submitted and no session actions were invoked.
The initial runtime pass confirmed rich prose, independent table scrolling, heading/turn navigation and Latest, native text-selection handles and toolbar, Material dialogs at 360dp, seven-line previews, pinned expansion/collapse, user and attachment presentation, and real Activity IME/status behavior. It found two layout defects that the JVM gate had not caught: a padding-relative fading band through visible text and unnecessary permanent bottom clearance. The coordinator corrected these and the smaller related usability findings:
- Disabled the vertical fade and reduced the permanent bottom margin from 72dp to 12dp. Latest is also synchronized after layout for jumps within an oversized row; near-bottom tolerance no longer assumes a 72dp clearance.
- Added an end-of-output Show less control which returns to the collapsed row's header, without impossible deep offsets or altered source.
- Moved horizontal scrollbars into their own inset strip below text.
- Made table columns content-sized within 64–240dp, rather than forcing a 120dp minimum for small ordinal columns.
- Replaced raw heading markers in the outline with a restrained hierarchy cue.
The same tester performed one targeted runtime recheck of these corrections.
The fading band was absent, the keyboard-open bottom gap fell from roughly 100px
to roughly 25px (including ordinary row/composer spacing), Latest showed/hidden
correctly, the new footer collapsed a 250-line system row back to its header,
scrollbars no longer crossed glyphs, and the narrower table/outline fit the phone
viewport. The coordinator personally inspected the key screenshots. Reports and
before/after captures are retained in the task cache under
android-chat-visual/runtime-review/{report.md,recheck/recheck.md}.
The coordinator also removed a misleading Show more control on long but short-line horizontal tool output: tool disclosure now depends on source line count, because expanding a one-line horizontal view could not reveal additional lines. Long wrapping system prose still has a useful preview, labeled Show full text rather than Show more (1 line). A native-widget regression covers both behaviors. This last small correction was unit/build-validated after the runtime recheck; the final normal-package launch confirmed that tool-call no-op controls were absent.
Final delivery validation
The full offline gate passed again in 2m14s after all code corrections:
909 test executions (783 app, 99 library, 27 Android-JSON), zero failures,
errors or skips; APK assembly passed; lint 0 errors / 67 warnings. App tests
and affected build/lint tasks reran; unchanged library tasks reused the earlier
fresh full-gate results. git diff --check passed. Four new renderer regression
tests cover the runtime corrections, bringing the final count 35 above the
original 874 baseline.
Evidence: task-cache android-chat-visual/final-delivery-gate.log and
automated-validation.json, plus the normal JUnit/lint report directories.
Final canonical APK SHA-256:
654f9b57a348b3b46d56afdc9cb62b4611e6f85f524915e8abb0607ffbbd9390.
Normal build configuration/output was restored; the canonical manifest contains
no cache-only fixture Activity. The final canonical package was installed and
launched in the authorized test environment, with machine-local connection setup
recorded privately rather than made part of the application or shared guide.
Remaining limits
This is phone-width Waydroid acceptance, not real-phone hardware acceptance. No TalkBack, large-font/light-theme/landscape, sustained streaming performance, real-device minimum-API run, or state-changing chat-action journey was performed. The real long-row exercise used 250 source lines; the 500-line case has widget coverage. Web-link confirmation has unit coverage but was not found in the live thread for a runtime check. Error/thinking behavior remains covered by tests, not this runtime pass. Native selection remains per block/cell, with full exact source separately available. The generic Options-sheet icon/risk overhaul is still deferred, and table swipe guidance remains visible even for near-fitting tables. Neither minor item blocks reading or navigation.
Coding-agent transcript refinements (2026-10-21)
The common-width, subtly offset blocks and then-bounded technical previews replaced full-width touching tool surfaces and unconditional raw-argument bodies. Current header-only tool collapse supersedes those previews. Known Bash/buffer/single-content write operations retain literal readable expanded inputs; exact argument JSON remains available through Copy source and Details. This historical validation predates merged exchange blocks and true tool collapse. Canonical call/result identities remain separate; current chat presentation and action ownership are described above. Multi-value substitutions and unsupported argument shapes deliberately stay raw rather than flattening ambiguous field boundaries.
Final validation results: 972 passing test executions (834 app, 138 library across its JVM/Android-JSON configurations), no failures/errors/skips; debug APK assembly passed; lint 0 errors / 67 warnings. Tests cover role width/offsets, wrapped and huge single-line input, real versus no-op disclosures, exact source copy, options-only rebinds, source/option separation, long-options control order, recycling/recreation, anchored collapse and existing automatic history paging. Independent source review identified and cleared two presentation/anchor defects.
An isolated offline Waydroid fixture exercised actual native renderer widgets at 360/392/412dp: subtle role offsets, read/patch summaries, call/result boundaries, 82-line command expansion and footer collapse, explicit errors, Markdown/table rendering and local horizontal code scrolling. The final normal-package APK was then installed without a data reset, its installed bytes matched the build, and read-only SSH conversation navigation confirmed the rendering in ChatActivity. No new model prompts or session mutations were used for this validation. This is not physical-phone acceptance or new image/webpage-opening functionality.
Conversation menu organization
The conversation menu is intentionally distinct from sidebar navigation. New session, connection switching, directory browsing, session-list refresh and per-session management retain their sidebar homes; they are not duplicated in Options. The sidebar connection dropdown also offers SSH key management and the existing draining Disconnect action.
Options exposes Session settings, Read conversation, Input, Commands and Help. The toolbar info button is the single session status/usage/progress entry point, not a duplicate overflow action. Read/queued-input entries require a persistent selected session. Stop agent is contextual to Running/Background; Resolve unconfirmed operation is shown only for the selected origin's recorded send, materialization or macro uncertainty that the existing reconciliation UI can inspect. Revealing this entry never clears a barrier or retries an operation.
Input groups process-local input history and queued input. Image Preview/Details/
Remove stay beside the attachments, without a global image-management menu. Commands
is a curated native action sheet rather than the slash/macro reference chooser:
refresh conversation/discovery, fork, tree, thinking disclosure, orphan recovery
and cache/pruning actions. Sidebar-owned slash equivalents are not duplicated.
The /commands spelling opens the same native submenu; other slash dispatch and
macro invocation behavior is unchanged. Maintenance offers direct seven-day
quick actions and a validated other-age editor (1–106751 days) with a scope
confirmation. Quick actions do not preview or confirm; neither path writes a
command into the composer or submits a prompt.
The top-right action uses a vertical-three-dot icon and an AndroidX PopupMenu anchored to that toolbar button. Input and Commands are real native submenus, with platform menu presentation, navigation and dismissal—not bottom sheets or a custom Back stack. The sidebar navigation icon remains a distinct drawer control. Its connection/profile picker may still use a modal sheet; that picker is separate from the conversation overflow.
Menu callbacks capture scope/selection and a presentation epoch, so navigation/ reconnect, replacement menus and Activity stop cannot retarget old callbacks. Stopping the Activity dismisses its popup/argument dialogs; already admitted work remains owned by the existing process controllers.
No permanent unimplemented placeholder was found among the old Options handlers. The cleanup removes duplicated and context-inapplicable entries, not functioning native implementations merely because they also have slash spellings.
Design references: Android UI design, Material components (navigation components), and Android menus (popup overflow anchored to its invoking top-right button). The conversation menu follows this anchored action pattern rather than using a drawer-navigation icon for a bottom-sheet action list.
Settings and shared Android interaction refinements
Extensive session/draft settings use a full-height, inset-aware surface, with Automation as a subordinate destination and Back returning through that hierarchy. Short model/thinking/mode choices remain Material single-choice dialogs. Stable setting names have supporting current values, while independent capabilities stay inline checkbox choices. Material text roles distinguish section, body, supporting and action text without changing the coding-focused transcript density.
State remains acknowledgement-driven and scoped to the current visit. No global Save transaction is implied; inherited/override state is still explicit. Stable choice identities retain meaningful keyboard/accessibility focus during updates where unambiguous; background refresh must not steal it. Lifecycle/context invalidation still dismisses stale UI. These are structural guarantees and tests, not a claim of physical-device TalkBack acceptance.
The CWD and drawer search areas use at least 48dp touch targets and growing content height. The standard left navigation-drawer icon opens the sidebar. The title/ metadata header remains a settings shortcut, with an explicit overflow alternative, without an extra wrench consuming header space. Shared actionable rows expose action roles without turning selectable status/prose into buttons. Recall/reference dialogs use the Material family, and mutation confirmation buttons name the actual action rather than a generic Confirm. Existing captures, previews, authoritative rechecks and cancellation semantics are preserved; these are wording/presentation improvements, not new command execution paths.
Image draft tray
Prepared image drafts use compact themed rows rather than platform Preview/Details/ Remove text buttons. The thumbnail/placeholder and filename form the preview target; separate icon actions expose Details and Remove with labeled touch targets. Names may wrap/ellipsize in the row, but the full filename remains available in the preview, Details and accessibility label. Metadata explains dimensions/type/size separately.
A short tray wraps its content; longer lists scroll within a bounded portion of the available window, including IME-resized layouts, rather than a fixed 100dp viewport. This is presentation only: original prepared bytes, captured origin/permission ownership, source preservation, draft removal and acknowledged-send cleanup are unchanged. Preview remains sampled and never claims to rewrite the sent image.