Conversation
Reviewer's GuideAdds a formal citation for the Corral project both on the marketing site and in the README, including a UI block with copy-to-clipboard behavior for the BibTeX entry. Sequence diagram for citation copy-to-clipboard interactionsequenceDiagram
actor User
participant Browser
participant CitationBlock as CitationBlockElement
participant CopyButton as CopyButtonElement
participant Clipboard as ClipboardAPI
User->>CopyButton: Click Copy
CopyButton->>Browser: onclick handler invoked
Browser->>CitationBlock: getElementById citation-block
CitationBlock-->>Browser: Return citation text
Browser->>Clipboard: writeText(citationText)
Clipboard-->>Browser: Promise resolved
Browser->>CopyButton: Update innerHTML to Copied! state
Browser->>Browser: setTimeout 2000ms
Browser-->>Browser: Timeout triggers
Browser->>CopyButton: Restore original innerHTML
Flow diagram for citation copy button behaviorflowchart TD
A[Click Copy button] --> B[Invoke onclick handler]
B --> C[Get element by id citation-block]
C --> D[Read innerText as citationText]
D --> E["Call navigator.clipboard.writeText(citationText)"]
E --> F{Write successful?}
F -- Yes --> G[Store original button innerHTML]
G --> H[Set button innerHTML to Copied! icon and label]
H --> I[setTimeout 2000ms]
I --> J[Restore original button innerHTML]
F -- No --> K[Do nothing further in current implementation]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughBoth README.md and site/index.html receive new "Citation" sections providing BibTeX citation metadata for arXiv preprint 2604.18805. The website version includes a copy-to-clipboard button with transient UI feedback. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Hey - I've found 1 issue, and left some high level feedback:
- The inline
onclickhandler relies on a globaleventobject (event.currentTarget), which may not be available in all browsers/strict modes; consider passing the event explicitly or attaching the handler via JavaScript instead of an inline attribute. - To improve maintainability, consider moving the copy-to-clipboard logic out of the HTML
onclickattribute into a dedicated script block or JS module, and referencing the button by an ID or data attribute.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The inline `onclick` handler relies on a global `event` object (`event.currentTarget`), which may not be available in all browsers/strict modes; consider passing the event explicitly or attaching the handler via JavaScript instead of an inline attribute.
- To improve maintainability, consider moving the copy-to-clipboard logic out of the HTML `onclick` attribute into a dedicated script block or JS module, and referencing the button by an ID or data attribute.
## Individual Comments
### Comment 1
<location path="site/index.html" line_range="644" />
<code_context>
+ year = {2026},
+ journal = {arXiv preprint arXiv: 2604.18805}
+}</pre>
+ <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()"
+ class="absolute top-3 right-3 flex items-center gap-1.5 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 text-xs font-medium rounded-lg transition-colors duration-150">
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
</code_context>
<issue_to_address>
**issue:** Add error handling and a fallback for `navigator.clipboard` usage.
This relies on `navigator.clipboard.writeText` always existing and succeeding. In non-secure contexts or older browsers it may be undefined or reject, leaving the UI unchanged with no feedback. Please feature-detect `navigator.clipboard`, handle promise rejections, and consider a simple fallback (e.g., hidden textarea + `document.execCommand('copy')`) for better degradation.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| year = {2026}, | ||
| journal = {arXiv preprint arXiv: 2604.18805} | ||
| }</pre> | ||
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" |
There was a problem hiding this comment.
issue: Add error handling and a fallback for navigator.clipboard usage.
This relies on navigator.clipboard.writeText always existing and succeeding. In non-secure contexts or older browsers it may be undefined or reject, leaving the UI unchanged with no feedback. Please feature-detect navigator.clipboard, handle promise rejections, and consider a simple fallback (e.g., hidden textarea + document.execCommand('copy')) for better degradation.
There was a problem hiding this comment.
Pull request overview
Adds a formal citation reference for Corral in both the project landing page and the repository README.
Changes:
- Add a “Cite this work” section to
site/index.html, including a copy-to-clipboard button for the BibTeX entry. - Add a “Citation” section to
README.mdwith the same BibTeX entry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| site/index.html | Adds a citation section and a copy-to-clipboard interaction on the website landing page. |
| README.md | Documents the recommended BibTeX citation for academic use. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| title = {AI scientists produce results without reasoning scientifically}, | ||
| author = {Martiño Ríos-García and Nawaf Alampara and Chandan Gupta and Indrajeet Mandal and Sajid Mannan and Ali Asghar Aghajani and N. M. Anoop Krishnan and Kevin Maik Jablonka}, | ||
| year = {2026}, | ||
| journal = {arXiv preprint arXiv: 2604.18805} |
There was a problem hiding this comment.
The BibTeX journal field includes arXiv: 2604.18805 with a space after the colon; many citation styles/tools expect the identifier without the space (e.g., arXiv:2604.18805). Consider removing the extra space (and optionally using standard arXiv BibTeX fields like eprint/archivePrefix).
| journal = {arXiv preprint arXiv: 2604.18805} | |
| journal = {arXiv preprint arXiv:2604.18805} |
| title = {AI scientists produce results without reasoning scientifically}, | ||
| author = {Martiño Ríos-García and Nawaf Alampara and Chandan Gupta and Indrajeet Mandal and Sajid Mannan and Ali Asghar Aghajani and N. M. Anoop Krishnan and Kevin Maik Jablonka}, | ||
| year = {2026}, | ||
| journal = {arXiv preprint arXiv: 2604.18805} |
There was a problem hiding this comment.
The BibTeX journal field contains arXiv: 2604.18805 with a space after the colon; many BibTeX consumers expect arXiv:2604.18805 (no space). Consider removing the extra space (and optionally using eprint/archivePrefix fields for arXiv).
| journal = {arXiv preprint arXiv: 2604.18805} | |
| journal = {arXiv preprint arXiv:2604.18805} |
| year = {2026}, | ||
| journal = {arXiv preprint arXiv: 2604.18805} | ||
| }</pre> | ||
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" |
There was a problem hiding this comment.
The inline click handler relies on a global event (event.currentTarget). event is not reliably available across browsers in inline handlers, which can break the copy button at runtime. Pass the element explicitly (e.g., via this) or use an event parameter via an addEventListener/Alpine @click handler so the current target is well-defined.
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" | |
| <button onclick="(function(btn){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})(this)" |
| year = {2026}, | ||
| journal = {arXiv preprint arXiv: 2604.18805} | ||
| }</pre> | ||
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" |
There was a problem hiding this comment.
navigator.clipboard.writeText(...) can reject (non-secure context, permissions, unsupported browser). The promise chain here has no .catch, so failures will be silent and can create unhandled rejections. Add error handling and consider a small user-visible failure state (and/or a fallback copy method) to make this resilient.
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" | |
| <button onclick="(function(btn){const el=document.getElementById('citation-block');const text=el.innerText;const orig=btn.innerHTML;const showStatus=function(message){btn.innerHTML=message;setTimeout(function(){btn.innerHTML=orig;},2000);};const showCopied=function(){showStatus('<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>');};const showFailed=function(){showStatus('<span>Copy failed</span>');};const fallbackCopy=function(){const textarea=document.createElement('textarea');textarea.value=text;textarea.setAttribute('readonly','');textarea.style.position='fixed';textarea.style.opacity='0';document.body.appendChild(textarea);textarea.focus();textarea.select();try{if(document.execCommand('copy')){showCopied();}else{showFailed();}}catch(e){showFailed();}document.body.removeChild(textarea);};if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(text).then(function(){showCopied();}).catch(function(){fallbackCopy();});}else{fallbackCopy();}})(this)" |
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" | ||
| class="absolute top-3 right-3 flex items-center gap-1.5 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 text-xs font-medium rounded-lg transition-colors duration-150"> | ||
| <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | ||
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | ||
| d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /> | ||
| </svg> | ||
| <span>Copy</span> |
There was a problem hiding this comment.
This file consistently uses Alpine event bindings like @click elsewhere (e.g., site/index.html:575). Introducing a one-off inline onclick handler makes behavior harder to maintain and bypasses the established pattern. Consider converting this to an Alpine @click handler (or a JS function in annotator.js) to keep event handling consistent.
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" | |
| class="absolute top-3 right-3 flex items-center gap-1.5 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 text-xs font-medium rounded-lg transition-colors duration-150"> | |
| <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | |
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | |
| d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /> | |
| </svg> | |
| <span>Copy</span> | |
| <button x-data="{ copied: false }" | |
| @click="navigator.clipboard.writeText(document.getElementById('citation-block').innerText).then(() => { copied = true; setTimeout(() => { copied = false }, 2000) })" | |
| class="absolute top-3 right-3 flex items-center gap-1.5 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 text-xs font-medium rounded-lg transition-colors duration-150"> | |
| <template x-if="!copied"> | |
| <span class="flex items-center gap-1.5"> | |
| <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | |
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | |
| d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /> | |
| </svg> | |
| <span>Copy</span> | |
| </span> | |
| </template> | |
| <template x-if="copied"> | |
| <span class="flex items-center gap-1.5"> | |
| <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | |
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /> | |
| </svg> | |
| <span>Copied!</span> | |
| </span> | |
| </template> |
| year = {2026}, | ||
| journal = {arXiv preprint arXiv: 2604.18805} | ||
| }</pre> | ||
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" |
There was a problem hiding this comment.
Using innerText to read the <pre> contents can normalize whitespace/newlines and forces layout; for copying exact BibTeX, textContent is typically more reliable and avoids the layout dependency.
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.innerText).then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" | |
| <button onclick="(function(){const el=document.getElementById('citation-block');navigator.clipboard.writeText(el.textContent || '').then(function(){const btn=event.currentTarget;const orig=btn.innerHTML;btn.innerHTML='<svg class=\'w-4 h-4\' fill=\'none\' stroke=\'currentColor\' viewBox=\'0 0 24 24\'><path stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 13l4 4L19 7\'/></svg><span>Copied!</span>';setTimeout(function(){btn.innerHTML=orig;},2000);})})()" |
Summary by Sourcery
Add citation information for Corral to both the website and the README.
New Features:
Documentation:
Summary by CodeRabbit
Documentation
New Features