File tree Expand file tree Collapse file tree
apps/mobile/src/features/review
packages/client-runtime/src/state Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -515,7 +515,6 @@ export function buildReviewSectionItems(input: {
515515 readonly checkpoints : ReadonlyArray < ThreadCheckpointSummary > ;
516516 readonly gitSections : ReadonlyArray < ReviewDiffPreviewSource > ;
517517 readonly turnDiffById : Readonly < Record < string , string | undefined > > ;
518- readonly loadingTurnIds : Readonly < Record < string , boolean | undefined > > ;
519518 readonly loadingGitSections : boolean ;
520519} ) : ReadonlyArray < ReviewSectionItem > {
521520 const turnItems = getReadyReviewCheckpoints ( input . checkpoints ) . map < ReviewSectionItem > (
@@ -527,7 +526,7 @@ export function buildReviewSectionItems(input: {
527526 title : checkpointTitle ( checkpoint ) ,
528527 subtitle : checkpointSubtitle ( checkpoint ) ,
529528 diff : input . turnDiffById [ id ] ?? null ,
530- isLoading : input . loadingTurnIds [ id ] === true ,
529+ isLoading : false ,
531530 } ;
532531 } ,
533532 ) ;
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ const NO_GIT_SECTIONS_ATOM = Atom.make<ReadonlyArray<ReviewDiffPreviewSource>>([
2727 Atom . keepAlive ,
2828 Atom . withLabel ( "mobile:review:git-sections:null" ) ,
2929) ;
30- const NO_TURN_DIFFS = Object . freeze ( { } ) ;
31- const NO_TURN_DIFFS_ATOM = Atom . make < Readonly < Record < number , string > > > ( NO_TURN_DIFFS ) . pipe (
30+ const NO_TURN_DIFFS_ATOM = Atom . make < Readonly < Record < number , string > > > ( { } ) . pipe (
3231 Atom . keepAlive ,
3332 Atom . withLabel ( "mobile:review:turn-diffs:null" ) ,
3433) ;
@@ -87,7 +86,6 @@ export function useReviewSections(input: {
8786 gitSections :
8887 canReadFiles || fileAccess . isPending ? ( diffPreview . data ?. sources ?? lastGitSections ) : [ ] ,
8988 turnDiffById : reviewTurnDiffsBySectionId ( readyCheckpoints , lastTurnDiffs ) ,
90- loadingTurnIds : NO_TURN_DIFFS ,
9189 loadingGitSections : fileAccess . isPending || diffPreview . isPending ,
9290 } ) ;
9391 const selectedSectionId = resolveReviewSelectedSectionId (
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export function createReviewEnvironmentAtoms<R, E>(
4343 const target = JSON . parse ( key ) as Parameters < typeof diffPreview > [ 0 ] ;
4444 return Atom . make ( ( get ) => {
4545 // A failed refresh keeps the last revision, so an error does not refresh every patch.
46+ // Reading the preview here keeps its query mounted while any of its patches is read.
4647 return Option . match ( AsyncResult . value ( get ( diffPreview ( target ) ) ) , {
4748 onNone : ( ) => null ,
4849 onSome : ( preview ) => DateTime . formatIso ( preview . generatedAt ) ,
You can’t perform that action at this time.
0 commit comments