GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(mobile): thread inspector mode is derived, not synced by juliusmarminge · Pull Request #25682 · pingdotgg/t3code

refactor(mobile): thread inspector mode is derived, not synced #25682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
juliusmarminge merged 1 commit into main from effect/split-m-chain-1-inspector-mode
Oct 27, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

refactor(mobile): thread inspector mode is derived, not synced #25682

Changes from all commits
Commits
Show all changes
1 commit
Select commit
7e518c8
refactor(mobile): thread inspector mode is derived, not synced
juliusmarminge Oct 26, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
refactor(mobile): thread inspector mode is derived, not synced
ThreadRouteScreen stored the inspector selection together with the thread
identity it was picked for, then copied the new identity in after every route
change with an effect. Each thread switch therefore rendered once with no
inspector mode (deregistering the workspace inspector and letting the
auto-close effect see a transient empty state), then rendered again once the
effect caught up.

Store only the mode the user chose and derive the effective mode in render:
"route" applies whenever the route supplies an inspector, a chosen git/files
mode carries over, and files drops out when the thread has no working
directory.

Effects: ThreadRouteScreen.tsx 4 -> 3. Removed the selection sync effect.
Kept the auto-close effect: it writes the shared workspace pane preference
when this thread has nothing to show, and dropping it would leave the pane
preferred-visible, which on non-native split view keeps the primary sidebar
suppressed with no inspector beside it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge @claude
juliusmarminge and claude committed Oct 26, 2026
commit 7e518c86e3ae302df70991d4afb89f6568f5de21

There are no files selected for viewing

52 changes: 14 additions & 38 deletions 52 apps/mobile/src/features/threads/ThreadRouteScreen.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ import {
import type { ThreadInspectorTarget } from "./thread-inspector-navigation";
import { useSelectWorkspaceDetail } from "../workspace/useSelectWorkspaceDetail";

interface ThreadInspectorSelection {
readonly routeThreadIdentity: string | null;
readonly mode: ThreadInspectorMode;
}

function InspectorPaneRoleActivation() {
useAdaptiveWorkspacePaneRole("inspector");
return null;
Expand Down Expand Up @@ -435,19 +430,21 @@ function ThreadRouteContent(
const threadId = firstRouteParam(params.threadId);
const routeThreadIdentity =
environmentIdRaw !== null && threadId !== null ? `${environmentIdRaw}:${threadId}` : null;
const [inspectorSelection, setInspectorSelection] = useState<ThreadInspectorSelection | null>(
() => (props.renderInspector ? { routeThreadIdentity, mode: "route" } : null),
);
// The chosen mode survives thread switches; "route" only applies while the route
// supplies an inspector, which is also the default whenever it does.
const [chosenInspectorMode, setChosenInspectorMode] = useState<ThreadInspectorMode | null>(null);
const previewTarget = props.inspectorPresentation ? undefined : params.inspector;
const inspectorMode = (() => {
if (previewTarget) return "preview";
if (inspectorSelection?.routeThreadIdentity === routeThreadIdentity) {
if (inspectorSelection.mode === "files" && selectedThreadCwd === null) {
return null;
}
return inspectorSelection.mode;
}
return null;
const mode =
props.renderInspector === undefined
? chosenInspectorMode === "route"
? null
: chosenInspectorMode
: chosenInspectorMode === null || chosenInspectorMode === "route"
? "route"
: chosenInspectorMode;
return mode === "files" && selectedThreadCwd === null ? null : mode;
})();
useEffect(() => {
if (
Expand All @@ -468,24 +465,6 @@ function ThreadRouteContent(
toggleAuxiliaryPane,
]);

useEffect(() => {
// oxlint-disable-next-line react/set-state-in-effect -- Inspector selection follows route ownership but keeps an inspector the user opened.
setInspectorSelection((current) => {
if (props.renderInspector === undefined) {
if (current === null || current.mode === "route") {
return null;
}
return { ...current, routeThreadIdentity };
}

if (current === null || current.mode === "route") {
return { routeThreadIdentity, mode: "route" };
}

return { ...current, routeThreadIdentity };
});
}, [props.renderInspector, routeThreadIdentity]);

const revealPreview = useEffectEvent(() => showAuxiliaryPane("inspector"));
useEffect(() => {
if (previewTarget) revealPreview();
Expand Down Expand Up @@ -552,7 +531,7 @@ function ThreadRouteContent(
return;
}
navigation.setParams({ inspector: undefined });
setInspectorSelection({ routeThreadIdentity, mode: "git" });
setChosenInspectorMode("git");
showAuxiliaryPane("inspector");
};
const handleOpenFilesInspector = () => {
Expand All @@ -567,10 +546,7 @@ function ThreadRouteContent(
return;
}
navigation.setParams({ inspector: undefined });
setInspectorSelection({
routeThreadIdentity,
mode: props.renderInspector === undefined ? "files" : "route",
});
setChosenInspectorMode(props.renderInspector === undefined ? "files" : "route");
showAuxiliaryPane("inspector");
};
const handleToggleInspector = () => {
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.