Skip to content

feat: add dedicated FAQ page and navigation link#134

Open
YLaxmikanth wants to merge 1 commit into
jpdevhub:mainfrom
YLaxmikanth:issue-123-faq-page
Open

feat: add dedicated FAQ page and navigation link#134
YLaxmikanth wants to merge 1 commit into
jpdevhub:mainfrom
YLaxmikanth:issue-123-faq-page

Conversation

@YLaxmikanth

@YLaxmikanth YLaxmikanth commented Jun 22, 2026

Copy link
Copy Markdown

Description

Closes #123

What was implemented

  • Added a dedicated FAQ page at /faq

  • Created an accordion-style FAQ interface for better user guidance

  • Added explanations for:

    • Proper fish positioning during scanning
    • Freshness score interpretation
    • Market Map usage
  • Added a FAQ navigation link in the navbar

  • Integrated the FAQ page into the application routing

Validation

  • Successfully built the project using npm run build
  • Verified that the /faq route loads correctly
  • Confirmed accordion functionality works as expected
  • Confirmed navigation to the FAQ page through the navbar

Screenshots

image

Summary by CodeRabbit

  • New Features
    • Added a new FAQ page accessible through the main navigation menu
    • FAQ entries are displayed in an expandable accordion format with icons and descriptions
    • Users can click individual FAQ items to expand or collapse the answer text

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@YLaxmikanth is attempting to deploy a commit to the karan3431's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

🎉 Thank you for your Pull Request! We're thrilled to have your contribution to FreshScan AI.

Before we review, please make sure you have:

  • Followed the CONTRIBUTING.md guidelines.
  • Ensured all automated CI checks (linting, tests) are passing.
  • Checked that your commit messages follow the Conventional Commits format.

A maintainer will review your code as soon as possible!

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid input: expected object, received boolean at "reviews.auto_review"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

A new FAQPage component is added as an accordion-style page at /faq. It renders a hardcoded list of FAQ entries, toggling expansion via openIndex state. The route is registered in App.tsx and a navbar link is added in Navbar.tsx.

Changes

FAQ Page Feature

Layer / File(s) Summary
FAQPage accordion component
src/pages/FAQPage.tsx
Defines the faqs dataset (title, icon, content), initializes openIndex state at 0, and renders a button-driven accordion where clicking toggles the active item, rotates the chevron, and conditionally shows the answer text.
Route registration and navbar link
src/App.tsx, src/components/Navbar.tsx
Imports FAQPage and registers a /faq route inside the existing Layout-wrapped Routes; adds a "FAQ" entry to the Navbar's links array. Note: Navbar.tsx gains an extra closing } at EOF (line 172–173), which warrants a syntax check.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A bunny asked, "How fresh is this fish?"
So I hopped and I coded a wish —
An accordion neat,
With chevrons that tweet,
Now /faq answers every dish! 🐟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 and concisely summarizes the main change: adding a FAQ page with a navigation link, which is the primary focus of the changeset.
Linked Issues check ✅ Passed All requirements from issue #123 are met: new route at /faq, accordion-style component, and three FAQ sections on fish positioning, freshness scores, and Market Map usage.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the FAQ feature requested in issue #123; no unrelated modifications were introduced.

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

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

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
src/components/Navbar.tsx (1)

57-62: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep the new nav item on the i18n path.

Line 61 hardcodes "FAQ" while sibling links use t(...); this creates mixed-language navbar behavior after language switching.

Suggested fix
   const links = [
     { to: '/', label: t('home') },
     { to: '/scanner', label: t('scanner') },
     { to: '/map', label: t('trustMap') },
-    { to: '/faq', label: 'FAQ' },
+    { to: '/faq', label: t('faq') },
   ];
🤖 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/Navbar.tsx` around lines 57 - 62, The FAQ link in the links
array within the Navbar component uses a hardcoded string 'FAQ' instead of the
translation function t() like the other navigation items (home, scanner,
trustMap). Replace the hardcoded 'FAQ' label with t('faq') to ensure consistent
translation behavior across all navigation items when users switch languages.
🤖 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/pages/FAQPage.tsx`:
- Around line 52-77: The accordion button element is missing ARIA attributes
required for proper accessibility. Add an aria-expanded attribute to the button
that reflects the open state (true when openIndex equals index, false
otherwise), add a unique id to the content div that displays when the accordion
is expanded, and add an aria-controls attribute to the button that references
the content div's id. This enables assistive technologies to properly announce
the expanded/collapsed state and understand the relationship between the control
button and the content panel.

---

Outside diff comments:
In `@src/components/Navbar.tsx`:
- Around line 57-62: The FAQ link in the links array within the Navbar component
uses a hardcoded string 'FAQ' instead of the translation function t() like the
other navigation items (home, scanner, trustMap). Replace the hardcoded 'FAQ'
label with t('faq') to ensure consistent translation behavior across all
navigation items when users switch languages.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5dc6fe53-128a-43c9-894f-93d541c6ce36

📥 Commits

Reviewing files that changed from the base of the PR and between 3f1987d and ab1737f.

📒 Files selected for processing (3)
  • src/App.tsx
  • src/components/Navbar.tsx
  • src/pages/FAQPage.tsx

Comment thread src/pages/FAQPage.tsx
Comment on lines +52 to +77
<button
className="w-full p-5 flex items-center justify-between text-left"
onClick={() =>
setOpenIndex(openIndex === index ? null : index)
}
>
<div className="flex items-center gap-3">
<faq.icon size={20} className="text-neon" />
<span className="font-semibold">{faq.title}</span>
</div>

<ChevronDown
size={18}
className={`transition-transform ${
openIndex === index ? "rotate-180" : ""
}`}
/>
</button>

{openIndex === index && (
<div className="px-5 pb-5">
<p className="text-on-surface-variant">
{faq.content}
</p>
</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

Add ARIA state/linkage for the accordion controls.

Line 52 renders interactive disclosure controls, but the button/panel pair has no aria-expanded/aria-controls + id linkage, so assistive tech can’t reliably interpret expanded state.

Suggested fix
           {faqs.map((faq, index) => (
+            const panelId = `faq-panel-${index}`;
+            const buttonId = `faq-button-${index}`;
+            return (
             <div
               key={index}
               className="bg-surface-mid hover:bg-surface-high transition-colors duration-200"
             >
               <button
+                id={buttonId}
                 className="w-full p-5 flex items-center justify-between text-left"
+                aria-expanded={openIndex === index}
+                aria-controls={panelId}
                 onClick={() =>
                   setOpenIndex(openIndex === index ? null : index)
                 }
               >
@@
-              {openIndex === index && (
-                <div className="px-5 pb-5">
+              {openIndex === index && (
+                <div
+                  id={panelId}
+                  role="region"
+                  aria-labelledby={buttonId}
+                  className="px-5 pb-5"
+                >
                   <p className="text-on-surface-variant">
                     {faq.content}
                   </p>
                 </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 `@src/pages/FAQPage.tsx` around lines 52 - 77, The accordion button element is
missing ARIA attributes required for proper accessibility. Add an aria-expanded
attribute to the button that reflects the open state (true when openIndex equals
index, false otherwise), add a unique id to the content div that displays when
the accordion is expanded, and add an aria-controls attribute to the button that
references the content div's id. This enables assistive technologies to properly
announce the expanded/collapsed state and understand the relationship between
the control button and the content panel.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add a How to Use / FAQ Page

1 participant