feat(sessions): reorder and edit queued messages in place#3242
Draft
gantoine wants to merge 1 commit into
Draft
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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