File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -922,6 +922,8 @@ describe("getVisibleThreadsForProject", () => {
922922 getThreadId : ( thread ) => thread . scopedKey ,
923923 } ) ;
924924
925+ expect ( result . hasHiddenThreads ) . toBe ( false ) ;
926+ expect ( result . hiddenThreads ) . toEqual ( [ ] ) ;
925927 expect ( result . visibleThreads ) . toEqual ( threads ) ;
926928 } ) ;
927929} ) ;
Original file line number Diff line number Diff line change @@ -507,11 +507,11 @@ export function getVisibleThreadsForProject<T extends Pick<Thread, "id">>(input:
507507} {
508508 const { activeThreadId, isThreadListExpanded, previewLimit, threads } = input ;
509509 const getThreadId = input . getThreadId ?? ( ( thread : T ) => thread . id ) ;
510- const hasHiddenThreads = threads . length > previewLimit ;
510+ const exceedsPreviewLimit = threads . length > previewLimit ;
511511
512- if ( ! hasHiddenThreads || isThreadListExpanded ) {
512+ if ( ! exceedsPreviewLimit || isThreadListExpanded ) {
513513 return {
514- hasHiddenThreads,
514+ hasHiddenThreads : exceedsPreviewLimit ,
515515 hiddenThreads : [ ] ,
516516 visibleThreads : [ ...threads ] ,
517517 } ;
@@ -539,9 +539,10 @@ export function getVisibleThreadsForProject<T extends Pick<Thread, "id">>(input:
539539 [ ...previewThreads , activeThread ] . map ( ( thread ) => getThreadId ( thread ) ) ,
540540 ) ;
541541
542+ const hiddenThreads = threads . filter ( ( thread ) => ! visibleThreadIds . has ( getThreadId ( thread ) ) ) ;
542543 return {
543- hasHiddenThreads : true ,
544- hiddenThreads : threads . filter ( ( thread ) => ! visibleThreadIds . has ( getThreadId ( thread ) ) ) ,
544+ hasHiddenThreads : hiddenThreads . length > 0 ,
545+ hiddenThreads,
545546 visibleThreads : threads . filter ( ( thread ) => visibleThreadIds . has ( getThreadId ( thread ) ) ) ,
546547 } ;
547548}
You can’t perform that action at this time.
0 commit comments