Skip to content

Commit 4a3f5a2

Browse files
committed
Fix stale scroll size after content reset and files shortcut regression
- T3ReviewDiffView: Call updateContentMetrics() in setContentResetKey to sync scrollView.contentSize with the cleared content, preventing stale oversized scroll area when switching files. - AdaptiveWorkspaceLayout: Restore handleOpenFilesCommand to show the inspector pane via showAuxiliaryPane instead of navigating to the files index route, which was dropping the currently open file.
1 parent 43b9724 commit 4a3f5a2

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ public final class T3ReviewDiffView: ExpoView, UIScrollViewDelegate {
565565
pendingScrollFileId = nil
566566
isProgrammaticScrollActive = false
567567
scrollView.setContentOffset(.zero, animated: false)
568-
updateViewportFrame()
568+
updateContentMetrics()
569569
applyInitialRowIndexIfNeeded()
570570
}
571571

apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
type WorkspacePaneLayout,
3131
} from "../../lib/layout";
3232
import { resolveThreadSelectionNavigationAction } from "../../lib/adaptive-navigation";
33-
import { buildThreadFilesNavigation, buildThreadRoutePath } from "../../lib/routes";
33+
import { buildThreadRoutePath } from "../../lib/routes";
3434
import { scopedThreadKey } from "../../lib/scopedEntities";
3535
import {
3636
parseActiveThreadPath,
@@ -204,13 +204,12 @@ export function AdaptiveWorkspaceLayout(props: { readonly children: ReactNode })
204204
setSupplementaryPanePreferredVisible(true);
205205
}, []);
206206
const handleOpenFilesCommand = useCallback(() => {
207-
const activeThread = parseActiveThreadPath(pathname);
208-
if (!layout.usesSplitView || !fileInspector.supported || activeThread === null) {
207+
if (!layout.usesSplitView || !fileInspector.supported || !parseActiveThreadPath(pathname)) {
209208
return false;
210209
}
211-
router.replace(buildThreadFilesNavigation(activeThread));
210+
showAuxiliaryPane("inspector");
212211
return true;
213-
}, [fileInspector.supported, layout.usesSplitView, pathname, router]);
212+
}, [fileInspector.supported, layout.usesSplitView, pathname, showAuxiliaryPane]);
214213
useHardwareKeyboardCommand("files", handleOpenFilesCommand);
215214
const toggleAuxiliaryPane = useCallback(() => {
216215
if (auxiliaryPaneRole === "inspector") {

0 commit comments

Comments
 (0)