Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📝 WalkthroughWalkthroughReplaces 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
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)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
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>
There was a problem hiding this comment.
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
📒 Files selected for processing (10)
README.mdapp/settings/page.tsxcomponents/editor/AutoSaveAffordanceBar.tsxcomponents/editor/AutoSaveStatusBar.tsxcomponents/editor/ClassDetailPanel.tsxcomponents/editor/IndividualDetailPanel.tsxcomponents/editor/PropertyDetailPanel.tsxlib/hooks/useAutoSave.tslib/hooks/useEntityAutoSave.tslib/stores/editorModeStore.ts
💤 Files with no reviewable changes (1)
- components/editor/AutoSaveStatusBar.tsx
| <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> |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
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.
| 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; | ||
|
|
There was a problem hiding this comment.
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.
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>
|
Suggestion: Separate concerns in this PR This PR mixes two unrelated changes:
Would you consider cherry-picking the auto-save changes to PR #7 ("Add explicit Save button to detail panel edit mode")? This would:
Feel free to reach out if you'd like help coordinating the cherry-pick! |
Summary
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
New Features / UI