Skip to content

feat: Add footer bento spotlight, page transitions and features in ed…#449

Open
dhawneetg wants to merge 3 commits into
algoscope-hq:mainfrom
dhawneetg:feat/spotlight-transitions
Open

feat: Add footer bento spotlight, page transitions and features in ed…#449
dhawneetg wants to merge 3 commits into
algoscope-hq:mainfrom
dhawneetg:feat/spotlight-transitions

Conversation

@dhawneetg
Copy link
Copy Markdown

@dhawneetg dhawneetg commented May 29, 2026

Pull Request Summary

What changed?

Upgraded CodeEditor.jsx with active language badges, a keyboard shortcuts
drawer, and a real-time stats HUD. Added high-fidelity route transition
animations in AppLayout.jsx using Framer Motion. Refactored Footer.jsx
bento cells into a FooterBentoCard component with live cursor-tracking
radial spotlight overlays and masked border glows.

Why is this needed?

The footer, page routing, and code editor lacked interactive visual feedback
and felt abrupt. This PR restores premium UI animations and editor upgrades
to make the experience feel polished and cohesive.

Closes #444

Type of Change

  • feat - New user-facing feature or algorithm capability
  • style - Formatting or styling change with no behavior change

Release Notes

Release note category:

  • Added

Release note entry:

  • Added footer bento spotlight glows, silky page transitions, and Monaco
    editor upgrades (language badges, shortcuts drawer, stats HUD)

Testing and Verification

  • npm ci or npm install
  • npm run lint
  • npm run build
  • Manual browser testing at http://localhost:5173
  • Responsive testing for affected views
  • No new console errors or warnings

Skipped or additional testing notes:
Skipped npm run format:check — no formatting-only changes made.

UI Evidence

Before: Standard static footer cards, instant page switches, plain Monaco container.
After:
Screenshot (39)
Screenshot (40)

CI/CD and Deployment Impact

  • No deployment impact expected

Deployment notes:
No secrets, environment variables, or migration steps required.

Reviewer Checklist

  • PR title follows Conventional Commits and matches the selected change type
  • Scope is focused and unrelated changes are excluded
  • Release note category and entry are accurate
  • CI checks are expected to pass: format, lint, and build
  • UI evidence is included when user-facing screens changed
  • Documentation is updated when behavior, setup, or deployment changed

Summary by CodeRabbit

Release Notes

  • New Features
    • Smooth page transition animations when navigating between routes
    • Enhanced code editor with theme support, dynamic visual effects, keyboard shortcuts guide, and file download capability
    • Live editor statistics display showing line/character counts and cursor position
    • Interactive visual feedback effects for footer navigation cards

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

Someone is attempting to deploy a commit to the adityapaul2603-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for astounding-nougat-da0f6a ready!

Name Link
🔨 Latest commit d1509b1
🔍 Latest deploy log https://app.netlify.com/projects/astounding-nougat-da0f6a/deploys/6a1a6dd151b7430007b13622
😎 Deploy Preview https://deploy-preview-449--astounding-nougat-da0f6a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: a22a9cd3-7bdb-4c57-a26e-5e5e209e2fed

📥 Commits

Reviewing files that changed from the base of the PR and between 95de8d9 and d1509b1.

📒 Files selected for processing (1)
  • src/components/Footer.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Footer.jsx

📝 Walkthrough

Walkthrough

Adds Framer Motion route-change animations to AppLayout; upgrades CodeEditor with mouse-tracking spotlight, Monaco cursor subscriptions, download-to-file, a status HUD, and an animated shortcuts drawer; refactors Footer into spotlight-enabled FooterBentoCard tiles with smooth scroll behavior.

Changes

Interactive UI Enhancements with Spotlight Effects & Route Animations

Layer / File(s) Summary
Route-change page transitions
src/components/AppLayout.jsx
useLocation extracts pathname; children are wrapped in a motion.div keyed by pathname to animate opacity, vertical translate, and slight scale on route changes.
CodeEditor imports, refs, state & mouse tracking
src/components/CodeEditor.jsx
Adds framer-motion and theme imports, refs for card/editor, state for mouse position, cursor position, and shortcuts drawer; implements mousemove handler to compute spotlight coordinates relative to the card.
Monaco mount, cursor tracking & download
src/components/CodeEditor.jsx
Wires Monaco mount to capture the editor instance and subscribe to cursor position updates; implements download handler that maps language → extension and creates a blob download solution.<ext>; adds language badge helper.
Spotlight container, header & toolbar
src/components/CodeEditor.jsx
Reworks outer editor container to render animated spotlight/inner-glow driven by mouse state; updates header/toolbar layout, language display, Copy/Download/Run button styling and disabled/loading behavior with theme-aware classes.
Editor viewport, shortcuts drawer & status HUD
src/components/CodeEditor.jsx
Dedicated viewport rendering Monaco plus AnimatePresence-driven shortcuts side drawer; footer HUD shows readiness, live line/character counts, cursor position, and a shortcuts toggle.
Footer Bento cards with spotlight & grid refactor
src/components/Footer.jsx
Introduces FooterBentoCard with mouse-tracking spotlight and hover state; refactors algorithms grid to map entries to the new component; removes minor comments, updates algorithm desc string, and replaces the Discord SVG path.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CodeEditor
  participant Monaco
  participant StatusHUD
  participant ShortcutsDrawer
  User->>CodeEditor: mousemove over editor card
  CodeEditor->>CodeEditor: compute mousePosition (relative to card)
  CodeEditor->>CodeEditor: update spotlight (motion)
  User->>Monaco: type / move cursor
  Monaco->>CodeEditor: cursor position change event
  CodeEditor->>StatusHUD: update line/char and cursor display
  User->>StatusHUD: click Shortcuts toggle
  StatusHUD->>ShortcutsDrawer: showShortcuts = true
  ShortcutsDrawer->>ShortcutsDrawer: animate entry (AnimatePresence)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

type:feature, type:design, level:advanced

Suggested reviewers

  • adityapaul26
  • Bimbok
🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly summarizes the main changes: footer bento spotlight glows, page transitions, and code editor features using conventional commit format.
Description check ✅ Passed Description follows the template structure with all required sections: summary, change types, release notes, testing verification, UI evidence, and deployment impact.
Linked Issues check ✅ Passed All three objectives from #444 are implemented: Footer bento spotlight with cursor tracking [#444], silky page transitions in AppLayout [#444], and Monaco editor mouse-position spotlight effects [#444].
Out of Scope Changes check ✅ Passed All changes are scoped to the three linked objectives: Footer.jsx, AppLayout.jsx, and CodeEditor.jsx enhancements align with the feature requirements in #444.
Algorithm Complexity ✅ Passed This PR contains no algorithm implementations—only UI/React components. Complexity values in Footer.jsx are static metadata for display, not implementations requiring verification.
Conventional Commits ✅ Passed PR title "feat: Add footer bento spotlight..." follows conventional commits format with valid type and description, verified against repo's workflow.

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

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

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

Copy link
Copy Markdown
Contributor

@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

🧹 Nitpick comments (2)
src/components/Footer.jsx (2)

231-233: ⚡ Quick win

Use a stable key instead of array index for algorithm cards.

Line 232 uses key={i}. Use algo.path (or another stable unique field) to prevent reconciliation/state bugs and reduce avoidable remounts if order changes.

Suggested change
- {algorithms.map((algo, i) => (
-   <FooterBentoCard key={i} algo={algo} />
+ {algorithms.map((algo) => (
+   <FooterBentoCard key={algo.path} algo={algo} />
  ))}

As per coding guidelines, “Focus on React best practices, avoiding unnecessary re-renders, and efficient state management.”

🤖 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 `@src/components/Footer.jsx` around lines 231 - 233, Replace the unstable index
key on algorithm cards with a stable unique identifier: in the algorithms.map
callback that renders <FooterBentoCard key={i} algo={algo} />, use a unique
field from each algo (e.g., algo.path or another guaranteed-unique property) as
the key so React can correctly reconcile items and avoid unnecessary remounts.

11-18: ⚡ Quick win

Avoid per-mousemove React state updates in spotlight tracking.

Line 14 and Line 28/29 cause frequent rerenders on every cursor move/hover event. For this visual-only effect, prefer CSS variables on the element ref (optionally throttled with requestAnimationFrame) to keep React render cycles lower.

Suggested refactor
 const handleMouseMove = (e) => {
   if (!cardRef.current) return
   const rect = cardRef.current.getBoundingClientRect()
-  setMousePosition({
-    x: e.clientX - rect.left,
-    y: e.clientY - rect.top,
-  })
+  const x = e.clientX - rect.left
+  const y = e.clientY - rect.top
+  cardRef.current.style.setProperty('--spotlight-x', `${x}px`)
+  cardRef.current.style.setProperty('--spotlight-y', `${y}px`)
 }
 style={{
   background: isHovering
-    ? `radial-gradient(300px circle at ${mousePosition.x}px ${mousePosition.y}px, var(--theme-border-strong), transparent 45%)`
+    ? `radial-gradient(300px circle at var(--spotlight-x) var(--spotlight-y), var(--theme-border-strong), transparent 45%)`
     : 'transparent',
 }}

As per coding guidelines, “Focus on React best practices, avoiding unnecessary re-renders, and efficient state management.”

Also applies to: 27-30, 37-49

🤖 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 `@src/components/Footer.jsx` around lines 11 - 18, The handler handleMouseMove
currently calls setMousePosition on every mousemove causing frequent React
rerenders; instead compute local x/y from cardRef.getBoundingClientRect() and
write them into CSS custom properties on the DOM node (e.g.,
cardRef.current.style.setProperty('--spot-x', `${x}px`), '--spot-y' ) and remove
the setMousePosition state usage; to avoid too many updates, wrap the DOM
updates in a requestAnimationFrame loop (or throttle) and ensure your event
listeners read from cardRef and only schedule the rAF update, then apply styles
directly on cardRef.current so the spotlight is driven by CSS variables rather
than React state.
🤖 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 `@src/components/CodeEditor.jsx`:
- Around line 92-102: The Monaco editor cursor subscription created in
handleEditorMount via editor.onDidChangeCursorPosition(...) returns an
IDisposable that must be saved and disposed to avoid leaks; modify
handleEditorMount (and/or add a useEffect) to store the returned disposable
(from editor.onDidChangeCursorPosition) on editorRef or component state and
dispose it in a cleanup function when the component unmounts (call
disposable.dispose()); ensure setCursorPos is only called while mounted by
disposing the subscription in the useEffect return so the handler is removed on
unmount.

---

Nitpick comments:
In `@src/components/Footer.jsx`:
- Around line 231-233: Replace the unstable index key on algorithm cards with a
stable unique identifier: in the algorithms.map callback that renders
<FooterBentoCard key={i} algo={algo} />, use a unique field from each algo
(e.g., algo.path or another guaranteed-unique property) as the key so React can
correctly reconcile items and avoid unnecessary remounts.
- Around line 11-18: The handler handleMouseMove currently calls
setMousePosition on every mousemove causing frequent React rerenders; instead
compute local x/y from cardRef.getBoundingClientRect() and write them into CSS
custom properties on the DOM node (e.g.,
cardRef.current.style.setProperty('--spot-x', `${x}px`), '--spot-y' ) and remove
the setMousePosition state usage; to avoid too many updates, wrap the DOM
updates in a requestAnimationFrame loop (or throttle) and ensure your event
listeners read from cardRef and only schedule the rAF update, then apply styles
directly on cardRef.current so the spotlight is driven by CSS variables rather
than React state.
🪄 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.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 04feedf7-d5b4-40d3-927f-a026d65fb680

📥 Commits

Reviewing files that changed from the base of the PR and between 4354024 and 95de8d9.

📒 Files selected for processing (3)
  • src/components/AppLayout.jsx
  • src/components/CodeEditor.jsx
  • src/components/Footer.jsx

Comment on lines +92 to +102
const handleEditorMount = (editor) => {
editorRef.current = editor

// Listen to cursor position updates
editor.onDidChangeCursorPosition((e) => {
setCursorPos({
line: e.position.lineNumber,
column: e.position.column
})
})
}
Copy link
Copy Markdown
Contributor

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

Monaco cursor subscription is never disposed — memory leak risk.

The editor.onDidChangeCursorPosition() call returns an IDisposable that must be cleaned up when the component unmounts. Without disposal, the subscription keeps firing even after navigation, potentially calling setCursorPos on an unmounted component and leaking memory.

You'll need to store the disposable and clean it up via a useEffect return function.

🛠️ Suggested fix using useEffect cleanup
+  const cursorDisposableRef = useRef(null)
+
   const handleEditorMount = (editor) => {
     editorRef.current = editor
-    
-    // Listen to cursor position updates
-    editor.onDidChangeCursorPosition((e) => {
+
+    // Store disposable for cleanup
+    cursorDisposableRef.current = editor.onDidChangeCursorPosition((e) => {
       setCursorPos({
         line: e.position.lineNumber,
         column: e.position.column
       })
     })
   }
+
+  useEffect(() => {
+    return () => {
+      // Dispose cursor subscription on unmount
+      cursorDisposableRef.current?.dispose()
+    }
+  }, [])
📝 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 handleEditorMount = (editor) => {
editorRef.current = editor
// Listen to cursor position updates
editor.onDidChangeCursorPosition((e) => {
setCursorPos({
line: e.position.lineNumber,
column: e.position.column
})
})
}
const cursorDisposableRef = useRef(null)
const handleEditorMount = (editor) => {
editorRef.current = editor
// Store disposable for cleanup
cursorDisposableRef.current = editor.onDidChangeCursorPosition((e) => {
setCursorPos({
line: e.position.lineNumber,
column: e.position.column
})
})
}
useEffect(() => {
return () => {
// Dispose cursor subscription on unmount
cursorDisposableRef.current?.dispose()
}
}, [])
🤖 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 `@src/components/CodeEditor.jsx` around lines 92 - 102, The Monaco editor
cursor subscription created in handleEditorMount via
editor.onDidChangeCursorPosition(...) returns an IDisposable that must be saved
and disposed to avoid leaks; modify handleEditorMount (and/or add a useEffect)
to store the returned disposable (from editor.onDidChangeCursorPosition) on
editorRef or component state and dispose it in a cleanup function when the
component unmounts (call disposable.dispose()); ensure setCursorPos is only
called while mounted by disposing the subscription in the useEffect return so
the handler is removed on unmount.

@dhawneetg
Copy link
Copy Markdown
Author

@adityapaul26 see this

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Footer Bento Spotlight, Page Transitions & Editor Spotlight

2 participants