File: packages/gui/src/App.tsx:68
Severity: Medium
Description:
selectedArtifact fallback to artifacts[0] when selectedArtifactId not found causes selection to jump unexpectedly when artifact list updates.
Code:
const selectedArtifact = artifacts.find((artifact) => artifact.id === selectedArtifactId) || artifacts[0];
Failure Scenario:
- User selects artifact with id='artifact-5'
- Backend updates artifacts array (new artifact added at beginning or order changed)
- selectedArtifactId becomes stale (old artifact removed)
- useMemo returns artifacts[0] instead of null/undefined
- UI jumps to different artifact without user action
- User sees wrong artifact preview, confusion ensues
Suggested Fix:
Return null/undefined when selectedArtifactId not found, show empty state or keep last valid selection until user explicitly chooses new one.
File: packages/gui/src/App.tsx:68
Severity: Medium
Description:
selectedArtifact fallback to artifacts[0] when selectedArtifactId not found causes selection to jump unexpectedly when artifact list updates.
Code:
Failure Scenario:
Suggested Fix:
Return null/undefined when selectedArtifactId not found, show empty state or keep last valid selection until user explicitly chooses new one.