Skip to content

feat(mobile): place files as badges in the text and edit queued messages - #237

Merged
nixuuu merged 1 commit into
feat/mobile-parity-1from
feat/mobile-parity-2
Nov 6, 2026
Merged

nixuuu merged 1 commit into
feat/mobile-parity-1from
feat/mobile-parity-2

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Stage 2 of 4, mobile parity round 2: the composer.

Changed

  • Inline badges: a picked file goes into the text as a badge [name] at the caret (an ATTACHMENT mention, as on the web since feat(composer): show attachments as inline badges in the text #200). The text field renders mentions as tinted spans, so the characters stay plain text.
    • An edit that touches a badge removes all of it and its file; text typed inside a badge lands after it.
    • Removing a file removes its badge.
    • The field cannot show progress, so files that are uploading or failed keep a chip above the text with the state and Remove. A stored file has only its badge.
    • Messages send mentions with the stored attachment ids; new threads send initial_mentions.
  • Sent messages show badges at their places (Turn.mentions); chips remain only for files not placed in the text.
  • Queued messages (as the web queue editor, feat(queue): edit queued messages with attachment badges #201): a "…" next to "Queued" offers Edit message and Delete.
    • The editor uses the same badges; deleting one shows "‹name› leaves the message when you save." (or "N files leave …").
    • Save sends EditQueuedTurn with the full positions and mentions_complete; Delete sends DeleteQueuedTurn.
  • The text and mentions model is features/composer/message-value.ts, shared by the composer and the queue editor.

Keyboard gap fix (reported from a real Galaxy Z Fold, folded, gesture navigation)

  • Bug: with the keyboard open, the composer floated well above it, with an empty band under it. Seen in bot chats and threads.
  • Cause, measured on the emulator at phone width: window 841 dp, keyboard top at y = 538, status bar 24 dp, nav-bar inset 32 dp.
    • The app runs edge-to-edge, so the window never resizes.
    • KeyboardAvoidingView sat inside a SafeAreaView that kept the 32 dp bottom inset, and keyboardVerticalOffset={insets.top} counted the status bar again, since frames are already in window coordinates.
    • The composer ended 24 dp plus its padding above the keyboard here, more with a taller status bar.
  • Fix, no new dependency: ui/KeyboardArea.tsx measures how far the keyboard reaches up from the window's bottom edge (window height minus the keyboard's screenY; on Android height leaves out the nav bar under the keyboard).
    • With the keyboard open, the composer sits directly on it with its normal padding. With the keyboard closed, it keeps the bottom safe-area inset.
    • Applied to the thread screen, bot chat, New thread and Pair, whose SafeAreaView now leaves out the bottom edge.
    • The same gap was in Overlay's bottom sheets (Rename, queue editor, goal and side-thread forms): the sheet now sits on the keyboard and drops its bottom inset while the keyboard is open.
    • New thread on Android had no avoidance at all (the lower pills were under the keyboard); it now shrinks and scrolls.
    • On iOS the area follows keyboardWillShow/Hide with the keyboard's own animation timing (instant with reduced motion). iOS was not checked on a device: there is no iOS dev build, and building one did not fit the Mac's disk budget.
  • Checked on Canopy_Fold with the stock keyboard: phone width (folded) and unfolded, keyboard open and closed, a four-line draft. Thread, bot chat, New thread, Pair and a bottom-sheet form all sit flush on the keyboard; with the keyboard closed, the composer keeps its inset above the gesture bar.

Not done

  • Undo: React Native's text field has no undo stack.
  • Tapping a badge to preview the file, and moving queued messages or switching queueing from the menu.

Checked

  • Gates clean, as in stage 1.
  • Android emulator, light and dark, unfolded and phone width:
    • a badge inserted after typed text, and a long file name wrapping;
    • Backspace into a badge removes the badge and its file;
    • a message with a badge in the queue, then sent and shown with the badge in place;
    • edit and save of a queued message;
    • a badge removed in the editor with the "leaves the message" line, saved without the file.

Copy audit (§8)

  • "Edit message", "Delete", "Queued message actions", "Edit queued message", "Cancel", "Save": verbs first; the web's labels.
  • "‹name› leaves the message when you save." / "N files leave the message when you save.": the web's text, one idea, present tense.

A picked file goes into the composer text as a badge at the caret; a badge goes whole with its file. Sent messages show the badges in place. A queued message has Edit message and Delete; the editor keeps the badges and says which files leave on save.
@nixuuu
nixuuu added this pull request to stack #240 November 6, 2026 07:36
@nixuuu
nixuuu marked this pull request as ready for review November 6, 2026 07:44
@nixuuu
nixuuu merged commit 47281a7 into dev Nov 6, 2026
16 of 18 checks passed
@nixuuu
nixuuu deleted the feat/mobile-parity-2 branch November 6, 2026 07:44
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