Skip to content

[FEATURE] Improve FAQ hover interaction and open state styling#6

Open
mi-vaishnavi wants to merge 1 commit intoAOSSIE-Org:mainfrom
mi-vaishnavi:feature/faq-hover-improvement
Open

[FEATURE] Improve FAQ hover interaction and open state styling#6
mi-vaishnavi wants to merge 1 commit intoAOSSIE-Org:mainfrom
mi-vaishnavi:feature/faq-hover-improvement

Conversation

@mi-vaishnavi
Copy link

@mi-vaishnavi mi-vaishnavi commented Feb 28, 2026

Fixes #5

Screenshots/Recordings:

Screenshot 2026-02-28 230727

Changes

  • Added subtle hover background effect to FAQ items
  • Updated border color to green when item is open
  • Improved interaction feedback and visual clarity

Summary by CodeRabbit

  • Style
    • Updated visual styling in the FAQ accordion component with refined transition effects and color handling for open/closed states. No functional changes to accordion behavior.

…o green

Signed-off-by: Vaishnavi <majojuvaishnavi@gmail.com>
@github-actions github-actions bot added enhancement New feature or request frontend Changes to frontend code javascript JavaScript/TypeScript code changes size/S Small PR (11-50 lines changed) first-time-contributor First PR of an external contributor pending-coderabbit-review labels Feb 28, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

Walkthrough

The FAQ component styling was updated to enhance visual interactions. Transitions were modified from transition-all to transition-colors, and conditional color classes were added for standardized border handling. These changes improve hover feedback without altering component logic or data structures.

Changes

Cohort / File(s) Summary
FAQ Accordion Styling
src/Pages/FaqPage/FAQ.tsx
Updated CSS transitions from transition-all to transition-colors, standardized border classes with conditional color handling, and normalized icon/background color states for improved hover interactions. No functional logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Suggested labels

Typescript Lang

Poem

🐰 A fluffy touch upon the hover state,
Where borders glow and colors animate,
Smooth transitions dance without delay,
The FAQ items brighten up the day!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: improving FAQ hover interaction and open state styling, which matches the core modifications to the FAQ component.
Linked Issues check ✅ Passed The PR implements all required features from issue #5: hover background effect, border color change for open state, and smooth transition animations.
Out of Scope Changes check ✅ Passed All changes in the FAQ component are directly related to implementing the hover interaction and open state styling requirements specified in issue #5.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

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

Copy link

@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 (3)
src/Pages/FaqPage/FAQ.tsx (3)

1-4: ⚠️ Potential issue | 🔴 Critical

Add "use client" directive for Next.js client component.

This file uses client-side React features (useState, useEffect, useRef) and framer-motion animations, which require client-side rendering. The "use client" directive must be added at the top of the file.

🔧 Add the "use client" directive
+"use client";
+
 // FAQ.tsx
 import React, { useState, useEffect, useRef } from "react";

As per coding guidelines, ensure that "use client" is being used for Next.js files with client-side features.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/FaqPage/FAQ.tsx` around lines 1 - 4, This file uses client-side
hooks (useState, useEffect, useRef) and framer-motion, so add the Next.js client
directive by inserting "use client" as the very first statement in the file
(before any imports) so the FAQ component and its use of motion/AnimatePresence
and hooks (e.g., the FAQ component that imports useState/useEffect/useRef and
motion/AnimatePresence) are rendered on the client.

35-40: 🧹 Nitpick | 🔵 Trivial

Consider using useMemo instead of useState for immutable derived value.

The darkMode value is derived from localStorage and never updated via the setter. Since this value is computed once and remains constant, useMemo would be more semantically appropriate than useState.

♻️ Refactor to use useMemo
-  const [darkMode,] = useState<boolean>(() => {
+  const darkMode = useMemo(() => {
     return (
       localStorage.getItem("darkMode") === "true" ||
       (!("darkMode" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)
     );
-  });
+  }, []);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/FaqPage/FAQ.tsx` around lines 35 - 40, The darkMode value is
computed once and never updated but currently uses useState; replace the
useState initializer with useMemo to reflect an immutable derived value: remove
the const [darkMode,] = useState<boolean>(...) and instead create const darkMode
= useMemo(() => { /* same localStorage and matchMedia logic */ }, []); keep the
same logic that checks localStorage.getItem("darkMode") and
window.matchMedia("(prefers-color-scheme: dark)").matches so behavior is
unchanged, and import useMemo at the top if not already present.

6-31: ⚠️ Potential issue | 🟠 Major

Externalize user-visible strings for internationalization.

All FAQ content (questions, answers) and UI strings are currently hardcoded in English. This prevents the application from being localized to other languages and violates internationalization best practices.

Consider using a solution like react-i18next or Next.js internationalization features to externalize these strings to resource files.

As per coding guidelines, user-visible strings should be externalized to resource files (i18n).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/FaqPage/FAQ.tsx` around lines 6 - 31, The hardcoded English strings
in the faqs array (the question and answer properties in FAQ.tsx) must be
externalized for i18n: create locale resource entries (e.g., en/faq.json) for
each question and answer key, import your i18n hook (e.g., useTranslation from
react-i18next) into FAQ.tsx, replace the literal question/answer values in the
faqs array with translation keys or functions (e.g., question:
t('faq.question1') or questionKey: 'faq.question1'), and update the code that
renders each FAQ to call t(...) to fetch the localized text; keep the icon JSX
(Tag, Lock, Globe) unchanged. Ensure all new keys are added to the resource
files and referenced consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/Pages/FaqPage/FAQ.tsx`:
- Around line 62-63: In the FAQ component (FAQ in src/Pages/FaqPage/FAQ.tsx)
replace the stray product name "PictoCopy" in the description string with the
correct name "PictoPy"; locate the JSX text node that currently reads
"Everything you need to know about PictoCopy's smart photo organization and
AI-powered tagging features." and update it to "Everything you need to know
about PictoPy's smart photo organization and AI-powered tagging features."
- Around line 99-104: The conditional className for the FAQ item's container
uses isOpen but applies dark:border-gray-500 for the open state; update the JSX
in FAQ.tsx (the className block that checks isOpen) so the open-state dark mode
uses a green border (e.g., replace dark:border-gray-500 with
dark:border-green-400 or another green token) while leaving the closed-state
classes unchanged.

---

Outside diff comments:
In `@src/Pages/FaqPage/FAQ.tsx`:
- Around line 1-4: This file uses client-side hooks (useState, useEffect,
useRef) and framer-motion, so add the Next.js client directive by inserting "use
client" as the very first statement in the file (before any imports) so the FAQ
component and its use of motion/AnimatePresence and hooks (e.g., the FAQ
component that imports useState/useEffect/useRef and motion/AnimatePresence) are
rendered on the client.
- Around line 35-40: The darkMode value is computed once and never updated but
currently uses useState; replace the useState initializer with useMemo to
reflect an immutable derived value: remove the const [darkMode,] =
useState<boolean>(...) and instead create const darkMode = useMemo(() => { /*
same localStorage and matchMedia logic */ }, []); keep the same logic that
checks localStorage.getItem("darkMode") and
window.matchMedia("(prefers-color-scheme: dark)").matches so behavior is
unchanged, and import useMemo at the top if not already present.
- Around line 6-31: The hardcoded English strings in the faqs array (the
question and answer properties in FAQ.tsx) must be externalized for i18n: create
locale resource entries (e.g., en/faq.json) for each question and answer key,
import your i18n hook (e.g., useTranslation from react-i18next) into FAQ.tsx,
replace the literal question/answer values in the faqs array with translation
keys or functions (e.g., question: t('faq.question1') or questionKey:
'faq.question1'), and update the code that renders each FAQ to call t(...) to
fetch the localized text; keep the icon JSX (Tag, Lock, Globe) unchanged. Ensure
all new keys are added to the resource files and referenced consistently.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1496367 and 7eb25c9.

📒 Files selected for processing (1)
  • src/Pages/FaqPage/FAQ.tsx

Comment on lines +62 to 63
Everything you need to know about PictoCopy's smart photo organization
and AI-powered tagging features.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix typo: "PictoCopy" should be "PictoPy".

The description text contains "PictoCopy" which should be "PictoPy" to match the application name used throughout the codebase.

✏️ Fix the typo
-            Everything you need to know about PictoCopy's smart photo organization
+            Everything you need to know about PictoPy's smart photo organization
             and AI-powered tagging features.
📝 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
Everything you need to know about PictoCopy's smart photo organization
and AI-powered tagging features.
Everything you need to know about PictoPy's smart photo organization
and AI-powered tagging features.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/FaqPage/FAQ.tsx` around lines 62 - 63, In the FAQ component (FAQ in
src/Pages/FaqPage/FAQ.tsx) replace the stray product name "PictoCopy" in the
description string with the correct name "PictoPy"; locate the JSX text node
that currently reads "Everything you need to know about PictoCopy's smart photo
organization and AI-powered tagging features." and update it to "Everything you
need to know about PictoPy's smart photo organization and AI-powered tagging
features."

Comment on lines +99 to +104
className={`rounded-xl overflow-hidden transition-colors duration-200 bg-white dark:bg-black border
hover:bg-gray-100 dark:hover:bg-gray-800
${isOpen
? 'border-2 border-green-400 dark:border-gray-500'
: 'border-2 border-gray-200 dark:border-gray-700'}
`}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Dark mode open state border should be green, not gray.

The PR objective states that the border color should change to green when an FAQ item is open. While the light mode correctly uses border-green-400, the dark mode uses dark:border-gray-500 instead of a green variant. This creates an inconsistent experience between light and dark modes.

🎨 Apply green border in dark mode for open state
       className={`rounded-xl overflow-hidden transition-colors duration-200 bg-white dark:bg-black border
                     hover:bg-gray-100 dark:hover:bg-gray-800
       ${isOpen
-          ? 'border-2 border-green-400 dark:border-gray-500'
+          ? 'border-2 border-green-400 dark:border-green-500'
           : 'border-2 border-gray-200 dark:border-gray-700'}
       `}
📝 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
className={`rounded-xl overflow-hidden transition-colors duration-200 bg-white dark:bg-black border
hover:bg-gray-100 dark:hover:bg-gray-800
${isOpen
? 'border-2 border-green-400 dark:border-gray-500'
: 'border-2 border-gray-200 dark:border-gray-700'}
`}
className={`rounded-xl overflow-hidden transition-colors duration-200 bg-white dark:bg-black border
hover:bg-gray-100 dark:hover:bg-gray-800
${isOpen
? 'border-2 border-green-400 dark:border-green-500'
: 'border-2 border-gray-200 dark:border-gray-700'}
`}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/FaqPage/FAQ.tsx` around lines 99 - 104, The conditional className
for the FAQ item's container uses isOpen but applies dark:border-gray-500 for
the open state; update the JSX in FAQ.tsx (the className block that checks
isOpen) so the open-state dark mode uses a green border (e.g., replace
dark:border-gray-500 with dark:border-green-400 or another green token) while
leaving the closed-state classes unchanged.

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

Labels

enhancement New feature or request first-time-contributor First PR of an external contributor frontend Changes to frontend code javascript JavaScript/TypeScript code changes pending-coderabbit-review size/S Small PR (11-50 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add hover interaction to FAQ accordion items

1 participant