Skip to content

feat(mobile): reorder and edit queued messages in place (port #3242)#3466

Merged
trunk-io[bot] merged 2 commits into
mainfrom
posthog-code/mobile-reorder-edit-queued-messages
Jul 15, 2026
Merged

feat(mobile): reorder and edit queued messages in place (port #3242)#3466
trunk-io[bot] merged 2 commits into
mainfrom
posthog-code/mobile-reorder-edit-queued-messages

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The mobile app lets you queue follow-up messages while the agent is mid-turn,
but you could only steer or discard them — there was no way to reorder the
queue or fix a message you'd already queued. This ports the desktop
capabilities (#3242) to mobile.

Changes

  • Reorder queued messages with per-card move up/down controls; the order
    shown is the order they send.
  • Edit in place: pull a queued message into the composer while it stays in
    the queue, then save it back into its original position (or cancel, leaving
    it unchanged). The composer shows an "Editing queued message" banner with a
    cancel action.
  • Drain boundary: while a message is being edited it acts as a hard
    boundary — when the turn ends, only the messages queued before it
    auto-send; the edited message and everything after it stay queued until the
    edit is saved or cancelled.

Queue/edit logic lives in messageQueueStore (reorder, in-place update, and
the edit-hold that gates draining) and taskSessionStore
(flushQueuedMessagesIfIdle); the screen and dock are thin wiring. The
sendable-prefix boundary mirrors sendableQueuePrefixLength from
@posthog/shared, reimplemented locally because mobile's queue rows don't
match the shared AgentSession message shape.

How did you test this?

  • Extended messageQueueStore.test.ts (reorder, edit-in-place update, edit
    hold set/clear + clear-on-remove, and the stopAtEdited drain boundary).
  • Added flushQueuedMessagesIfIdle cases to taskSessionStore.test.ts
    (idle flush, edit-boundary flush, and no-op while running/terminal/compacting
    or empty). All 55 mobile store tests pass via vitest run.
  • Ran biome check and tsc on the changed files — clean.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Ports the desktop queued-messages improvements to the mobile app.

- Reorder queued messages with per-card move up/down controls.
- Edit a queued message in place: pull it into the composer while it stays
  in the queue, then save it back into position (or cancel unchanged).
- Drain boundary: while a message is being edited, only the messages queued
  before it auto-send when the turn ends; the edited message and everything
  after it stay queued until the edit is saved or cancelled.

Generated-By: PostHog Code
Task-Id: 8d0379e9-fb51-4ce7-9eb9-8f5b7a508bf0
@Gilbert09 Gilbert09 requested a review from a team July 15, 2026 10:47
@trunk-io

trunk-io Bot commented Jul 15, 2026

Copy link
Copy Markdown

😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 4db7ada.

@trunk-io trunk-io Bot merged commit 6306e29 into main Jul 15, 2026
29 checks passed
@trunk-io trunk-io Bot deleted the posthog-code/mobile-reorder-edit-queued-messages branch July 15, 2026 13:31
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.

2 participants