Skip to content

Added a Keyboard Shortcut Modal component#166

Open
aparna24bce11388 wants to merge 7 commits into
piyushdotcomm:mainfrom
aparna24bce11388:feature/shortcut-modal
Open

Added a Keyboard Shortcut Modal component#166
aparna24bce11388 wants to merge 7 commits into
piyushdotcomm:mainfrom
aparna24bce11388:feature/shortcut-modal

Conversation

@aparna24bce11388
Copy link
Copy Markdown

@aparna24bce11388 aparna24bce11388 commented May 17, 2026

Summary

  • Added a Keyboard Shortcut Modal component
  • Integrated a "Shortcuts" button in the header/navbar to open the modal
  • Improves usability by allowing users to quickly view available keyboard shortcuts

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Test or CI improvement
  • Starter template change

Related issue

Closes #98

Validation

  • npm run lint
  • npm test
  • npm run build

List any additional manual verification you performed:

  • Modal opens on button click
  • Modal closes on close button / Esc key
  • UI looks responsive and aligned with design

Screenshots or recordings

(Add screenshot of modal UI if possible)

Checklist

  • I kept this PR focused on one primary change
  • I updated documentation if behavior changed
  • I did not commit secrets, local logs, or scratch files
  • I am requesting review on the correct scope

Summary by CodeRabbit

  • New Features

    • Added a "Shortcuts" modal accessible from the header and simplified mobile menu with auth-aware Sign In / Dashboard or Get Started links.
    • Streamlined home hero, demo, templates and features layout with a loading overlay.
  • Bug Fixes / UX

    • Cleaner header and mobile sheet behavior for more predictable navigation.
  • Chores / Configuration

    • Pinned React dev typings, enabled additional workspace build entries, and made server AUTH_SECRET required in env config.

Review Change Stack

@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions
Copy link
Copy Markdown

👋 Thanks for opening a PR, @aparna24bce11388!

Your PR has entered the 🚦 PR Review Pipeline.

Standard PR detected — your PR will follow the standard review pipeline.


What happens next

Stage Reviewer Checks
Stage 1 — Automated Validation 🤖 Bot DCO · Format · AI/Slop · Duplicate
Stage 2 — Human Review 👥 Maintainer Code + Quality Review
Stage 3 — PA / Maintainer Review 🔑 Project Admin Final Merge Decision

A pipeline status comment will appear below and update automatically as your PR progresses.


While you wait

  • Sign all commits (git commit -s)
  • Link your issue (Closes #123)
  • Use a feature branch (not main)
  • Avoid unrelated changes

This comment is posted only once.

@github-actions github-actions Bot added the enhancement New feature or request label May 17, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a client-side ShortcutModal and a Shortcuts trigger in the Header (with a mobile Sheet menu); simplifies the Home page and JSON‑LD; requires server.AUTH_SECRET in env schema; adds pnpm allowBuilds entries; and pins @types/react/@types/react-dom devDependency versions.

Changes

Shortcuts Modal Integration & Related Updates

Layer / File(s) Summary
UI: ShortcutModal and Header wiring
components/ShortcutModal.tsx, modules/home/header.tsx
Adds a controlled ShortcutModal and wires shortcutOpen state into Header; introduces a right-side Sheet mobile menu managed by menuOpen; updates imports and NavLink props/styling.
Home page: hero, shader, templates
app/(root)/page.tsx
Simplifies HERO and page JSX, updates JSON‑LD Organization fields, uses a client-side isLoading timeout, and renders HeroCodeDemo, templates.slice(0, 4), and Features.
Env schema validation
env.ts
Changes server.AUTH_SECRET from optional to required (z.string().min(1)); client mapping and runtime env formatting unchanged.
Workspace allowBuilds
pnpm-workspace.yaml
Adds allowBuilds entries permitting builds for @prisma/client, @prisma/engines, leveldown, prisma, sharp, and unrs-resolver.
DevDependency pins for React types
package.json
Pins devDependencies: @types/react -> ^19.2.14, @types/react-dom -> ^19.2.3.

Sequence Diagram(s)

sequenceDiagram
  participant Header
  participant ShortcutModal
  participant Sheet
  Header->>ShortcutModal: open={shortcutOpen} / onOpenChange={setShortcutOpen}
  Header->>Sheet: open={menuOpen} / onOpenChange={setMenuOpen}
  Sheet->>Header: render auth-dependent links
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels

ui-ux, type:feature, accessibility, level:intermediate

Suggested reviewers

  • piyushdotcomm

"I hopped to map each key and code,
A modal snug where shortcuts show,
Keys in rows so users know,
Header, sheet, and types aligned,
Small changes, clearer minds."

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Beyond the primary modal feature, the PR includes several ancillary changes: header navigation refactoring, package.json type updates, pnpm config modifications, env.ts AUTH_SECRET requirement change, and home page redesign that extend beyond the stated primary feature focus. Separate out-of-scope changes (header refactoring, home page updates, env config, package.json, pnpm-workspace.yaml) into independent PRs focused on their respective objectives.
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.
Linked Issues check ❓ Inconclusive The PR addresses the core requirements from issue #98: a keyboard shortcut modal component is created and integrated into the header. However, the implementation lacks the promised categorized shortcut data structure and organization mentioned in the issue requirements. Verify that the ShortcutModal displays shortcuts organized by categories (editor, terminal, navigation, playground) as specified in issue #98, rather than the current fixed two-line implementation.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: adding a keyboard shortcut modal component, which is the primary focus of the changeset.
Description check ✅ Passed The PR description follows the template structure with Summary, Type of change, Related issue, Validation, and Checklist sections mostly complete, though automated checks remain uncompleted.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/(root)/page.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

modules/home/header.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


Comment @coderabbitai help to get the list of available commands and usage tips.

@aparna24bce11388
Copy link
Copy Markdown
Author

Hi @piyushdotcomm,

I have implemented the keyboard shortcut modal feature with navbar integration.

Kindly review and let me know if any changes are required.

Thank you!

Copy link
Copy Markdown

@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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modules/home/header.tsx`:
- Around line 64-73: The code currently nests <Link> around a <Button> which
creates nested interactive elements; change to render the Button as the parent
and place the Link inside using the Button's asChild prop so the anchor becomes
the button's rendered element. Locate the sign-in and sign-up button blocks (the
<Link href="/auth/sign-in"> / <Link href="/auth/sign-up"> usages and the mobile
variants) and replace the pattern Link->Button with Button asChild containing
the Link, preserving the Button props (variant, size, className) and moving any
classes/text into the inner Link so semantics and keyboard/screen-reader
behavior are correct. Ensure the same change is applied to all three occurrences
mentioned.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 64be634d-bbc9-48bf-aeac-e922fe26d8c8

📥 Commits

Reviewing files that changed from the base of the PR and between 06cc393 and 7607b72.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • components/ShortcutModal.tsx
  • modules/home/header.tsx
  • package.json
  • pnpm-workspace.yaml

Comment thread modules/home/header.tsx Outdated
Comment on lines +64 to +73
<Link href="/auth/sign-in">
<Button
variant="ghost"
size="sm"
className="hidden sm:flex text-muted-foreground hover:text-foreground hover:bg-red-500/5"
>
Sign In
</Button>
</Link>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify Button supports `asChild` and find nested Link/Button patterns.

fd -i 'button.tsx' | xargs -r sed -n '1,220p'
rg -nP --type=tsx '<Link[^>]*>\s*<Button' -C2

Repository: piyushdotcomm/Editron

Length of output: 7670


🏁 Script executed:

cat -n modules/home/header.tsx | sed -n '60,95p'

Repository: piyushdotcomm/Editron

Length of output: 2303


Avoid nested interactive elements (<Link> wrapping <Button>).

Nested anchors and buttons break HTML semantics and can cause keyboard navigation and screen-reader issues. Refactor using Button asChild with Link inside instead.

Suggested fix
-<Link href="/auth/sign-in">
-  <Button
-    variant="ghost"
-    size="sm"
-    className="hidden sm:flex text-muted-foreground hover:text-foreground hover:bg-red-500/5"
-  >
-    Sign In
-  </Button>
-</Link>
+<Button
+  asChild
+  variant="ghost"
+  size="sm"
+  className="hidden sm:flex text-muted-foreground hover:text-foreground hover:bg-red-500/5"
+>
+  <Link href="/auth/sign-in">Sign In</Link>
+</Button>
-<Link href="/dashboard">
-  <Button
-    size="sm"
-    className="bg-red-600 hover:bg-red-700 text-white shadow-md shadow-red-500/20 text-xs font-semibold px-4 rounded-full"
-  >
-    Get Started
-  </Button>
-</Link>
+<Button
+  asChild
+  size="sm"
+  className="bg-red-600 hover:bg-red-700 text-white shadow-md shadow-red-500/20 text-xs font-semibold px-4 rounded-full"
+>
+  <Link href="/dashboard">Get Started</Link>
+</Button>
-<Link href="/dashboard">
-  <Button
-    size="sm"
-    variant="outline"
-    className="hidden sm:flex text-xs font-semibold px-3 h-8 border-red-500/20 text-red-600 hover:bg-red-500/5 mr-1"
-  >
-    Dashboard
-  </Button>
-</Link>
+<Button
+  asChild
+  size="sm"
+  variant="outline"
+  className="hidden sm:flex text-xs font-semibold px-3 h-8 border-red-500/20 text-red-600 hover:bg-red-500/5 mr-1"
+>
+  <Link href="/dashboard">Dashboard</Link>
+</Button>

Applies to lines 64-72, 74-81, 85-93.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Link href="/auth/sign-in">
<Button
variant="ghost"
size="sm"
className="hidden sm:flex text-muted-foreground hover:text-foreground hover:bg-red-500/5"
>
Sign In
</Button>
</Link>
<Button
asChild
variant="ghost"
size="sm"
className="hidden sm:flex text-muted-foreground hover:text-foreground hover:bg-red-500/5"
>
<Link href="/auth/sign-in">Sign In</Link>
</Button>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modules/home/header.tsx` around lines 64 - 73, The code currently nests
<Link> around a <Button> which creates nested interactive elements; change to
render the Button as the parent and place the Link inside using the Button's
asChild prop so the anchor becomes the button's rendered element. Locate the
sign-in and sign-up button blocks (the <Link href="/auth/sign-in"> / <Link
href="/auth/sign-up"> usages and the mobile variants) and replace the pattern
Link->Button with Button asChild containing the Link, preserving the Button
props (variant, size, className) and moving any classes/text into the inner Link
so semantics and keyboard/screen-reader behavior are correct. Ensure the same
change is applied to all three occurrences mentioned.

Copy link
Copy Markdown
Owner

@piyushdotcomm piyushdotcomm left a comment

Choose a reason for hiding this comment

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

Revert all pnpm and package.json changes. We use npm. Also, fix the invalid HTML nesting.

Comment thread modules/home/header.tsx Outdated
</Button>
</Link>
<UserButton />
</div>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Invalid HTML. You can't nest a <Button> inside a <Link>. Use <Button asChild> and put the link inside it.

Copy link
Copy Markdown

@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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/ShortcutModal.tsx`:
- Around line 71-76: The inline modal style object (modal) uses a fixed width
"400px" which can overflow on small screens; update the modal style in
ShortcutModal.tsx (the modal constant) to use viewport-aware sizing such as
width: "90vw" with a maxWidth: "400px", add maxHeight (e.g., "90vh") and
overflowY: "auto" (and boxSizing: "border-box" if needed) so the dialog
constrains to the viewport and becomes scrollable on small devices.
- Around line 32-57: ShortcutModal currently lacks required accessibility: add
dialog semantics, Esc-to-close, and initial focus management. Update the
ShortcutModal component to render the modal container with role="dialog",
aria-modal="true", and an accessible label (aria-labelledby pointing to the
<h2>), add a ref for the Close button and on mount (when isOpen true) call
focus() on that ref, and set up a keydown listener (useEffect) that closes the
modal when Escape is pressed by calling onClose; also trap focus inside the
modal while open (simple tab-wrap using a keydown handler or integrate a
focus-trap util) and on unmount/close return focus to the previously focused
element. Ensure the Close button has a descriptive label and the modal container
is keyboard focusable (tabIndex={-1}) to support focus management.

In `@modules/home/header.tsx`:
- Around line 89-119: The mobile Sheet (components Sheet, SheetContent) remains
open after tapping navigation links because link clicks don't update menuOpen;
update every Link rendered inside the Sheet (including "/docs", "/#features",
"/templates", "/auth/sign-in", "/dashboard") to close the sheet by calling
setMenuOpen(false) on click (e.g., add an onClick handler or pass a prop that
triggers setMenuOpen(false)); ensure both the signed-in and signed-out link
branches call this so the sheet always closes for in-page/hash navigation and
persistent layouts.
- Around line 91-93: The icon-only Button rendering the Menu icon lacks an
accessible label; update the Button (the element rendering <Button size="icon">
with the <Menu /> child) to provide a programmatic name—e.g., add an aria-label
(aria-label="Open menu" or similar) or include visually hidden text inside the
button—so screen readers can identify the control; ensure the label describes
the action (open/close/menu) and matches any toggle behavior if applicable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fb911f8-0053-4b03-bd12-81fb258db04d

📥 Commits

Reviewing files that changed from the base of the PR and between 7607b72 and 3a30a7c.

📒 Files selected for processing (3)
  • components/ShortcutModal.tsx
  • env.ts
  • modules/home/header.tsx

Comment thread components/ShortcutModal.tsx Outdated
Comment on lines +32 to +57
export default function ShortcutModal({ isOpen, onClose }: Props) {
if (!isOpen) return null;

return (
<div style={overlay}>
<div style={modal}>
<h2>Keyboard Shortcuts</h2>

{shortcuts.map((section) => (
<div key={section.category}>
<h3>{section.category}</h3>

{section.items.map((item, i) => (
<div key={i} style={row}>
<span>{item.action}</span>
<kbd>{item.key}</kbd>
</div>
))}
</div>
))}

<button onClick={onClose}>Close</button>
</div>
</div>
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Modal misses required accessibility behavior (Esc + dialog semantics).

This implementation does not currently implement Esc-to-close, dialog semantics, or initial focus management, so it falls short of the stated accessibility behavior for this feature.

Suggested fix
+"use client";
+import { useEffect, useRef } from "react";
 
 type Props = {
   isOpen: boolean;
   onClose: () => void;
 };
@@
 export default function ShortcutModal({ isOpen, onClose }: Props) {
+  const closeButtonRef = useRef<HTMLButtonElement>(null);
+
+  useEffect(() => {
+    if (!isOpen) return;
+
+    const onKeyDown = (event: KeyboardEvent) => {
+      if (event.key === "Escape") onClose();
+    };
+
+    document.addEventListener("keydown", onKeyDown);
+    closeButtonRef.current?.focus();
+    return () => document.removeEventListener("keydown", onKeyDown);
+  }, [isOpen, onClose]);
+
   if (!isOpen) return null;
 
   return (
-    <div style={overlay}>
+    <div role="dialog" aria-modal="true" aria-labelledby="keyboard-shortcuts-title" style={overlay}>
       <div style={modal}>
-        <h2>Keyboard Shortcuts</h2>
+        <h2 id="keyboard-shortcuts-title">Keyboard Shortcuts</h2>
@@
-        <button onClick={onClose}>Close</button>
+        <button ref={closeButtonRef} onClick={onClose}>Close</button>
       </div>
     </div>
   );
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/ShortcutModal.tsx` around lines 32 - 57, ShortcutModal currently
lacks required accessibility: add dialog semantics, Esc-to-close, and initial
focus management. Update the ShortcutModal component to render the modal
container with role="dialog", aria-modal="true", and an accessible label
(aria-labelledby pointing to the <h2>), add a ref for the Close button and on
mount (when isOpen true) call focus() on that ref, and set up a keydown listener
(useEffect) that closes the modal when Escape is pressed by calling onClose;
also trap focus inside the modal while open (simple tab-wrap using a keydown
handler or integrate a focus-trap util) and on unmount/close return focus to the
previously focused element. Ensure the Close button has a descriptive label and
the modal container is keyboard focusable (tabIndex={-1}) to support focus
management.

Comment thread components/ShortcutModal.tsx Outdated
Comment on lines +71 to +76
const modal = {
background: "white",
padding: "20px",
borderRadius: "10px",
width: "400px",
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Modal sizing is not mobile-safe.

A fixed width: "400px" can overflow on small devices. Add viewport-aware width/height constraints and scrolling.

Suggested fix
 const modal = {
   background: "white",
   padding: "20px",
   borderRadius: "10px",
-  width: "400px",
+  width: "min(400px, 92vw)",
+  maxHeight: "85vh",
+  overflowY: "auto" as const,
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const modal = {
background: "white",
padding: "20px",
borderRadius: "10px",
width: "400px",
};
const modal = {
background: "white",
padding: "20px",
borderRadius: "10px",
width: "min(400px, 92vw)",
maxHeight: "85vh",
overflowY: "auto" as const,
};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/ShortcutModal.tsx` around lines 71 - 76, The inline modal style
object (modal) uses a fixed width "400px" which can overflow on small screens;
update the modal style in ShortcutModal.tsx (the modal constant) to use
viewport-aware sizing such as width: "90vw" with a maxWidth: "400px", add
maxHeight (e.g., "90vh") and overflowY: "auto" (and boxSizing: "border-box" if
needed) so the dialog constrains to the viewport and becomes scrollable on small
devices.

Comment thread modules/home/header.tsx
Comment thread modules/home/header.tsx Outdated
Copy link
Copy Markdown
Owner

@piyushdotcomm piyushdotcomm left a comment

Choose a reason for hiding this comment

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

We use Tailwind CSS. Inline styles are strictly forbidden.

Issues in this PR

  1. Dark Mode Broken
    Hardcoding background: "white" completely breaks dark mode support.

  2. Reinventing the Wheel
    Don’t build custom modals from scratch. We already use Shadcn UI — use the <Dialog> component instead.

  3. Missing Features
    The PR description claims the modal closes on Esc, but there are no keyboard event listeners or related handling in the code.

  4. UI Consistency
    Use the project’s <Button> component instead of a raw <button> element.

Please remove components/ShortcutModal.tsx and rewrite it using the Shadcn <Dialog> component with Tailwind classes.

I’m blocking this merge until these issues are fixed.

Copy link
Copy Markdown

@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: 2

🧹 Nitpick comments (2)
app/(root)/page.tsx (2)

83-83: ⚡ Quick win

Remove development comments.

The "✅ FIXED BUTTON" comments appear to be development artifacts and should be removed before merging.

🧹 Proposed cleanup
-          {/* ✅ FIXED BUTTON */}
           <Button asChild size="lg">
             <Link href="/dashboard">
               Start Coding for Free
               <ArrowRight className="ml-2 h-4 w-4" />
             </Link>
           </Button>

-          {/* ✅ FIXED BUTTON */}
           <Button asChild variant="outline" size="lg">
             <Link href="`#features`">
               Explore Features
             </Link>
           </Button>

Also applies to: 91-91

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(root)/page.tsx at line 83, Remove the stray development JSX comments
that say {/* ✅ FIXED BUTTON */}; locate the two occurrences of that JSX comment
(they sit adjacent to the button elements in the page component) and delete
those comment nodes so the production JSX contains no development artifacts.

66-66: 💤 Low value

Consider using a semantic z-index value.

The z-[9999] is an arbitrary, extremely high value. If your design system defines semantic z-index values (e.g., z-modal, z-overlay), prefer those for maintainability and to avoid future stacking context conflicts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(root)/page.tsx at line 66, Replace the hardcoded z-[9999] utility in
the modal/root element class string with a semantic z-index token from your
design system (e.g., use z-modal or z-overlay) and, if that token doesn't exist
yet, add it to your Tailwind config as a named z-index (e.g.,
theme.extend.z.modal = 9999) so the component in app/(root)/page.tsx uses the
semantic class instead of the numeric literal.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/`(root)/page.tsx:
- Around line 64-71: The loading overlay div currently lacks accessibility
attributes; update the div that wraps CommitsGrid (the element using isLoading)
to include ARIA attributes: add role="status", aria-live="polite", and set
aria-busy={isLoading} so assistive tech knows the app is loading, and toggle
aria-hidden={!isLoading} (or remove live announcements) when not loading; ensure
the CommitsGrid component itself does not duplicate announcements so only the
overlay controls the loading announcement.
- Around line 43-44: The schema currently uses hardcoded URLs for the url and
logo fields ("https://editron.vercel.app"); replace those with an
environment-aware base URL (e.g. use NEXT_PUBLIC_BASE_URL) or derive the origin
at runtime and concatenate paths so the `url` and `logo` values are correct in
dev/staging/preview; update the code that builds the structured data (the object
containing `url` and `logo`) to read from process.env.NEXT_PUBLIC_BASE_URL with
a sensible fallback to the current request origin, and ensure the env var is
documented/added to CI so all environments produce correct absolute URLs.

---

Nitpick comments:
In `@app/`(root)/page.tsx:
- Line 83: Remove the stray development JSX comments that say {/* ✅ FIXED BUTTON
*/}; locate the two occurrences of that JSX comment (they sit adjacent to the
button elements in the page component) and delete those comment nodes so the
production JSX contains no development artifacts.
- Line 66: Replace the hardcoded z-[9999] utility in the modal/root element
class string with a semantic z-index token from your design system (e.g., use
z-modal or z-overlay) and, if that token doesn't exist yet, add it to your
Tailwind config as a named z-index (e.g., theme.extend.z.modal = 9999) so the
component in app/(root)/page.tsx uses the semantic class instead of the numeric
literal.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e5cc75ed-05ab-4cee-8651-8ff8249ccd22

📥 Commits

Reviewing files that changed from the base of the PR and between 5a46ca0 and 0d87947.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • app/(root)/page.tsx
  • components/ShortcutModal.tsx
  • modules/home/header.tsx

Comment thread app/(root)/page.tsx
Comment on lines +43 to 44
url: "https://editron.vercel.app",
logo: "https://editron.vercel.app/logo.svg",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace hardcoded production URLs with environment-aware base URL.

The schema markup contains hardcoded editron.vercel.app URLs that will be incorrect in development, staging, or preview environments. This can confuse search engines when they encounter mismatched URLs between the page location and the structured data.

🌐 Proposed fix using environment variable or Next.js URL
+  const baseUrl = process.env.NEXT_PUBLIC_APP_URL || "https://editron.vercel.app";
+
   const schemaMarkup = {
     "`@context`": "https://schema.org",
     "`@graph`": [
       // ...
       {
         "`@type`": "Organization",
         name: "Editron",
-        url: "https://editron.vercel.app",
-        logo: "https://editron.vercel.app/logo.svg",
+        url: baseUrl,
+        logo: `${baseUrl}/logo.svg`,
       },
     ],
   };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(root)/page.tsx around lines 43 - 44, The schema currently uses
hardcoded URLs for the url and logo fields ("https://editron.vercel.app");
replace those with an environment-aware base URL (e.g. use NEXT_PUBLIC_BASE_URL)
or derive the origin at runtime and concatenate paths so the `url` and `logo`
values are correct in dev/staging/preview; update the code that builds the
structured data (the object containing `url` and `logo`) to read from
process.env.NEXT_PUBLIC_BASE_URL with a sensible fallback to the current request
origin, and ensure the env var is documented/added to CI so all environments
produce correct absolute URLs.

Comment thread app/(root)/page.tsx
Comment on lines 64 to 71
<div
className={cn(
"fixed inset-0 z-[9999] flex items-center justify-center bg-background transition-opacity duration-700 ease-in-out",
isLoading ? "opacity-100" : "opacity-0 pointer-events-none",
"fixed inset-0 z-[9999] flex items-center justify-center bg-background transition-opacity",
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
)}
>
<div className="w-full flex justify-center">
<CommitsGrid text="EDITRON" />
</div>
<CommitsGrid text="EDITRON" />
</div>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add ARIA attributes for loading state accessibility.

The loading overlay lacks ARIA attributes to announce the loading state to screen readers. Users relying on assistive technology won't know the page is loading.

♿ Proposed fix adding accessibility attributes
       <div
         className={cn(
           "fixed inset-0 z-[9999] flex items-center justify-center bg-background transition-opacity",
           isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
         )}
+        role="status"
+        aria-live="polite"
+        aria-label={isLoading ? "Loading application" : ""}
       >
         <CommitsGrid text="EDITRON" />
       </div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div
className={cn(
"fixed inset-0 z-[9999] flex items-center justify-center bg-background transition-opacity duration-700 ease-in-out",
isLoading ? "opacity-100" : "opacity-0 pointer-events-none",
"fixed inset-0 z-[9999] flex items-center justify-center bg-background transition-opacity",
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
)}
>
<div className="w-full flex justify-center">
<CommitsGrid text="EDITRON" />
</div>
<CommitsGrid text="EDITRON" />
</div>
<div
className={cn(
"fixed inset-0 z-[9999] flex items-center justify-center bg-background transition-opacity",
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
)}
role="status"
aria-live="polite"
aria-label={isLoading ? "Loading application" : ""}
>
<CommitsGrid text="EDITRON" />
</div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(root)/page.tsx around lines 64 - 71, The loading overlay div currently
lacks accessibility attributes; update the div that wraps CommitsGrid (the
element using isLoading) to include ARIA attributes: add role="status",
aria-live="polite", and set aria-busy={isLoading} so assistive tech knows the
app is loading, and toggle aria-hidden={!isLoading} (or remove live
announcements) when not loading; ensure the CommitsGrid component itself does
not duplicate announcements so only the overlay controls the loading
announcement.

Copy link
Copy Markdown

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
modules/home/header.tsx (1)

96-189: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix the mobile Sheet block: it is currently JSX-invalid and build-blocking.

This section appears to contain an unresolved merge of two different SheetContent implementations (duplicated containers, broken conditional branches/fragments), and it also calls setOpen(...) even though only setMenuOpen(...) exists.

Suggested direction (minimal cleanup)
-<SheetContent side="right">
-  ...
-  <SheetContent side="right" className="...">
-    ...
-    onClick={() => setOpen(false)}
+<SheetContent side="right" className="w-[85%] max-w-[320px] border-l border-border/50 bg-background/95 backdrop-blur-xl p-0 transition-all duration-300">
+  ...
+  onClick={() => setMenuOpen(false)}

Keep only one SheetContent tree and one auth conditional branch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modules/home/header.tsx` around lines 96 - 189, The mobile Sheet block
contains duplicated SheetContent trees, broken JSX fragments and calls
setOpen(...) which doesn't exist; collapse to a single SheetContent tree (remove
the extra nested SheetContent), restore a single coherent auth conditional
around {!user ? (...) : (...)} using the existing user variable, replace all
setOpen(...) calls with setMenuOpen(...) and ensure fragments/ternaries are
properly opened and closed so the JSX is valid (check the block that renders
Links/Buttons and the bottom auth buttons to match the single SheetContent
structure).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/`(root)/page.tsx:
- Around line 18-23: The file has two conflicting Home exports and mixed client
hooks (useState) with server-side async logic (getPopularTemplateSummaries) plus
stray JSX after the function close; fix by keeping a single default export: make
the top-level Home an async server component that awaits
getPopularTemplateSummaries(4) and renders markup, then extract any client-only
behavior (useState, useEffect, interactive handlers) into a separate
"ClientHome" React component annotated with "use client" and import/render that
from the server Home, remove the duplicate export and the stray JSX outside any
function, and ensure all references to Home, getPopularTemplateSummaries,
useState, and the stray JSX block are relocated or deleted so the file compiles.

In `@modules/home/header.tsx`:
- Around line 205-243: NavLink currently contains two consecutive opening <Link>
tags which breaks JSX; open only a single <Link> in the NavLink function (the
one that includes the full className and props) and remove the stray first <Link
href={href} className="px-3 py-2 text-sm"> so there is one <Link href={href}
className="..."> ... {children} </Link>; ensure the final element is properly
closed and that any needed props (href, className) from the removed tag are
preserved in the remaining <Link>.

---

Outside diff comments:
In `@modules/home/header.tsx`:
- Around line 96-189: The mobile Sheet block contains duplicated SheetContent
trees, broken JSX fragments and calls setOpen(...) which doesn't exist; collapse
to a single SheetContent tree (remove the extra nested SheetContent), restore a
single coherent auth conditional around {!user ? (...) : (...)} using the
existing user variable, replace all setOpen(...) calls with setMenuOpen(...) and
ensure fragments/ternaries are properly opened and closed so the JSX is valid
(check the block that renders Links/Buttons and the bottom auth buttons to match
the single SheetContent structure).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fe40b30-8175-4093-906c-04942c27c873

📥 Commits

Reviewing files that changed from the base of the PR and between 0d87947 and 4373e74.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • app/(root)/page.tsx
  • modules/home/header.tsx
  • package.json

Comment thread app/(root)/page.tsx
Comment on lines +18 to 23
export default function Home() {
const [isLoading, setIsLoading] = useState(true);
export default async function Home() {
const popularTemplates = await getPopularTemplateSummaries(4);

// Schema Markup for AI SEO (Organization & SoftwareApplication)
const schemaMarkup = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Resolve the mixed client/server page merge; this file is currently non-compilable.

There are duplicate default exports, client hooks in the same merged body, and stray JSX after the function close. This needs to be reduced to a single implementation path.

Minimal fix direction
-import { useState, useEffect } from "react";
-import { Button } from "`@/components/ui/button`";
-import { ArrowRight } from "lucide-react";
-import Link from "next/link";
-import { Features } from "`@/modules/home/features`";
-import { HeroCodeDemo } from "`@/modules/home/hero-code`";
-import dynamic from "next/dynamic";
-import { CommitsGrid } from "`@/components/ui/commits-grid`";
-import { cn } from "`@/lib/utils`";
-import { templates } from "`@/lib/constants/templates`";
-import { TemplateCard } from "`@/components/marketing/template-card`";
-
-export default function Home() {
-  const [isLoading, setIsLoading] = useState(true);
 export default async function Home() {
   const popularTemplates = await getPopularTemplateSummaries(4);
-  // ...merged legacy client JSX...
+  return <HomePageClient popularTemplates={popularTemplates} />;
 }
-
-      <HomePageClient popularTemplates={popularTemplates} />
-        </div>
-   );
-}

Also applies to: 48-53, 119-123

🧰 Tools
🪛 Biome (2.4.15)

[error] 18-123: Illegal duplicate default export declarations

(parse)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(root)/page.tsx around lines 18 - 23, The file has two conflicting Home
exports and mixed client hooks (useState) with server-side async logic
(getPopularTemplateSummaries) plus stray JSX after the function close; fix by
keeping a single default export: make the top-level Home an async server
component that awaits getPopularTemplateSummaries(4) and renders markup, then
extract any client-only behavior (useState, useEffect, interactive handlers)
into a separate "ClientHome" React component annotated with "use client" and
import/render that from the server Home, remove the duplicate export and the
stray JSX outside any function, and ensure all references to Home,
getPopularTemplateSummaries, useState, and the stray JSX block are relocated or
deleted so the file compiles.

Comment thread modules/home/header.tsx
Comment on lines 205 to 243
@@ -222,4 +242,4 @@ function NavLink({ href, children }: { href: string; children: React.ReactNode }
{children}
</Link>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

NavLink has duplicate opening <Link> tags.

NavLink renders one <Link ...> and immediately starts another <Link ...> before closing, which is invalid JSX and will fail parsing.

Minimal fix
 function NavLink({ href, children }: any) {
   return (
-    <Link href={href} className="px-3 py-2 text-sm">
-    <Link
+    <Link
       href={href}
       className="
         relative
         px-3
         py-2
         text-sm
         font-medium
         text-muted-foreground
         hover:text-red-500
         rounded-md
         transition-all
         duration-300
@@
         hover:after:scale-x-100
         "
     >
       {children}
     </Link>
   );
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function NavLink({ href, children }: any) {
return (
<Link
href={href}
className="
relative
px-3
py-2
text-sm
font-medium
text-muted-foreground
hover:text-red-500
rounded-md
transition-all
duration-300
after:content-['']
after:absolute
after:left-1/2
after:bottom-1
after:h-[2px]
after:w-[70%]
after:-translate-x-1/2
after:scale-x-0
after:origin-center
after:rounded-full
after:bg-gradient-to-r
after:from-red-900
after:via-red-600
after:to-red-400
after:transition-transform
after:duration-300
hover:after:scale-x-100
"
>
{children}
</Link>
);
}
🧰 Tools
🪛 Biome (2.4.15)

[error] 206-206: expected } but instead found return

(parse)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modules/home/header.tsx` around lines 205 - 243, NavLink currently contains
two consecutive opening <Link> tags which breaks JSX; open only a single <Link>
in the NavLink function (the one that includes the full className and props) and
remove the stray first <Link href={href} className="px-3 py-2 text-sm"> so there
is one <Link href={href} className="..."> ... {children} </Link>; ensure the
final element is properly closed and that any needed props (href, className)
from the removed tag are preserved in the remaining <Link>.

Copy link
Copy Markdown
Owner

@piyushdotcomm piyushdotcomm left a comment

Choose a reason for hiding this comment

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

check the code rabbit review and fix those

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Keyboard Shortcut Cheat Sheet Modal

2 participants