Stabilize inspector pane state
This commit is contained in:
1 parent
c2aba434a1
commit
80208bc2c4
3 files changed
+23
-6
No files matched your search
@@ -561,12 +561,12 @@ public final class T3ReviewDiffView: ExpoView, UIScrollViewDelegate {
|
||||
rows = []
|
||||
contentView.rows = []
|
||||
hasAppliedInitialRowIndex = false
|
||||
lastVisibleFileId = nil
|
||||
pendingScrollFileId = nil
|
||||
isProgrammaticScrollActive = false
|
||||
scrollView.setContentOffset(.zero, animated: false)
|
||||
updateContentMetrics()
|
||||
updateViewportFrame()
|
||||
lastVisibleFileId = nil
|
||||
applyInitialRowIndexIfNeeded()
|
||||
}
|
||||
|
||||
|
||||
@@ -537,10 +537,10 @@ export function ThreadFilesTreeScreen() {
|
||||
[projectName],
|
||||
);
|
||||
useEffect(() => {
|
||||
if (fileInspector.supported) {
|
||||
if (fileInspector.supported && cwd !== null) {
|
||||
showAuxiliaryPane("inspector");
|
||||
}
|
||||
}, [fileInspector.supported, showAuxiliaryPane]);
|
||||
}, [cwd, fileInspector.supported, showAuxiliaryPane]);
|
||||
|
||||
if (selectedThread === null || environmentId === null || threadId === null) {
|
||||
if (fileInspector.supported) {
|
||||
|
||||
@@ -220,7 +220,7 @@ function ThreadRouteContent(
|
||||
readonly selectedThreadDetailState: ReturnType<typeof useSelectedThreadDetailState>;
|
||||
},
|
||||
) {
|
||||
const { fileInspector, layout, showAuxiliaryPane, toggleAuxiliaryPane } =
|
||||
const { fileInspector, layout, panes, showAuxiliaryPane, toggleAuxiliaryPane } =
|
||||
useAdaptiveWorkspaceLayout();
|
||||
const { connectionState } = useRemoteConnectionStatus();
|
||||
const { onReconnectEnvironment } = useRemoteConnections();
|
||||
@@ -261,6 +261,22 @@ function ThreadRouteContent(
|
||||
}
|
||||
return null;
|
||||
})();
|
||||
useEffect(() => {
|
||||
if (
|
||||
fileInspector.supported &&
|
||||
selectedThreadCwd === null &&
|
||||
inspectorMode === null &&
|
||||
panes.auxiliaryPaneVisible
|
||||
) {
|
||||
toggleAuxiliaryPane();
|
||||
}
|
||||
}, [
|
||||
fileInspector.supported,
|
||||
inspectorMode,
|
||||
panes.auxiliaryPaneVisible,
|
||||
selectedThreadCwd,
|
||||
toggleAuxiliaryPane,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
setInspectorSelection((current) => {
|
||||
@@ -451,6 +467,7 @@ function ThreadRouteContent(
|
||||
) : null,
|
||||
[handleSelectInspectorFile, selectedThread, selectedThreadCwd, selectedThreadProject?.title],
|
||||
);
|
||||
const RouteInspector = useCallback(() => props.renderInspector?.(0), [props.renderInspector]);
|
||||
const renderInspectorStack = useCallback(
|
||||
() =>
|
||||
inspectorMode === null ? null : (
|
||||
@@ -458,10 +475,10 @@ function ThreadRouteContent(
|
||||
Files={FilesInspector}
|
||||
Git={GitInspector}
|
||||
mode={inspectorMode}
|
||||
Route={props.renderInspector ? () => props.renderInspector?.(0) : undefined}
|
||||
Route={props.renderInspector ? RouteInspector : undefined}
|
||||
/>
|
||||
),
|
||||
[FilesInspector, GitInspector, inspectorMode, props.renderInspector],
|
||||
[FilesInspector, GitInspector, RouteInspector, inspectorMode, props.renderInspector],
|
||||
);
|
||||
const activeInspectorRenderer = inspectorMode === null ? undefined : renderInspectorStack;
|
||||
|
||||
|
||||
Reference in new issue
Block a user