feat(sessions): reorder and edit queued messages in place#3242
feat(sessions): reorder and edit queued messages in place#3242gantoine wants to merge 2 commits into
Conversation
Let users drag queued follow-ups to reorder them (the queue drains in array order, so the order shown is the order they send) and edit a queued message in the composer without pulling it out of the queue. - Add moveQueuedMessage and updateQueuedMessage store setters - Add SessionService.updateQueuedMessage mirroring enqueue normalization (cloud recomputes transport display + raw payload; local stores text) - Track the active edit target in sessionViewStore; the composer's next submit updates the message in place, falling back to a fresh send if it already drained or was discarded - Make each queued card a dnd-kit drag handle; highlight the card being edited with a cancel affordance Generated-By: PostHog Code Task-Id: 96d2978d-909b-4bbf-a45b-44ede597a1b8
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
🖥️ macOS test build (Apple Silicon)A signed macOS build for this PR is ready to download and run. ⬇️ Open this run and download the Unzip it to get the This build is signed but not notarized, so macOS quarantines it on download and Gatekeeper reports "PostHog Code is damaged and can't be opened". That is the missing notarization, not a corrupt file — clear the quarantine flag once and it launches: xattr -dr com.apple.quarantine "/Applications/PostHog Code.app"Then open PostHog Code normally. (Fully notarized, double-click-to-run builds ship only from the tagged release pipeline.) Built from cfae6e4 · rebuilds on each push while the |
What
Two additions to the queued-messages dock (the follow-ups pinned above the composer while a turn is running):
@dnd-kit/reactsortable pattern (same as sidebar folders / browser tabs), with aPointerSensormovement threshold so the card's buttons still take clicks.Previously the pencil ("return to editor") pulled the message out of the queue entirely; that hook (
useReturnQueuedMessageToEditor) is replaced byuseEditQueuedMessage/useCancelQueuedMessageEdit.How
moveQueuedMessageandupdateQueuedMessagestore setters;SessionService.updateQueuedMessagemirrors the enqueue normalization (cloud recomputes transport display + raw payload viagetCloudPromptTransport; local stores the serialized text).sessionViewStoretracks the active edit target per task (editingQueuedIdByTaskId);useSessionCallbacks.handleSendPromptroutes toupdateQueuedMessagewhen an edit is in progress;QueuedMessagesDockwires theDragDropProvider+ sortable cards and clears a stale edit target if the message leaves the queue.Testing
pnpm --filter @posthog/core typecheck+@posthog/ui typecheck— cleanpackages/core/src/sessions/sessionQueueEditing.test.ts(9 tests) for the store setters; updatedQueuedMessagesDock.test.tsxNot yet dogfooded in the running app — happy to do that next.
Created with PostHog Code