Skip to content

Commit ba79650

Browse files
refactor(mobile): drop unused loadingTurnIds from review section builder
The active turn's loading state is applied after the build, so the builder no longer takes a loading map, and the empty turn-diff object is no longer passed as one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d3e3ca3 commit ba79650

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

‎apps/mobile/src/features/review/reviewModel.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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
);

‎apps/mobile/src/features/review/useReviewSections.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff 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(

‎packages/client-runtime/src/state/review.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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),

0 commit comments

Comments
 (0)