Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): PR code view keeps its scroll when a turn finishes #13835

Mergedsameerr03(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/13835/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 14 additions and 3 deletions.

x
0 of 2 viewed, 2 left
12 additions and 1 deletionapps/web/src/components/pullRequest/PullRequestCodeTab.tsxModified
View file
@@ -252,6 +252,7 @@
onAddToAgentSelection,
onRefresh,
refreshToken = 0,
+ backgroundRefreshToken = 0,
revealRequest = null,
}: {
scrollerRef: (node: HTMLDivElement | null) => void;
@@ -266,6 +267,7 @@
onAddToAgentSelection?: (input: PullRequestAgentSelectionInput) => void;
onRefresh: () => void;
refreshToken?: number;
+ backgroundRefreshToken?: number;
revealRequest?: { readonly path: string; readonly nonce: number } | null;
}) {
const { resolvedTheme } = useTheme();
@@ -308,7 +310,7 @@
​
const referenceKey = pullRequestReviewKey(reference);
const commit = selectedCommitOid;
- const scopeKey = commit === null ? referenceKey : `${referenceKey}@${commit}`;
+ const scopeKey = JSON.stringify([environmentId, referenceKey, commit]);
// The panel keeps this mounted across pull requests, so an open composer would otherwise
// survive the switch and attach its comment to whichever one is on screen when it is sent.
const [stateScopeKey, setStateScopeKey] = useState(scopeKey);
@@ -432,6 +434,15 @@
refreshFirstDiffPage();