From af61142b0d3dc46fb77f204f004ccd85c581f772 Mon Sep 17 00:00:00 2001 From: R-Hart80 Date: Tue, 14 Apr 2026 10:24:51 -0300 Subject: [PATCH] fix: preserve entity selection when navigating between viewer and editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. "Open Editor" in the viewer now appends ?classIri= when an entity is selected, so the editor restores the same selection on load. The editor already reads this param (classIri at page.tsx:54). 2. The "Back" link in the editor header is replaced with "Close Editor" (Eye icon) and also carries ?classIri= back to the viewer, so the selection survives the round-trip. 3. The ContinuousEditingToggle button is removed from the editor toolbar. The toggle duplicated the concept of "being in the editor" and its per-entity auto-enter logic is superseded by the viewer↔editor navigation now preserving selection explicitly. The underlying continuousEditing store preference is left in place for future use in settings. Closes #98 Co-Authored-By: Claude Sonnet 4.6 --- app/projects/[id]/editor/page.tsx | 8 +++----- app/projects/[id]/page.tsx | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/projects/[id]/editor/page.tsx b/app/projects/[id]/editor/page.tsx index f098c558..6933a404 100644 --- a/app/projects/[id]/editor/page.tsx +++ b/app/projects/[id]/editor/page.tsx @@ -12,7 +12,6 @@ import { CommitMessageDialog } from "@/components/editor/CommitMessageDialog"; import { AddEntityDialog, type NewEntityInfo } from "@/components/editor/AddEntityDialog"; import { useToast } from "@/lib/context/ToastContext"; import { ModeSwitcher } from "@/components/editor/ModeSwitcher"; -import { ContinuousEditingToggle } from "@/components/editor/ContinuousEditingToggle"; import { DeveloperEditorLayout } from "@/components/editor/developer/DeveloperEditorLayout"; import { StandardEditorLayout } from "@/components/editor/standard/StandardEditorLayout"; import { BranchSelector, RevisionHistoryPanel, HistoryButton } from "@/components/revision"; @@ -823,18 +822,17 @@ export default function EditorPage() {
- - Back + + Close Editor

{project.name}

{totalClasses} classes {/* Mode Switcher */} - {canSuggest && } {/* Suggestion mode indicator */} {isSuggestionMode && ( diff --git a/app/projects/[id]/page.tsx b/app/projects/[id]/page.tsx index 490ad2a0..5d755474 100644 --- a/app/projects/[id]/page.tsx +++ b/app/projects/[id]/page.tsx @@ -258,7 +258,7 @@ function ViewerContent({ {/* Open Editor / Sign In */} {canSuggest ? ( - +