-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic editor #1
base: main
Are you sure you want to change the base?
basic editor #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Implements a basic Novel-based text editor with Tailwind styling and local storage persistence, featuring a clean UI with a collapsible sidebar and GitHub repository input.
- Configures Novel editor extensions in
/src/lib/extensions.ts
with comprehensive Tailwind styling for elements like code blocks, lists, and blockquotes - Implements local storage persistence in
/src/app/page.tsx
to maintain editor state between sessions - Adds minimal default content structure in
/src/lib/content.ts
with a single text paragraph - Pins Novel package to version 0.5.0 in
package.json
for stability - TODO comment in extensions.ts indicates need for Tailwind autocomplete improvement via regex
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
4 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile
@@ -0,0 +1,95 @@ | |||
/* From https://novel.sh/docs/guides/tailwind/extensions */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Attribution comment should be removed since this is now part of the project's source code
}, | ||
code: { | ||
HTMLAttributes: { | ||
class: cx("rounded-md bg-muted px-1.5 py-1 font-mono font-medium"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Extra space in class string between bg-muted and px-1.5
spellcheck: "false", | ||
}, | ||
}, | ||
horizontalRule: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: horizontalRule disabled here but added back as separate extension - consider using one approach for consistency
@@ -18,7 +18,7 @@ | |||
"clsx": "^2.1.1", | |||
"lucide-react": "^0.469.0", | |||
"next": "15.1.2", | |||
"novel": "^0.5.0", | |||
"novel": "0.5.0", | |||
"react": "^19.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: React v19 is not yet officially released. This could cause stability issues.
const content = window.localStorage.getItem("novel-content"); | ||
if (content) setInitialContent(JSON.parse(content)); | ||
else setInitialContent(defaultEditorContent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: JSON.parse() could throw if content is malformed. Wrap in try/catch to prevent runtime errors.
<EditorContent | ||
initialContent={[]} | ||
initialContent={initialContent} | ||
extensions={extensions} | ||
className="min-h-[500px] border rounded-lg" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: No save handler implemented - content changes won't persist to localStorage
import { Menu } from 'lucide-react'; | ||
|
||
export default function Home() { | ||
const [repoUrl, setRepoUrl] = useState(''); | ||
const [isSidebarOpen, setIsSidebarOpen] = useState(false); | ||
|
||
const [initialContent, setInitialContent] = useState<null | JSONContent>(null); | ||
|
||
const extensions = [...defaultExtensions]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Extensions array recreated on every render. Move outside component or use useMemo
No description provided.