Repository navigation
Add lattice-scholar-extension extension - #27132
Conversation
- Add configurable API port, status command, and docs for alias/hotkey - Update raycast-extension/src/lattice-search.tsx - Remove \'Open in Lattice\' feature from README and Chinese docs - Add Chinese documentation and link from README - Add Raycast extension for Lattice literature search - update localAPI docs - Point Word add-in docs to new release repo - Initial import of Lattice plugins
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Raycast extension (“Lattice Scholar Extension”) to search and view details from a local Lattice API, including copy actions for citation data.
Changes:
- Introduces two Raycast commands: literature search and API connection status.
- Adds project configuration (TypeScript, ESLint, Prettier) and extension metadata.
- Adds end-user documentation (English + Chinese), plus changelog and agent guidance docs.
Reviewed changes
Copilot reviewed 12 out of 20 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/lattice-scholar-extension/tsconfig.json | TypeScript configuration for the new extension. |
| extensions/lattice-scholar-extension/src/lattice-status.tsx | Implements a status/health-check command for the Lattice local API. |
| extensions/lattice-scholar-extension/src/lattice-search.tsx | Implements search, detail view, and clipboard actions for papers. |
| extensions/lattice-scholar-extension/package.json | Declares extension metadata, preferences, commands, and dependencies. |
| extensions/lattice-scholar-extension/eslint.config.js | Adds ESLint configuration using Raycast’s shared config. |
| extensions/lattice-scholar-extension/README.md | English documentation and screenshots. |
| extensions/lattice-scholar-extension/README.zh-CN.md | Chinese documentation and screenshots. |
| extensions/lattice-scholar-extension/CHANGELOG.md | Initial changelog entry for v0.1.0. |
| extensions/lattice-scholar-extension/AGENTS.md | Agent/developer guidance for working on the extension. |
| extensions/lattice-scholar-extension/CLAUDE.md | Additional agent guidance file (currently duplicates/mislabels). |
| extensions/lattice-scholar-extension/.prettierrc | Prettier configuration. |
| extensions/lattice-scholar-extension/.gitignore | Extension-local ignore rules. |
| if (error) { | ||
| showToast({ style: Toast.Style.Failure, title: "Lattice not reachable", message: error.message }); | ||
| } |
There was a problem hiding this comment.
Calling showToast(...) during render will fire on every re-render while error is set, which can spam toasts. Move this side-effect into a useEffect keyed on error (and optionally dedupe by message) so it only triggers when the error changes.
| if (error) { | ||
| showToast({ style: Toast.Style.Failure, title: "Failed to load paper", message: error.message }); | ||
| } |
There was a problem hiding this comment.
This toast is triggered during render and will repeat on re-renders while error exists. Use a useEffect tied to error to avoid repeated toasts and keep render side-effect free.
| export default function Command() { | ||
| const [query, setQuery] = useState(""); | ||
| const [selectedId, setSelectedId] = useState<string | null>(null); |
There was a problem hiding this comment.
Replacing the entire command UI with return <PaperDetail .../> removes Raycast’s built-in navigation stack, so the user may have no obvious way to go back to the results list. Prefer Action.Push to push a detail view (or add an explicit 'Back to Results' action that clears selectedId) so navigation is predictable.
| if (selectedId) { | ||
| return <PaperDetail id={selectedId} />; | ||
| } |
There was a problem hiding this comment.
Replacing the entire command UI with return <PaperDetail .../> removes Raycast’s built-in navigation stack, so the user may have no obvious way to go back to the results list. Prefer Action.Push to push a detail view (or add an explicit 'Back to Results' action that clears selectedId) so navigation is predictable.
| accessories={[{ text: item.citekey }]} | ||
| actions={ | ||
| <ActionPanel> | ||
| <Action title="View Details" onAction={() => setSelectedId(item.id)} /> |
There was a problem hiding this comment.
Replacing the entire command UI with return <PaperDetail .../> removes Raycast’s built-in navigation stack, so the user may have no obvious way to go back to the results list. Prefer Action.Push to push a detail view (or add an explicit 'Back to Results' action that clears selectedId) so navigation is predictable.
| const { port } = getPreferenceValues<{ port: string }>(); | ||
| const BASE = `http://127.0.0.1:${port || "52731"}/api/v1`; |
There was a problem hiding this comment.
BASE construction is duplicated in multiple commands, which makes future changes (host, path, default port behavior) easy to miss. Consider extracting a small shared helper (e.g., src/api.ts) to build the base URL once and reuse it across commands.
| const { port } = getPreferenceValues<{ port: string }>(); | |
| const BASE = `http://127.0.0.1:${port || "52731"}/api/v1`; | |
| function getBaseUrl(port?: string): string { | |
| return `http://127.0.0.1:${port || "52731"}/api/v1`; | |
| } | |
| const { port } = getPreferenceValues<{ port: string }>(); | |
| const BASE = getBaseUrl(port); |
| @@ -0,0 +1,12 @@ | |||
| # Lattice Scholar Changelog | |||
|
|
|||
| ## [0.1.0] - {PR_MERGE_DATE} | |||
There was a problem hiding this comment.
The changelog uses a {PR_MERGE_DATE} placeholder; this should be replaced with an actual date before merging/publishing so the changelog is valid and user-facing.
| ## [0.1.0] - {PR_MERGE_DATE} | |
| ## [0.1.0] - 2026-04-13 |
| # AGENTS.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
There was a problem hiding this comment.
File name/content mismatch: CLAUDE.md starts with the heading # AGENTS.md and appears to duplicate AGENTS.md. Please either (a) rename/remove one of these files, or (b) update CLAUDE.md to have the correct title and distinct content to avoid confusion for contributors/tools.
| # AGENTS.md | |
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | |
| # CLAUDE.md | |
| This file provides Claude Code (claude.ai/code)-specific guidance for working with the code in this repository. |
|
|
||
| ## Usage | ||
|
|
||
| 1. Open Raycast and run **Lattice Search** |
There was a problem hiding this comment.
Docs refer to the command as Lattice Search, but package.json registers the command title as Search Literature. Align the README with the actual command title users will see in Raycast to reduce confusion.
| 1. Open Raycast and run **Lattice Search** | |
| 1. Open Raycast and run **Search Literature** |
| const body = fields | ||
| .filter(([, v]) => v) | ||
| .map(([k, v]) => ` ${k} = {${v}}`) | ||
| .join(",\n"); |
There was a problem hiding this comment.
The BibTeX generator interpolates raw field values without escaping characters that can break BibTeX syntax (notably } and potentially newlines). Consider escaping/normalizing field values (and/or wrapping with additional braces/encoding) before interpolation so copied entries remain valid for a wider range of titles/authors.
Greptile SummaryAdds a new Raycast extension for the Lattice Scholar reference manager, providing three commands: full-text library search with multi-format citation export, a connection status checker, and a browser-based DOI detector that resolves metadata from CrossRef and arXiv. The implementation is clean and well-structured with only two minor P2 findings. Confidence Score: 5/5Safe to merge; only P2 findings present. Both findings are P2: a changelog date placeholder and a defensive style-injection edge case. No logic errors, security issues, or breaking API misuses were found. CHANGELOG.md (missing {PR_MERGE_DATE} on top entry), export-clipboard.ts (style injection regex) Important Files Changed
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
extensions/lattice-scholar-extension/CHANGELOG.md:3
The newest entry introduced in this PR should use the `{PR_MERGE_DATE}` placeholder rather than a hardcoded date. Raycast automatically substitutes it with the actual merge date, which is the established convention for the top-of-file entry in each submitted PR.
```suggestion
## [0.4.1] - {PR_MERGE_DATE}
```
### Issue 2 of 2
extensions/lattice-scholar-extension/src/export-clipboard.ts:39-45
**Duplicate `style` attribute when element already has one**
The regex replaces only the tag-name portion (`<tagname`) and immediately appends `style="..."`. If the incoming HTML from `@citation-js/plugin-csl` already contains an element with its own `style` attribute, the result is a malformed string where the original attribute spills outside the tag. While current citation-js output for plain bibliography probably lacks inline styles, this will silently corrupt any element that does carry a `style` attribute.
Reviews (2): Last reviewed commit: "Update CHANGELOG.md and optimise images" | Re-trigger Greptile |
- Update screenshots to metadata dir and fix React hook violations - Update AGENTS.md and CHANGELOG.md for v0.2.0 - update readme - Merge pull request raycast#1 from frank-miao/feature/raycast-extension
- Remove unused export format helpers - Update raycast-extension/CHANGELOG.md - Fix search defaults and remove EndNote export - docs: sync readmes and agent guide - Integrate Citation-JS library for citation format conversion - Add CSL citation styles for multi-format bibliography export - Add clipboard export module with inline font styles and auto-close - Refactor export-formats.ts for improved type safety and maintainability - Replace CSL plugin with local citation formatter - Improve error handling and navigation in Raycast extension - Fix font stack generation for clipboard HTML output - Integrate Citation-JS for proper citation formatting and Word-compatible exports - Update screenshots and assets for extension polish - Update documentation for multi-format citation export - Add multi-format citation export (BibTeX, RIS, APA, MLA, etc.) - Add lattice-doi command documentation and cleanup - Add lattice-doi command and metadata module
pernielsentikaer
left a comment
There was a problem hiding this comment.
Looks good to me, approved 🔥
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Add a raycast extension to work with a new scholar app -- Lattice Scholar
This extension just uses the local API --- 127.0.0.1:<port> to manage literature.
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder