@@ -472,6 +472,10 @@ export function HomeScreen(props: HomeScreenProps) {
472472 // boundary is actually crossed while the app stays open (mirrors web);
473473 // without a clock dependency the partition memoizes a frozen "now".
474474 const [ nowMinute , setNowMinute ] = useState ( ( ) => new Date ( ) . toISOString ( ) . slice ( 0 , 16 ) ) ;
475+ // Snooze wake times are second-precise; a counter bumped exactly at the
476+ // next wake boundary re-runs the partition with a fresh clock so a woken
477+ // thread reappears immediately instead of on the next minute tick.
478+ const [ snoozeWakeTick , bumpSnoozeWakeTick ] = useState ( 0 ) ;
475479 useEffect ( ( ) => {
476480 if ( ! threadListV2Enabled ) return ;
477481 // Refresh immediately on enable: the mount-time value can be hours old
@@ -493,8 +497,18 @@ export function HomeScreen(props: HomeScreenProps) {
493497 }
494498 return supported ;
495499 } , [ serverConfigs ] ) ;
500+ const snoozeEnvironmentIds = useMemo ( ( ) => {
501+ const supported = new Set < EnvironmentId > ( ) ;
502+ for ( const [ environmentId , config ] of serverConfigs ) {
503+ if ( config . environment . capabilities . threadSnooze === true ) {
504+ supported . add ( environmentId ) ;
505+ }
506+ }
507+ return supported ;
508+ } , [ serverConfigs ] ) ;
496509 const threadListV2Layout = useMemo ( ( ) => {
497- if ( ! threadListV2Enabled ) return { items : [ ] , hiddenSettledCount : 0 } ;
510+ if ( ! threadListV2Enabled )
511+ return { items : [ ] , hiddenSettledCount : 0 , snoozedCount : 0 , nextSnoozeWakeAt : null } ;
498512 // Settled threads are live shells; archived threads keep their original
499513 // "hidden from lists" meaning.
500514 return buildThreadListV2Items ( {
@@ -504,20 +518,38 @@ export function HomeScreen(props: HomeScreenProps) {
504518 searchQuery : props . searchQuery ,
505519 changeRequestStateByKey,
506520 settlementEnvironmentIds,
521+ snoozeEnvironmentIds,
507522 settledLimit : settledVisibleCount ,
508523 now : `${ nowMinute } :00.000Z` ,
524+ snoozeNow : new Date ( ) . toISOString ( ) ,
509525 } ) ;
510526 } , [
511527 changeRequestStateByKey ,
512528 nowMinute ,
529+ snoozeWakeTick ,
513530 settledVisibleCount ,
514531 settlementEnvironmentIds ,
532+ snoozeEnvironmentIds ,
515533 props . searchQuery ,
516534 props . selectedEnvironmentId ,
517535 props . threads ,
518536 threadListV2Enabled ,
519537 v2ScopedProjectGroup ,
520538 ] ) ;
539+ // Re-partition the moment the earliest snooze expires (clamped to the
540+ // signed-32-bit setTimeout range; far-future wakes re-arm at the clamp).
541+ const nextSnoozeWakeAt = threadListV2Layout . nextSnoozeWakeAt ;
542+ useEffect ( ( ) => {
543+ if ( nextSnoozeWakeAt === null ) return ;
544+ const wakeAtMs = Date . parse ( nextSnoozeWakeAt ) ;
545+ if ( Number . isNaN ( wakeAtMs ) ) return ;
546+ const delayMs = Math . min ( Math . max ( 0 , wakeAtMs - Date . now ( ) ) + 50 , 2_147_483_647 ) ;
547+ const id = setTimeout ( ( ) => bumpSnoozeWakeTick ( ( tick ) => tick + 1 ) , delayMs ) ;
548+ return ( ) => clearTimeout ( id ) ;
549+ // snoozeWakeTick must re-arm the timer even when nextSnoozeWakeAt is
550+ // unchanged: after a clamped fire (wake beyond the 32-bit setTimeout
551+ // range) the boundary string is identical and the chain would die.
552+ } , [ nextSnoozeWakeAt , snoozeWakeTick ] ) ;
521553 const threadListV2Items = threadListV2Layout . items ;
522554
523555 const renderV2Item = useCallback (
@@ -813,11 +845,31 @@ export function HomeScreen(props: HomeScreenProps) {
813845 // Self-contained: v1's listEmpty keys off projectGroups, which ignores the
814846 // v2 project scope, so it can be null (results elsewhere) while this list
815847 // is empty. Search outranks the scope — "No results" names the actionable
816- // fact when a query is active. Pending tasks render in the header, so the
817- // list showing them isn't empty in the user's eyes.
848+ // fact when a query is active. Snoozed threads outrank the rest: "No
849+ // threads yet" over an inbox that is merely all-snoozed reads as data
850+ // loss. Pending tasks render in the header, so the list showing them
851+ // isn't empty in the user's eyes.
852+ const v2SnoozedCount = threadListV2Layout . snoozedCount ;
818853 const v2ListEmpty =
819854 v2PendingTasks . length > 0 ? null : hasSearchQuery ? (
820- < EmptyState title = "No results" detail = { `No threads matching "${ props . searchQuery } ".` } />
855+ v2SnoozedCount > 0 ? (
856+ // The snoozed threads already passed this search filter: "No
857+ // results" would claim nothing matched when matches are merely
858+ // parked.
859+ < EmptyState
860+ title = {
861+ v2SnoozedCount === 1 ? "1 matching thread snoozed" : `All matching threads snoozed`
862+ }
863+ detail = { `Threads matching "${ props . searchQuery } " are snoozed and return when their wake time passes.` }
864+ />
865+ ) : (
866+ < EmptyState title = "No results" detail = { `No threads matching "${ props . searchQuery } ".` } />
867+ )
868+ ) : v2SnoozedCount > 0 ? (
869+ < EmptyState
870+ title = { v2SnoozedCount === 1 ? "1 thread snoozed" : `${ v2SnoozedCount } threads snoozed` }
871+ detail = "Snoozed threads return when their wake time passes."
872+ />
821873 ) : v2ScopedProjectGroup !== null ? (
822874 < EmptyState
823875 title = { `No threads in ${ v2ScopedProjectGroup . title } ` }
0 commit comments