Problem
Three related UX issues in the viewer ↔ editor navigation flow:
-
"Open Editor" loses selection — Clicking "Open Editor" on the viewer page (/projects/{id}) navigates to /projects/{id}/editor without passing the classIri query parameter, so the currently viewed class/property/individual is lost and no entity is selected in the editor.
-
No "Close Editor" to return to viewer — Once in the editor, there is no obvious way to return to the read-only viewer with the current selection preserved. The user must manually navigate back.
-
"Continuous editing" toggle is redundant — The continuous editing mode (auto-enter edit mode on class selection) is functionally identical to simply being "in the editor". Meanwhile, the existing continuousEditing user preference could serve a better purpose: controlling whether the ontology opens in view mode or edit mode by default.
Current Implementation
| Component |
File |
Issue |
| "Open Editor" button |
app/projects/[id]/page.tsx:259-266 |
<Link href={/projects/${projectId}/editor}> — no classIri param |
ContinuousEditingToggle |
components/editor/ContinuousEditingToggle.tsx |
Separate toggle that duplicates what "being in the editor" already means |
continuousEditing preference |
lib/stores/editorModeStore.ts:43 |
Stored in localStorage via zustand persist; defaults to false |
| URL param restoration |
app/projects/[id]/editor/page.tsx:92-96 |
Already supports classIri param — just not passed by "Open Editor" |
| Auto-enter edit logic |
components/editor/ClassDetailPanel.tsx:205-229 |
Checks continuousEditing to auto-enter edit mode on class selection |
Proposed Changes
1. Pass selected entity IRI when navigating to editor
In app/projects/[id]/page.tsx, update the "Open Editor" link to include the current selection:
<Link href={`/projects/${projectId}/editor${selectedIri ? `?classIri=${encodeURIComponent(selectedIri)}` : ''}`}>
The editor page already handles classIri restoration (lines 92-96), so this is essentially a one-line fix.
2. Replace "Open Editor" with a toggle: "Open Editor" / "Close Editor"
- In the viewer (
/projects/{id}): keep the "Open Editor" button as-is (with the fix from step 1)
- In the editor (
/projects/{id}/editor): add a "Close Editor" button that navigates back to /projects/{id} with the classIri param preserved
- Both buttons should use the
Pencil / Eye icons to clearly indicate the mode switch
3. Remove the ContinuousEditingToggle button from the editor toolbar
Delete components/editor/ContinuousEditingToggle.tsx and remove its usage from the editor page toolbar (line 837 in app/projects/[id]/editor/page.tsx).
4. Repurpose the continuousEditing preference
Rename or redefine the continuousEditing preference to mean: "open ontology in edit mode by default" (for users with edit capabilities).
- If
true: navigating to a project opens the editor page directly (or the viewer auto-redirects to editor)
- If
false (default): navigating to a project opens the read-only viewer
- Move the toggle to user/project settings rather than a toolbar button
- The existing
ClassDetailPanel auto-enter logic can be simplified: when in the editor, the user is always in edit mode for the selected entity (no need to check continuousEditing per-entity)
5. Simplify detail panel edit state management
Since being in the editor now implies edit mode:
ClassDetailPanel, PropertyDetailPanel, IndividualDetailPanel can default isEditing = true when in the editor context
- The per-entity "Edit" button in the detail panels becomes unnecessary in editor mode (but remains useful if we keep a read-only preview somewhere)
cancelledIriRef tracking can be removed
Acceptance Criteria
Notes
- The
classIri URL param mechanism already works in both the viewer and editor pages, so preserving selection is straightforward
- The
editorMode ("standard" vs "developer") is a separate concept and should not be affected
- Suggestion mode behavior should be preserved as-is
Problem
Three related UX issues in the viewer ↔ editor navigation flow:
"Open Editor" loses selection — Clicking "Open Editor" on the viewer page (
/projects/{id}) navigates to/projects/{id}/editorwithout passing theclassIriquery parameter, so the currently viewed class/property/individual is lost and no entity is selected in the editor.No "Close Editor" to return to viewer — Once in the editor, there is no obvious way to return to the read-only viewer with the current selection preserved. The user must manually navigate back.
"Continuous editing" toggle is redundant — The continuous editing mode (auto-enter edit mode on class selection) is functionally identical to simply being "in the editor". Meanwhile, the existing
continuousEditinguser preference could serve a better purpose: controlling whether the ontology opens in view mode or edit mode by default.Current Implementation
app/projects/[id]/page.tsx:259-266<Link href={/projects/${projectId}/editor}>— noclassIriparamContinuousEditingTogglecomponents/editor/ContinuousEditingToggle.tsxcontinuousEditingpreferencelib/stores/editorModeStore.ts:43falseapp/projects/[id]/editor/page.tsx:92-96classIriparam — just not passed by "Open Editor"components/editor/ClassDetailPanel.tsx:205-229continuousEditingto auto-enter edit mode on class selectionProposed Changes
1. Pass selected entity IRI when navigating to editor
In
app/projects/[id]/page.tsx, update the "Open Editor" link to include the current selection:The editor page already handles
classIrirestoration (lines 92-96), so this is essentially a one-line fix.2. Replace "Open Editor" with a toggle: "Open Editor" / "Close Editor"
/projects/{id}): keep the "Open Editor" button as-is (with the fix from step 1)/projects/{id}/editor): add a "Close Editor" button that navigates back to/projects/{id}with theclassIriparam preservedPencil/Eyeicons to clearly indicate the mode switch3. Remove the
ContinuousEditingTogglebutton from the editor toolbarDelete
components/editor/ContinuousEditingToggle.tsxand remove its usage from the editor page toolbar (line 837 inapp/projects/[id]/editor/page.tsx).4. Repurpose the
continuousEditingpreferenceRename or redefine the
continuousEditingpreference to mean: "open ontology in edit mode by default" (for users with edit capabilities).true: navigating to a project opens the editor page directly (or the viewer auto-redirects to editor)false(default): navigating to a project opens the read-only viewerClassDetailPanelauto-enter logic can be simplified: when in the editor, the user is always in edit mode for the selected entity (no need to checkcontinuousEditingper-entity)5. Simplify detail panel edit state management
Since being in the editor now implies edit mode:
ClassDetailPanel,PropertyDetailPanel,IndividualDetailPanelcan defaultisEditing = truewhen in the editor contextcancelledIriReftracking can be removedAcceptance Criteria
ContinuousEditingTogglebutton is removed from the editor toolbarcontinuousEditinguser preference determines whether ontologies open in view or edit mode by defaultNotes
classIriURL param mechanism already works in both the viewer and editor pages, so preserving selection is straightforwardeditorMode("standard"vs"developer") is a separate concept and should not be affected