Fix scan/guide visibility with per-project preferences

- Store showScans/showGuides preferences per project so toggling
  persists when switching between projects
- Apply showGuides/showScans directly on guide and scan renderer groups
- Set projectId in both editor and viewer pages on mount

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Aymeric Rabot
2026-02-27 01:38:10 -05:00
co-authored by Claude Opus 4.6
parent d0e0fe7e1e
commit 31c09bacdd
5 changed files with 58 additions and 5 deletions
+4
View File
@@ -28,6 +28,10 @@ export default function ViewerPage() {
const [canShowGuides, setCanShowGuides] = useState(true)
const setScene = useScene((state) => state.setScene)
useEffect(() => {
useViewer.getState().setProjectId(projectId)
}, [projectId])
useEffect(() => {
const loadContent = async () => {
try {
+8
View File
@@ -71,6 +71,14 @@ export default function Editor({ projectId }: EditorProps) {
const isSceneLoading = useProjectStore((state) => state.isSceneLoading)
const isLoading = isProjectLoading || isSceneLoading
useEffect(() => {
if (projectId) {
useViewer.getState().setProjectId(projectId)
} else {
useViewer.getState().setProjectId(null)
}
}, [projectId])
useEffect(() => {
document.body.classList.add('dark')
return () => {