Python
Merge pull request #500 from wgu9/fix/right-rail-stale-artifact-responses
Rohit Prasade462c690436d
diff --cc surfaces/gui/src/components/RightRail.tsxindex c5abd3ee,96774c81..892cc9a0--- a/surfaces/gui/src/components/RightRail.tsx+++ b/surfaces/gui/src/components/RightRail.tsx@@@ -187,20 -207,18 +235,18 @@@ export function RightRail(setJournal([]);return;}- getJournalCases().then(setJournal).catch(() => setJournal([]));+ getJournalCases(sessionId).then(setJournal).catch(() => setJournal([]));}, [active, sessionId, refreshKey, board?.space]);- // Switching conversations closes any open artifact — it belongs to the previous session's- // workspace, which the new session can't (and shouldn't) read.useEffect(() => {- setSelected(null);- setContent(null);- }, [sessionId]);-- useEffect(() => {- setContent(null);- if (!selected) return;- readArtifact(sessionId, selected.path).then(setContent).catch(() => setContent(null));+ if (selected) loadArtifactContent(selected);+ else {+ artifactContentRequest.current += 1;+ setContent(null);+ }+ return () => {+ artifactContentRequest.current += 1;+ };}, [selected?.path, sessionId]);// Notify the app when a preview opens/closes (drives the left-nav auto-collapse).