Skip to content

feat(mobile): list trigger characters in the empty composer - #242

Merged
nixuuu merged 1 commit into
devfrom
feat/mobile-trigger-hint
Nov 6, 2026
Merged

nixuuu merged 1 commit into
devfrom
feat/mobile-trigger-hint

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 6, 2026

Copy link
Copy Markdown
Member

The mobile thread and new-thread composers now show the same trigger hint as the web (#235): a second placeholder line / commands · $ skills · @ files · # threads · ! shell. Mobile has had mentions since #239.

Change (apps/mobile/src/features/threads/ComposerBox.tsx)

  • New triggers prop. With it, and when not compact, the placeholder gets the hint as a second line.
  • Each item is joined with a no-break space, so a wrap on a narrow phone never splits # from threads.
  • MessageComposer and NewThreadScreen pass triggers. Bot chats and compact composers keep one line.

Checked: typecheck, lint, format:check, expo lint. The device check is on a preview APK on a Galaxy Z Fold, folded and unfolded.

Copy audit (§8): same text as the web hint (#235), with the same glossary words as the mention popup and no instruction verbs.

Thread and new-thread composers show a second placeholder line with what each trigger character does, as on the web: / commands, $ skills, @ files, # threads and ! shell. No-break spaces keep each item on one line when it wraps. Bot chats and compact composers keep one line.
@nixuuu
nixuuu merged commit ccf6bdb into dev Nov 6, 2026
9 checks passed
@nixuuu
nixuuu deleted the feat/mobile-trigger-hint branch November 6, 2026 08:38
nixuuu added a commit that referenced this pull request Nov 7, 2026
## Change

Keep the mobile thread composer's trigger hint on one line in both
compact and expanded states. Previously, expansion replaced `Ask
anything…` with a two-line placeholder after the animation, causing a
second layout change. The hint now renders outside the native multiline
input's content measurement and truncates with a tail ellipsis.
Composers without triggers retain their existing placeholder; web copy
is unchanged.

Route every mobile editable field through a shared `ui/TextInput`. On
iOS it clears inherited `lineHeight`, letting UIKit use the font's
native metrics for placeholders and typed text. Android receives the
original styles. This covers sidebar thread search, project picker
search, settings search, kit fields, project settings, queued-message
editing and the composer.

The pinned React Native iOS implementation applies explicit line heights
as paragraph attributes. Ordinary attributed text receives
`RCTApplyBaselineOffset`, while TextInput's default typing/placeholder
attributes come directly from `RCTNSTextAttributesFromTextAttributes`.
The shared 16/24 typography therefore pushed input glyphs down. This
predates the recent composer animation changes.

Related: #242, #308

## Verification

- GitHub CI at handoff: all nine checks passed, including all four test
shards, static checks, typecheck and builds.
- Passed: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun
run lint`, `bun run format:check`, web production build, mobile
typecheck, `bunx expo lint`, Expo Doctor (20/20), Android native debug
build, and iOS/Android production JS exports.
- Full `bun run check:tmp --timeout 30000`: **not green** — 1,712
passed, 161 skipped, one setup-hook timeout in `worker-host.test.ts` and
one associated HTTP/2 GOAWAY error (1,874 tests / 309 files). The
temp-directory gate reported nothing left. The isolated `check:tmp
tests/integration/worker-host.test.ts --timeout 30000` rerun passed all
15 tests and temp cleanup. An earlier run encountered six cascading
config-sync recovery failures and exited 143 before completion; the
isolated recovery file then passed all six tests. No gateway/worker code
was changed.
- Android: built locally with a private SDK/Gradle and installed on a
temporary phone emulator and the existing Fold (private package on Fold,
preserving its installed app). A temporary inspection route mounted the
real composer, fold/scroll hooks and input components. Checked
light/dark, phone/Fold, 280 dp truncation, compact/expanded transitions,
focused writing mode with controls hidden, single/multiline drafts and
the bot placeholder. Recording frames confirm one hint line throughout
expansion with no delayed height jump. Checked bare thread search,
settings search, project picker search, single/multiline kit fields and
settings inputs with short, typical and long text. This verifies
components in an offline inspection screen, not paired gateway
navigation.
- iOS: an iPhone simulator probe mounted the actual shared wrapper
beside native inputs using the same Inter font and 16/24 typography.
Checked light/dark, empty placeholders, typed single-line text and
three-line drafts. The shared style moved glyphs up about 5–6 pt
relative to their field borders, with no clipping. **Full iOS composer
transitions and the actual sidebar/project/settings screen contexts
remain unverified.** The existing dev client lacks `CanopyPinnedFetch`;
private native preparation brought available disk below the required 12
GiB, so no Xcode build was started. The probe avoided transport imports.
Source inspection supports the shared fix, but does not replace full iOS
app verification.
- No permanent UI tests or inspection routes were added. Temporary
apps/AVD, native build output, private toolchains, Metro and forwarding
processes were cleaned up. Inline self-review covered input/ref
forwarding, all native input import sites, Android style preservation,
accessibility, truncation and composer sizing.

## Copy audit (§8)

- Before → after: mobile `Ask anything…` plus a second trigger line →
only `/ commands · $ skills · @ files · # threads · ! shell`, identical
in compact/expanded states. Removes redundant prompt copy and the late
line-count change; documented in §4.9. No-trigger and web placeholders
keep their existing wording.
- §8.1–2: existing short trigger labels, punctuation, glossary and NBSP
item grouping retained; no new terms.
- §8.3–5,7–8: no changed actions, confirmations, errors, empty-state
messages, dependency messages or humour.
- §8.6,10: no duplicate visible prompt; the field keeps its accessible
label and exposes the full hint as an accessibility hint. Meaning does
not depend on colour, icon shape or position.
- §8.9: Android phone, 280 dp and Fold width checked with short, typical
and long text; desktop/web unchanged. iOS scope and remaining visual
gaps are stated above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant