Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import GitHubIntelligencePage from "./pages/GitHubIntelligencePage";
import GitHubCallbackPage from "./pages/GitHubCallbackPage";
import ProtectedRoute from "./components/shared/ProtectedRoute";
import PublicRoute from "./components/shared/PublicRoute";

import FAQ from "./pages/FAQ";

import FAQSection from "./components/explore/FAQSection";
export default function App() {
return (
Expand Down Expand Up @@ -80,6 +83,10 @@ export default function App() {
</PublicRoute>
}
/>

<Route
path="/faq" element={<FAQ />} />

<Route path="/explore" element={<ExplorePage />} />
{/* GitHub OAuth callback — must be public, no auth required */}
<Route path="/auth/github/callback" element={<GitHubCallbackPage />} />
Expand Down
118 changes: 118 additions & 0 deletions frontend/src/pages/FAQ.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import {useState} from "react";

function FAQ(){

const faq=[
{
category: "GENERAL",
ques: "What is CodeLens?",
answer: " CodeLens is basically a developer platform. CodeLens aggregates your GitHub, LeetCode, and Codeforces data into a single AI-powered command center that tells you exactly what to learn next.",
},
{
category: "GENERAL",
ques: "How does Codelens help developers?",
answer: " It helps users track coding progresses, analyze profiles, explore various contests, and improve problem-solving consistency across multiple coding platforms",
},
{
category: "GENERAL",
ques: "What are different platform integrated with CodeLens?",
answer: "CodeLens currently supports integrations and tracking with platforms like LeetCode, Codeforces , Codechef, Git and Github",
},
{
category: "TOOLS",
ques: "Which type of tools are provided?",
answer: "CodeLens offers AI-powered developer tools",
},
{
category: "TOOLS",
ques: "What is Vela AI used for?",
answer: "Vela AI helps developers receive intelligent coding guidance, recommendations, and assistance inside the CodeLens platform.",
},
{
category:"TOOLS",
ques: "How does Apex AI improve coding preparation?",
answer: "Apex AI analyzes user activity and provides insights , recommendations, and learning assistance for competitive programming improvement.",
},
{
category: "CONTESTS",
ques: "Are upcoming coding constests tracked on CodeLens?",
answer: "YES. CodeLens provides constest tracking for multiple competitive programming platform in one centralized interface.",
},
{
category: "DASHBOARD",
ques: "What insights are available in the dashboard? ",
answer: "The dashboard helps users monitor coing activity, platform statistics and progress across the platforms used in one place.",
},
];
Comment on lines +5 to +46
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Extract FAQ data to a separate constant or file.

The FAQ data array is currently defined inside the component, which reduces reusability and makes testing harder. Consider moving it outside the component or to a separate faqData.js file.

♻️ Suggested refactor

Option 1: Move above the component in the same file:

 import {useState} from "react";

+const FAQ_DATA = [
+  {
+    category: "GENERAL",
+    ques: "What is CodeLens?",
+    answer: "CodeLens is basically a developer platform...",
+  },
+  // ... rest of FAQ items
+];
+
 function FAQ(){
-    const faq=[
-    {
-        category: "GENERAL",
-        ques: "What is CodeLens?",
-        answer: " CodeLens is basically...",
-    },
-    // ... rest of FAQ items
-];
+    const faq = FAQ_DATA;

Option 2: Extract to frontend/src/data/faqData.js:

// frontend/src/data/faqData.js
export const FAQ_DATA = [
  {
    category: "GENERAL",
    ques: "What is CodeLens?",
    answer: "CodeLens is basically a developer platform...",
  },
  // ... rest of FAQ items
];

Then import in FAQ.jsx:

 import {useState} from "react";
+import {FAQ_DATA} from "../data/faqData";

 function FAQ(){
-    const faq=[
-      // ... FAQ items
-    ];
+    const faq = FAQ_DATA;
🤖 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 `@frontend/src/pages/FAQ.jsx` around lines 5 - 46, The FAQ array named faq in
FAQ.jsx should be extracted out of the component to improve reusability and
testability; create a new module (e.g., frontend/src/data/faqData.js) that
exports the constant (e.g., FAQ_DATA) containing the current objects, or move
the faq constant to the top-level of FAQ.jsx above the component, then replace
the in-file definition with an import or reference to FAQ_DATA and update any
references inside the component accordingly (search for the variable name faq
inside the component to locate usages).

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix leading spaces in answer strings and correct typos.

Several FAQ answers have leading spaces that will display awkwardly, and there are typos in user-facing content:

Leading spaces in lines 9, 14, 19, 24, 29, 34, 39, 44 - remove the space at the start of each answer string.

Typos to fix:

  • Line 38: "constests" → "contests"
  • Line 39: "constest" → "contest"
  • Line 44: "coing" → "coding"
📝 Proposed fixes
     {
         category: "GENERAL",
         ques: "What is CodeLens?",
-        answer: " CodeLens is basically a developer platform. CodeLens aggregates your GitHub, LeetCode, and Codeforces data into a single AI-powered command center that tells you exactly what to learn next.",
+        answer: "CodeLens is basically a developer platform. CodeLens aggregates your GitHub, LeetCode, and Codeforces data into a single AI-powered command center that tells you exactly what to learn next.",
     },
     {
         category: "GENERAL",
         ques: "How does Codelens help developers?",
-        answer: " It helps users track coding progresses, analyze profiles, explore various contests, and improve problem-solving consistency across multiple coding platforms",
+        answer: "It helps users track coding progresses, analyze profiles, explore various contests, and improve problem-solving consistency across multiple coding platforms",
     },
     { 
         category: "GENERAL",
         ques: "What are different platform integrated with CodeLens?",
-        answer: "CodeLens currently supports integrations and tracking with platforms like LeetCode, Codeforces , Codechef, Git and Github",
+        answer: "CodeLens currently supports integrations and tracking with platforms like LeetCode, Codeforces, Codechef, Git and Github",
     },
     {
         category: "TOOLS",
         ques: "Which type of tools are provided?",
-        answer: "CodeLens offers AI-powered developer tools",
+        answer: "CodeLens offers AI-powered developer tools",
     },
     {
         category: "TOOLS",
         ques: "What is Vela AI used for?",
-        answer: "Vela AI helps developers receive intelligent coding guidance, recommendations, and assistance inside the CodeLens platform.",
+        answer: "Vela AI helps developers receive intelligent coding guidance, recommendations, and assistance inside the CodeLens platform.",
     },
     {
         category:"TOOLS",
         ques: "How does Apex AI improve coding preparation?",
-        answer: "Apex AI analyzes user activity and provides insights , recommendations, and learning assistance for competitive programming improvement.",
+        answer: "Apex AI analyzes user activity and provides insights, recommendations, and learning assistance for competitive programming improvement.",
     },
     {
         category: "CONTESTS",
-        ques: "Are upcoming coding constests tracked on CodeLens?",
-        answer: "YES. CodeLens provides constest tracking for multiple competitive programming platform in one centralized interface.",
+        ques: "Are upcoming coding contests tracked on CodeLens?",
+        answer: "YES. CodeLens provides contest tracking for multiple competitive programming platform in one centralized interface.",
     },
     {
         category: "DASHBOARD",
         ques: "What insights are available in the dashboard? ",
-        answer: "The dashboard helps users monitor coing activity, platform statistics and progress across the platforms used in one place.",
+        answer: "The dashboard helps users monitor coding activity, platform statistics and progress across the platforms used in one place.",
     },
🤖 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 `@frontend/src/pages/FAQ.jsx` around lines 5 - 46, The faq array contains
answer strings with accidental leading spaces and a few typos; remove any
leading space characters at the start of each answer value in the faq entries
and correct the text mistakes: in the entry with ques "Are upcoming coding
constests tracked on CodeLens?" change "constests" → "contests" and "constest" →
"contest", and in the entry with ques "What insights are available in the
dashboard? " change "coing" → "coding"; update the relevant answer strings in
the faq constant accordingly (locate by the ques values above).


const [selectedCategory, setSelectedCategory] = useState("GENERAL");
const[openQuestion, setOpenQuestion]=useState(null);

return(
<div
className="min-h-screen p-8">
<h1 className="text-5xl font-bold">
FREQUENTLY ASKED QUESTIONS
</h1>
<p className="mt-4 text-gray-500">
Find answers about CodeLens: tools, contests, accounts and features
</p>

<div
className="flex gap-4 mt-10">
<button onMouseEnter={() => setSelectedCategory("GENERAL")}>
GENERAL
</button>
<button onMouseEnter={() => setSelectedCategory("TOOLS")}>
TOOLS
</button>
<button onMouseEnter={() => setSelectedCategory("CONTESTS")}>
CONTESTS
</button>
<button onMouseEnter={() => setSelectedCategory("DASHBOARD")}>
DASHBOARD
</button>
Comment on lines +63 to +74
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 onMouseEnter with onClick for category selection.

Using onMouseEnter for category switching creates severe usability and accessibility problems:

  • Accidental hovers change content unexpectedly
  • No keyboard navigation support (violates WCAG 2.1.1)
  • Touch devices cannot hover
  • Users cannot see category content before committing to selection
♿ Proposed accessibility fix
-                <button onMouseEnter={() => setSelectedCategory("GENERAL")}>
+                <button onClick={() => setSelectedCategory("GENERAL")}>
                     GENERAL
                 </button>
-                <button onMouseEnter={() => setSelectedCategory("TOOLS")}>
+                <button onClick={() => setSelectedCategory("TOOLS")}>
                     TOOLS
                 </button>
-                <button onMouseEnter={() => setSelectedCategory("CONTESTS")}>
+                <button onClick={() => setSelectedCategory("CONTESTS")}>
                     CONTESTS
                 </button>
-                <button onMouseEnter={() => setSelectedCategory("DASHBOARD")}>
+                <button onClick={() => setSelectedCategory("DASHBOARD")}>
                     DASHBOARD
                 </button>
📝 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
<button onMouseEnter={() => setSelectedCategory("GENERAL")}>
GENERAL
</button>
<button onMouseEnter={() => setSelectedCategory("TOOLS")}>
TOOLS
</button>
<button onMouseEnter={() => setSelectedCategory("CONTESTS")}>
CONTESTS
</button>
<button onMouseEnter={() => setSelectedCategory("DASHBOARD")}>
DASHBOARD
</button>
<button onClick={() => setSelectedCategory("GENERAL")}>
GENERAL
</button>
<button onClick={() => setSelectedCategory("TOOLS")}>
TOOLS
</button>
<button onClick={() => setSelectedCategory("CONTESTS")}>
CONTESTS
</button>
<button onClick={() => setSelectedCategory("DASHBOARD")}>
DASHBOARD
</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 `@frontend/src/pages/FAQ.jsx` around lines 63 - 74, The category buttons
currently use onMouseEnter which causes accessibility/usability issues; replace
the onMouseEnter handlers with onClick handlers on the same button elements so
setSelectedCategory("GENERAL"/"TOOLS"/"CONTESTS"/"DASHBOARD") is called on
click, and ensure the existing button elements retain keyboard focusability and
visible focus styles (no additional role changes required because they are
native <button> elements).

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Add styling to category buttons.

The category buttons have no className attributes, so they will render as unstyled, making the interface appear broken and buttons unrecognizable.

🎨 Proposed styling fix
         <div
             className="flex gap-4 mt-10">
-                <button onMouseEnter={() => setSelectedCategory("GENERAL")}>
+                <button 
+                    onMouseEnter={() => setSelectedCategory("GENERAL")}
+                    className={`px-6 py-2 rounded-lg font-semibold transition-colors ${
+                        selectedCategory === "GENERAL" 
+                            ? "bg-blue-600 text-white" 
+                            : "bg-gray-200 text-gray-700 hover:bg-gray-300"
+                    }`}
+                >
                     GENERAL
                 </button>
-                <button onMouseEnter={() => setSelectedCategory("TOOLS")}>
+                <button 
+                    onMouseEnter={() => setSelectedCategory("TOOLS")}
+                    className={`px-6 py-2 rounded-lg font-semibold transition-colors ${
+                        selectedCategory === "TOOLS" 
+                            ? "bg-blue-600 text-white" 
+                            : "bg-gray-200 text-gray-700 hover:bg-gray-300"
+                    }`}
+                >
                     TOOLS
                 </button>
-                <button onMouseEnter={() => setSelectedCategory("CONTESTS")}>
+                <button 
+                    onMouseEnter={() => setSelectedCategory("CONTESTS")}
+                    className={`px-6 py-2 rounded-lg font-semibold transition-colors ${
+                        selectedCategory === "CONTESTS" 
+                            ? "bg-blue-600 text-white" 
+                            : "bg-gray-200 text-gray-700 hover:bg-gray-300"
+                    }`}
+                >
                     CONTESTS
                 </button>
-                <button onMouseEnter={() => setSelectedCategory("DASHBOARD")}>
+                <button 
+                    onMouseEnter={() => setSelectedCategory("DASHBOARD")}
+                    className={`px-6 py-2 rounded-lg font-semibold transition-colors ${
+                        selectedCategory === "DASHBOARD" 
+                            ? "bg-blue-600 text-white" 
+                            : "bg-gray-200 text-gray-700 hover:bg-gray-300"
+                    }`}
+                >
                     DASHBOARD
                 </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 `@frontend/src/pages/FAQ.jsx` around lines 63 - 74, The category buttons
currently render unstyled; add className attributes and active-state classes so
they get CSS styling and show selection. For each button that calls
setSelectedCategory (e.g., the buttons for "GENERAL", "TOOLS", "CONTESTS",
"DASHBOARD"), add a base class like "faq-category-button" and conditionally add
an "active" or "selected" class when selectedCategory === "GENERAL"/"TOOLS"/...;
ensure styles exist in the corresponding CSS/SCSS (or module) to handle base,
:hover, and .active states and consider also adding an onClick handler and
aria-pressed attribute tied to selectedCategory for keyboard/accessibility.



</div>

<div
className="mt-10 space-y-4">
{faq
.filter((item)=> item.category===selectedCategory)
.map((item,index)=>(
<div
key={index}
onClick={()=>
setOpenQuestion(
openQuestion ===index?null:index
)
}
className="border rounded-2xl p-5 cursor-pointer hover:shadow-lg transition-all duration-300"
>
<div className="flex justify-between items-center">
<h2 className="text-2xl font-semibold">
{item.ques}
</h2>
<span className="text-3xl">
{openQuestion===index?"-":"+"}
</span>
</div>

{openQuestion ===index &&(
<p className="mt-3 text-gray-600">
{item.answer}
</p>

)}

</div>

))}
</div>
</div>

);
};

export default FAQ;
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.