@@ -22,7 +22,9 @@ import { EmptyState } from "../../components/EmptyState";
2222import type { WorkspaceState } from "../../state/workspaceModel" ;
2323import type { SavedRemoteConnection } from "../../lib/connection" ;
2424import { scopedProjectKey } from "../../lib/scopedEntities" ;
25+ import type { PendingNewTask } from "../../state/use-pending-new-tasks" ;
2526import {
27+ PendingTaskListRow ,
2628 ThreadListGroupHeader ,
2729 ThreadListRow ,
2830 ThreadListShowMoreRow ,
@@ -47,6 +49,7 @@ import { shouldShowWorkspaceConnectionStatus } from "./workspace-connection-stat
4749interface HomeScreenProps {
4850 readonly projects : ReadonlyArray < EnvironmentProject > ;
4951 readonly threads : ReadonlyArray < EnvironmentThreadShell > ;
52+ readonly pendingTasks : ReadonlyArray < PendingNewTask > ;
5053 readonly catalogState : WorkspaceState ;
5154 readonly savedConnectionsById : Readonly < Record < string , SavedRemoteConnection > > ;
5255 readonly environments : ReadonlyArray < HomeListFilterMenuEnvironment > ;
@@ -67,6 +70,9 @@ interface HomeScreenProps {
6770 readonly onSelectThread : ( thread : EnvironmentThreadShell ) => void ;
6871 readonly onArchiveThread : ( thread : EnvironmentThreadShell ) => void ;
6972 readonly onDeleteThread : ( thread : EnvironmentThreadShell ) => void ;
73+ readonly onSelectPendingTask : ( pendingTask : PendingNewTask ) => void ;
74+ readonly onDeletePendingTask : ( pendingTask : PendingNewTask ) => void ;
75+ readonly onNewThreadInProject : ( project : EnvironmentProject ) => void ;
7076}
7177
7278/* ─── Layout constants ───────────────────────────────────────────────── */
@@ -194,13 +200,15 @@ export function HomeScreen(props: HomeScreenProps) {
194200 buildHomeThreadGroups ( {
195201 projects : props . projects ,
196202 threads : props . threads ,
203+ pendingTasks : props . pendingTasks ,
197204 environmentId : props . selectedEnvironmentId ,
198205 searchQuery : props . searchQuery ,
199206 projectSortOrder : props . projectSortOrder ,
200207 threadSortOrder : props . threadSortOrder ,
201208 projectGroupingMode : props . projectGroupingMode ,
202209 } ) ,
203210 [
211+ props . pendingTasks ,
204212 props . projectGroupingMode ,
205213 props . projects ,
206214 props . projectSortOrder ,
@@ -246,11 +254,31 @@ export function HomeScreen(props: HomeScreenProps) {
246254 isFirst = { item . isFirst }
247255 groupKey = { item . group . key }
248256 onGroupAction = { updateGroupDisplay }
257+ // Aggregated groups (same repo across machines) have no single
258+ // target project, and `pending-project:` groups hold a placeholder
259+ // built from queued-task metadata rather than a real project shell,
260+ // so the quick new-thread button is single-real-project only.
261+ newThreadTarget = { item . group . newThreadTarget }
262+ onNewThread = { props . onNewThreadInProject }
249263 project = { item . group . representative }
250- threadCount = { item . group . threads . length }
264+ threadCount = { item . group . threads . length + item . group . pendingTasks . length }
251265 title = { item . group . title }
252266 />
253267 ) ;
268+ case "pending-task" :
269+ return (
270+ < PendingTaskListRow
271+ variant = "compact"
272+ pendingTask = { item . pendingTask }
273+ environmentLabel = {
274+ props . savedConnectionsById [ item . pendingTask . message . environmentId ]
275+ ?. environmentLabel ?? null
276+ }
277+ isLast = { item . isLast }
278+ onSelectPendingTask = { props . onSelectPendingTask }
279+ onDeletePendingTask = { props . onDeletePendingTask }
280+ />
281+ ) ;
254282 case "thread" : {
255283 const thread = item . thread ;
256284 return (
@@ -290,7 +318,10 @@ export function HomeScreen(props: HomeScreenProps) {
290318 handleSwipeableWillOpen ,
291319 projectCwdByKey ,
292320 props . onArchiveThread ,
321+ props . onDeletePendingTask ,
293322 props . onDeleteThread ,
323+ props . onNewThreadInProject ,
324+ props . onSelectPendingTask ,
294325 props . onSelectThread ,
295326 props . savedConnectionsById ,
296327 updateGroupDisplay ,
@@ -300,7 +331,8 @@ export function HomeScreen(props: HomeScreenProps) {
300331 const keyExtractor = useCallback ( ( item : HomeListItem ) => item . key , [ ] ) ;
301332
302333 /* Empty states */
303- const hasAnyThreads = props . threads . some ( ( thread ) => thread . archivedAt === null ) ;
334+ const hasAnyThreads =
335+ props . threads . some ( ( thread ) => thread . archivedAt === null ) || props . pendingTasks . length > 0 ;
304336 const hasResults = projectGroups . length > 0 ;
305337 const selectedEnvironmentLabel =
306338 props . selectedEnvironmentId === null
0 commit comments