Skip to content

fix: preserve entity selection when navigating between viewer and editor#152

Closed
R-Hart80 wants to merge 1 commit into
CatholicOS:devfrom
R-Hart80:fix/preserve-entity-selection-navigation
Closed

fix: preserve entity selection when navigating between viewer and editor#152
R-Hart80 wants to merge 1 commit into
CatholicOS:devfrom
R-Hart80:fix/preserve-entity-selection-navigation

Conversation

@R-Hart80
Copy link
Copy Markdown
Contributor

Closes #98

Summary

  • Viewer → Editor: The "Open Editor" button now appends ?classIri=<encoded> when an entity is selected. The editor already reads this param to restore the selected node on load.
  • Editor → Viewer: The "Back" link is replaced with a "Close Editor" button (Eye icon) that navigates to /projects/{id}?classIri=<encoded>, so the viewer restores the same selection on return.
  • ContinuousEditingToggle removed from the editor toolbar: the toggle duplicated what the viewer↔editor navigation now handles explicitly. The underlying continuousEditing store preference is preserved for future use in settings.

What was NOT changed

Items 4 and 5 from the issue (repurposing continuousEditing as a default-open-in-editor preference, and simplifying detail panel edit state) are left for a follow-up — they touch ClassDetailPanel, PropertyDetailPanel, IndividualDetailPanel, and the store, which carries more risk and warrants its own PR.

Test plan

  • Open a project in the viewer and select a class/property/individual
  • Click Open Editor — verify the same entity is selected in the editor
  • Change the selection in the editor, then click Close Editor — verify the viewer opens with that entity selected
  • Open a project with no selection and click Open Editor — verify the editor opens without forcing a selection (no classIri param in the URL)
  • Verify the ContinuousEditingToggle button no longer appears in the editor toolbar

🤖 Generated with Claude Code

1. "Open Editor" in the viewer now appends ?classIri=<encoded> 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=<encoded> 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 CatholicOS#98

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@R-Hart80 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 38 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 50 minutes and 38 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 947c20c0-0e07-4fb8-800a-9f959ab183ed

📥 Commits

Reviewing files that changed from the base of the PR and between 4d28f68 and af61142.

📒 Files selected for processing (2)
  • app/projects/[id]/editor/page.tsx
  • app/projects/[id]/page.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JohnRDOrazio JohnRDOrazio added the bug Something isn't working label Apr 20, 2026
@JohnRDOrazio
Copy link
Copy Markdown
Member

Closing as duplicate of #104, which addresses the same issue (#98) with a broader scope (also implements item 6 — auto-enter edit mode in detail panels — and removes the now-orphaned ContinuousEditingToggle component and test). The remaining gaps in #104 (preserving the user preference per issue items 4-5, plus a small cleanup) are being folded into #104 directly. Thanks for the contribution!

JohnRDOrazio added a commit that referenced this pull request Apr 28, 2026
Restore the persisted preference that was previously named "continuousEditing"
under the new name "preferEditMode" with the semantics issue #98 calls for:
"open ontology in edit mode by default" rather than the redundant per-entity
toggle the old name implied.

- Re-add preferEditMode + setPreferEditMode to editorModeStore (default false).
- Replace the unconditional !!onUpdate* auto-enter trigger in ClassDetailPanel,
  PropertyDetailPanel, and IndividualDetailPanel with a check against
  preferEditMode, so users opt in to skipping the "Edit Item" click.
- Surface the preference as a toggle in app/settings (User Settings →
  Editor Preferences) using the Pencil icon.
- Drop a stray blank line left where the ContinuousEditingToggle import was
  removed from app/projects/[id]/editor/page.tsx.
- Update detail panel test mocks to default preferEditMode: true (matching
  the editor-context behavior they exercise) and add explicit gating tests
  that assert no auto-enter when preferEditMode is off.
- Cover the new field/setter in editorModeStore tests.

Closes the items 4 and 5 gap from issue #98 that the original PR #104 had
deferred. PR #152 is being closed as a duplicate of this one.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve entity selection across viewer/editor and unify continuous editing

2 participants