Skip to content

Add Genesis section to README#22

Open
damienriehl wants to merge 5 commits intomainfrom
release/v0.2.0
Open

Add Genesis section to README#22
damienriehl wants to merge 5 commits intomainfrom
release/v0.2.0

Conversation

@damienriehl
Copy link
Contributor

@damienriehl damienriehl commented Mar 14, 2026

Summary

  • Adds a "Genesis" section to the README explaining OntoKit's origin as a collaboration between FOLIO and Catholic Semantic Canon
  • Links to both projects' websites and GitHub repos
  • Describes the shared need for grassroots collaborative ontology editing

Test plan

  • Verify README renders correctly on GitHub
  • Confirm all four links (2 websites, 2 repos) resolve correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • README updated with a new "Genesis" section describing project origins and links to related initiatives.
  • New Features / UI

    • Added a Manual Save toggle in Settings.
    • Replaced the bottom status bar with a pinned editing toolbar showing save/status and Manual Save, Retry, and Cancel controls.
    • Headers with IRI/Source actions are now pinned for a consistent editing experience.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Warning

Rate limit exceeded

@damienriehl has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 49 seconds before requesting another review.

⌛ 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: 7b76d397-ae9b-426a-9267-ec86f613a586

📥 Commits

Reviewing files that changed from the base of the PR and between be2134e and b6c3ee3.

📒 Files selected for processing (1)
  • public/.gitkeep
📝 Walkthrough

Walkthrough

Replaces AutoSaveStatusBar with a new AutoSaveAffordanceBar across detail panels, adds a manual-save toggle in settings and editorModeStore, changes flushToGit return types to Promise in autosave hooks, and inserts a “Genesis” section into README.md.

Changes

Cohort / File(s) Summary
Documentation
README.md
Inserted a new "Genesis" section describing OntoKit origins (FOLIO, Catholic Semantic Canon) and updated the intro punctuation.
New autosave UI component
components/editor/AutoSaveAffordanceBar.tsx
Added a client-side autosave affordance component with status variants, retry/manual-save/cancel handlers, accessibility attributes, and editorModeStore integration.
Removed component
components/editor/AutoSaveStatusBar.tsx
Removed the previous AutoSaveStatusBar and its rendering logic.
Detail panels (UI integration)
components/editor/ClassDetailPanel.tsx, components/editor/IndividualDetailPanel.tsx, components/editor/PropertyDetailPanel.tsx
Replaced AutoSaveStatusBar with AutoSaveAffordanceBar; made headers pinned/always-visible; added saveAndExitEditMode wiring (manual save → flush → exit edit); adjusted layout and header actions.
Editor settings
app/settings/page.tsx
Added Save icon import and a Manual Save toggle that reads/writes manualSave from editorModeStore with accessible labelling and visual state.
Hooks & store
lib/hooks/useAutoSave.ts, lib/hooks/useEntityAutoSave.ts, lib/stores/editorModeStore.ts
Changed flushToGit return type from Promise<void> to Promise<boolean> across autosave hooks; added manualSave: boolean state and setManualSave(on: boolean) action to editorModeStore.
Config
next.config.ts
Added output: "standalone" to Next.js config.
Package manifest touched
package.json
Manifest reported modified (lines changed).

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant UI as AutoSaveAffordanceBar (Client UI)
  participant Store as EditorModeStore
  participant Hook as useAutoSave / useEntityAutoSave
  participant Git as Git/Backend

  User->>UI: trigger Manual Save / Edit actions
  UI->>Store: read/write manualSave
  UI->>Hook: call onManualSave / request flushToGit()
  Hook->>Git: flushToGit() -> returns boolean
  Git-->>Hook: success / failure
  Hook-->>UI: resolve success/failure
  UI-->>User: update status (Saved / Error, Retry/Cancel)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐇 I hopped through code with careful cheer,
A save button planted far and near,
Headers pinned and drafts held tight,
Flush to Git beneath the night,
Tiny paws applaud: "Edit on, my dear!"

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Genesis section to README' accurately reflects the main change in the changeset, which is the addition of a new Genesis section to the README file with origin information and external links.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release/v0.2.0
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 10: The README entry mixes two names; pick a single canonical name and
indicate the other as the host/site. Update the line that currently reads
"Catholic Semantic Canon (Catholic Digital Commons) — a structured
vocabulary..." to either use "Catholic Semantic Canon — a structured vocabulary
hosted on Catholic Digital Commons (https://catholicdigitalcommons.org/)..." or
"Catholic Digital Commons — Catholic Semantic Canon, a structured vocabulary..."
so that the terms "Catholic Semantic Canon" and "Catholic Digital Commons" are
clearly identified as the project name and the hosting organization/site
respectively.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1c5e6421-0708-4edd-8688-8fa6df190fea

📥 Commits

Reviewing files that changed from the base of the PR and between de9d701 and 7a97191.

📒 Files selected for processing (1)
  • README.md

OntoKit grew out of a collaboration between two open-source projects that share a common need: making rules and laws accessible through structured, community-driven ontologies.

- **[FOLIO](https://openlegalstandard.org/)** (Free Open Legal Information Ontology) — a structured vocabulary for governmental rules and laws ([GitHub](https://github.com/alea-institute/FOLIO/))
- **[Catholic Semantic Canon](https://catholicdigitalcommons.org/)** (Catholic Digital Commons) — a structured vocabulary for the rules and laws of faith ([GitHub](https://github.com/CatholicOS/ontology-semantic-canon))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify naming consistency for Catholic Semantic Canon.

Line 10 mixes “Catholic Semantic Canon” with “Catholic Digital Commons” in parentheses, which reads like two different names for one item. Consider using one canonical name (or explicitly stating one is the hosting org/site) to reduce ambiguity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 10, The README entry mixes two names; pick a single
canonical name and indicate the other as the host/site. Update the line that
currently reads "Catholic Semantic Canon (Catholic Digital Commons) — a
structured vocabulary..." to either use "Catholic Semantic Canon — a structured
vocabulary hosted on Catholic Digital Commons
(https://catholicdigitalcommons.org/)..." or "Catholic Digital Commons —
Catholic Semantic Canon, a structured vocabulary..." so that the terms "Catholic
Semantic Canon" and "Catholic Digital Commons" are clearly identified as the
project name and the hosting organization/site respectively.

damienriehl and others added 2 commits March 14, 2026 14:33
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the affordance bar from below the fold to a pinned toolbar between
the header and scrollable content. Cancel button moves from the header
into this toolbar, grouping all edit-mode controls (status, save, cancel)
together per the Gestalt proximity principle. Header is now pinned so
entity name and IRI are always visible.

Also includes: AutoSaveStatusBar → AutoSaveAffordanceBar rename,
manual save preference in editor mode store, and settings page updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/editor/ClassDetailPanel.tsx`:
- Around line 614-620: The Copy IRI button is icon-only and relies on title,
which is insufficient for some assistive tech; add an explicit accessible name
by including an aria-label (e.g., aria-label="Copy IRI") on the button that
invokes onCopyIri and references classDetail.iri, ensuring the button element
rendering the <Copy /> icon has the aria-label attribute so screen readers get a
clear name while keeping existing title and onClick behavior.

In `@lib/hooks/useAutoSave.ts`:
- Around line 145-155: flushToGit currently may commit a stale older draft if
the current in-memory edits fail validation; before proceeding in flushToGit
(and the similar flush blocks around the other draft-flush locations), run the
same validation/save step used by triggerSave (or call triggerSave and abort if
it returns a failing/false result) to ensure the current edits are valid and
persisted to storage, and only then read getDraft(draftKey(...)) and proceed to
commit; reference flushingRef, flushToGit, triggerSave, draftKey and getDraft
when adding this guard so the function returns false on validation failure and
does not commit the stale draft.

In `@lib/hooks/useEntityAutoSave.ts`:
- Around line 119-126: flushToGit currently proceeds with saving without
re-running validation, allowing stale/invalid drafts to be flushed; update
flushToGit to call the validation function stored in validateRef (e.g., await
validateRef.current?.()) at the start of the routine and abort returning false
if validation fails, and apply the same re-check in the secondary save path
around the block referenced at lines 137-144 so both branches verify validateRef
before reading draft and proceeding with onFlushRef.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2bac8132-aab5-4209-a3fb-8ad64894289e

📥 Commits

Reviewing files that changed from the base of the PR and between 7a97191 and 7e1cee6.

📒 Files selected for processing (10)
  • README.md
  • app/settings/page.tsx
  • components/editor/AutoSaveAffordanceBar.tsx
  • components/editor/AutoSaveStatusBar.tsx
  • components/editor/ClassDetailPanel.tsx
  • components/editor/IndividualDetailPanel.tsx
  • components/editor/PropertyDetailPanel.tsx
  • lib/hooks/useAutoSave.ts
  • lib/hooks/useEntityAutoSave.ts
  • lib/stores/editorModeStore.ts
💤 Files with no reviewable changes (1)
  • components/editor/AutoSaveStatusBar.tsx

Comment on lines +614 to +620
<button
onClick={() => onCopyIri(classDetail.iri)}
className="flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-300"
title="Copy IRI"
>
<Copy className="h-3 w-3" />
</button>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add an explicit accessible name to the icon-only copy button.

Line 614 renders an icon-only control. Relying on title alone is inconsistent for screen readers; add aria-label.

♿ Suggested fix
               {onCopyIri && (
                 <button
                   onClick={() => onCopyIri(classDetail.iri)}
+                  aria-label="Copy IRI"
                   className="flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-300"
                   title="Copy IRI"
                 >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/editor/ClassDetailPanel.tsx` around lines 614 - 620, The Copy IRI
button is icon-only and relies on title, which is insufficient for some
assistive tech; add an explicit accessible name by including an aria-label
(e.g., aria-label="Copy IRI") on the button that invokes onCopyIri and
references classDetail.iri, ensuring the button element rendering the <Copy />
icon has the aria-label attribute so screen readers get a clear name while
keeping existing title and onClick behavior.

Comment on lines +145 to +155
const flushToGit = useCallback(async (): Promise<boolean> => {
if (flushingRef.current) return false;
const canFlush = canEdit || saveMode === "suggest";
const hasHandler = saveMode === "suggest" ? !!onSuggestSave : !!onUpdateClass;
if (!classIri || !branch || !canFlush || !hasHandler) return;
if (!classIri || !branch || !canFlush || !hasHandler) return false;

const key = draftKey(projectId, branch, classIri);
const rawDraft = getDraft(key);
if (!rawDraft) return;
if (!rawDraft) return false;
// Only flush class drafts
if (rawDraft.entityType && rawDraft.entityType !== "class") return;
if (rawDraft.entityType && rawDraft.entityType !== "class") return false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Prevent stale draft commits when current edits are invalid.

triggerSave() can fail validation and leave an older draft in storage; flushToGit() then commits that stale draft and reports success. Add a current-edit validation guard before flushing.

💡 Suggested fix
   const flushToGit = useCallback(async (): Promise<boolean> => {
     if (flushingRef.current) return false;
+    const current = editStateRef.current;
+    if (current) {
+      const validCurrentLabels = current.labels.filter((l) => l.value.trim());
+      if (validCurrentLabels.length === 0) {
+        setValidationError("At least one label is required");
+        return false;
+      }
+      setValidationError(null);
+    }
     const canFlush = canEdit || saveMode === "suggest";
     const hasHandler = saveMode === "suggest" ? !!onSuggestSave : !!onUpdateClass;
     if (!classIri || !branch || !canFlush || !hasHandler) return false;

Also applies to: 181-185, 204-210

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/hooks/useAutoSave.ts` around lines 145 - 155, flushToGit currently may
commit a stale older draft if the current in-memory edits fail validation;
before proceeding in flushToGit (and the similar flush blocks around the other
draft-flush locations), run the same validation/save step used by triggerSave
(or call triggerSave and abort if it returns a failing/false result) to ensure
the current edits are valid and persisted to storage, and only then read
getDraft(draftKey(...)) and proceed to commit; reference flushingRef,
flushToGit, triggerSave, draftKey and getDraft when adding this guard so the
function returns false on validation failure and does not commit the stale
draft.

Comment on lines +119 to 126
const flushToGit = useCallback(async (): Promise<boolean> => {
if (flushingRef.current) return false;
if (!entityIri || !branch || !canEdit || !onFlushRef.current) return false;

const key = draftKey(projectId, branch, entityIri);
const draft = getDraft(key);
if (!draft) return;
if (!draft) return false;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Run validation inside flushToGit to avoid flushing stale drafts.

If validation fails in triggerSave, the old draft can still be flushed. Re-check validateRef at flush time and abort with false.

💡 Suggested fix
   const flushToGit = useCallback(async (): Promise<boolean> => {
     if (flushingRef.current) return false;
     if (!entityIri || !branch || !canEdit || !onFlushRef.current) return false;
+    const validationMsg = validateRef.current?.();
+    if (validationMsg) {
+      setValidationError(validationMsg);
+      return false;
+    }
+    setValidationError(null);

     const key = draftKey(projectId, branch, entityIri);
     const draft = getDraft(key);
     if (!draft) return false;

Also applies to: 137-144

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/hooks/useEntityAutoSave.ts` around lines 119 - 126, flushToGit currently
proceeds with saving without re-running validation, allowing stale/invalid
drafts to be flushed; update flushToGit to call the validation function stored
in validateRef (e.g., await validateRef.current?.()) at the start of the routine
and abort returning false if validation fails, and apply the same re-check in
the secondary save path around the block referenced at lines 137-144 so both
branches verify validateRef before reading draft and proceeding with onFlushRef.

damienriehl and others added 2 commits March 14, 2026 16:20
The Dockerfile copies .next/standalone but the Next.js config wasn't
producing it. Required for production container builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Dockerfile COPY step expects /app/public to exist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JohnRDOrazio
Copy link
Member

Suggestion: Separate concerns in this PR

This PR mixes two unrelated changes:

  1. README documentation (Genesis section) — the stated scope
  2. Auto-save affordance UI (AutoSaveAffordanceBar, AutoSaveStatusBar, related hooks/stores) — which belongs in the explicit Save button work

Would you consider cherry-picking the auto-save changes to PR #7 ("Add explicit Save button to detail panel edit mode")? This would:

  • Keep PR 22 focused: README documentation only
  • Keep PR 7 focused: Save button UX and auto-save affordance bar together
  • Make reviews and future history easier to understand

Feel free to reach out if you'd like help coordinating the cherry-pick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants