feat(task-input): show prompt in chat thread immediately on submit#2310
feat(task-input): show prompt in chat thread immediately on submit#2310fercgomes wants to merge 2 commits into
Conversation
|
| /** Render inside an existing positioned container — skip the absolute fill wrapper. */ | ||
| embedded?: boolean; |
There was a problem hiding this comment.
The JSDoc says "skip the absolute fill wrapper" when
embedded is true, but the code does the opposite — it adds an absolute inset-0 wrapper. The comment should describe that the absolute wrapper is added so the component fills an existing relative container.
| /** Render inside an existing positioned container — skip the absolute fill wrapper. */ | |
| embedded?: boolean; | |
| /** Render inside an existing `relative` positioned container — wraps content in `absolute inset-0` to fill it. */ | |
| embedded?: boolean; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sessions/components/PendingChatView.tsx
Line: 8-9
Comment:
The JSDoc says "skip the absolute fill wrapper" when `embedded` is true, but the code does the opposite — it *adds* an `absolute inset-0` wrapper. The comment should describe that the absolute wrapper is added so the component fills an existing `relative` container.
```suggestion
/** Render inside an existing `relative` positioned container — wraps content in `absolute inset-0` to fill it. */
embedded?: boolean;
```
How can I resolve this? If you propose a fix, please make it concise.|
this is FIRE, thank you, one of my biggest pet peeves [mostly typing before i forget, and maybe so i can use this comment as a prompt later 😂] as a followup i might try to make the loading state a bit more obvious too - maybe putting the input box at the bottom immediately as a shimmer loader or disabled, and putting a "starting task..." loader below the initial msg that looks like a normal agent loading state |
Previously, submitting a new task left the user staring at the `TaskInput` form (with its submit button spinning) until the saga finished creating the task, registering the folder, and creating the workspace. Only then would `onTaskReady` fire and navigate to `TaskDetail`, where `SessionView` would show a full-screen spinner until the agent session connected and `applyOptimisticPrompt` wrote the user message into the optimistic store. The flow felt sluggish because each of those steps blocked the UI from showing the user's prompt. This change navigates to a thread-style view synchronously on submit: - New `task-pending` view in `navigationStore` (transient — excluded from persistence; replaced in history on transition so back doesn't land on a stale placeholder). - `pendingTaskPromptStore` holds the prompt text keyed first by a client-generated UUID, then re-keyed to the real task id once the saga returns. - `PendingChatView` renders the user-message bubble + "Connecting to agent..." footer using the same layout as `SessionView`'s connected state. `TaskPendingView` wraps it for the view-router; `SessionView`'s initializing branch also renders it when a pending entry exists, bridging the gap until `applyOptimisticPrompt` fires. - `useTaskCreation.handleSubmit` stashes the prompt, navigates to the pending view, then runs the saga. On failure it clears the pending entry and navigates back to `task-input` with `initialPrompt` preserved. - `MainLayout`, `useSidebarData`, and `TaskListView` treat `task-pending` like `task-input` for sidebar/SpaceSwitcher state. `CommandCenterPanel`'s `onTaskCreated` override skips the pending view so its existing flow is untouched. Tests: 2 new navigation-store tests cover `navigateToPendingTask` and the history-replace behavior; all 914 renderer tests pass. Generated-By: PostHog Code Task-Id: c34038da-f59d-4a38-8487-e5f3c6a1ef78
a3cf016 to
dcf7ea0
Compare
|
rebased to bring in the merged bulk archive, testing & reviewing now! |
|
turns out that feedback was quick for code to implement 😛 thoughts? |
…initializes Replaces the centered "Connecting to agent..." footer in the pending chat view with a non-interactive `PromptInput` skeleton at the bottom and an inline "Starting task..." indicator directly below the user message — the screen now looks identical in layout to the live chat, so there is no visible jump when init finishes. Also carries the full attachment list through the pending prompt store so attachment chips render under the user message in the pending view. Generated-By: PostHog Code Task-Id: 51016b35-b815-4839-bfbd-5a24cd9356ff

Summary
Submitting a new task used to leave the user on
TaskInput(with a spinning submit button) until the saga finished creating the task, folder, and workspace. Only then didonTaskReadyfire and navigate toTaskDetail, whereSessionViewshowed a full-screen spinner until the agent session connected andapplyOptimisticPromptwrote the user message into the optimistic store. The flow felt sluggish because each step blocked the UI from showing the prompt.This change navigates to a thread-style view synchronously on submit:
task-pendingview innavigationStore(transient — excluded from persistence; replaced in history on transition so back doesn't land on a stale placeholder).pendingTaskPromptStoreholds the prompt text keyed first by a client-generated UUID, then re-keyed to the real task id once the saga returns.PendingChatViewrenders the user-message bubble + "Connecting to agent..." footer with the same layout asSessionView's connected state.TaskPendingViewwraps it for the view-router;SessionView's initializing branch also renders it when a pending entry exists, bridging the gap untilapplyOptimisticPromptfires.useTaskCreation.handleSubmitstashes the prompt, navigates to the pending view, then runs the saga. On failure it clears the pending entry and navigates back totask-inputwithinitialPromptpreserved.MainLayout,useSidebarData, andTaskListViewtreattask-pendingliketask-inputfor sidebar/SpaceSwitcher state.CommandCenterPanel'sonTaskCreatedoverride skips the pending view so its existing flow is untouched.Screen.Recording.2026-05-22.at.16.23.08.mov
Test plan
pnpm --filter code typecheckcleannavigateToPendingTaskand the history-replace behaviorTaskDetailCloudInitializingViewtakes overtask-inputwith the prompt restoredCommandCenterPanel— no pending view; existing flow unchangedTaskDetailafter submit — lands ontask-input, not the empty pending placeholder