Skip to content

feat(seo/ux): add title on each page#154

Open
anujsharma8d wants to merge 7 commits into
kunalverma2512:mainfrom
anujsharma8d:feat/title
Open

feat(seo/ux): add title on each page#154
anujsharma8d wants to merge 7 commits into
kunalverma2512:mainfrom
anujsharma8d:feat/title

Conversation

@anujsharma8d

@anujsharma8d anujsharma8d commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📌 Pull Request Summary

🔗 Related Issue

Closes #152


📝 Description

This PR adds title tags on each page.

Changes Made

  • Added title tags on each page

Motivation

Every page in the CodeLens frontend currently shows "CodeLens" as the browser tab title so with this change each page will have a unique title


🚀 Type of Change

Select all that apply:

  • New Feature
  • Enhancement

Video

Recording.2026-06-03.151449.mp4

Images

Initial - Every page have same title i.e. CodeLens
Initial.pdf

Final - Every page have their own title

Before Login :
Final - Before Login.pdf

After Login :

Final - After Login.pdf


🧪 Testing

Verification

  • Tested Locally
  • No Testing Required

✅ Checklist

  • I have read and followed the contribution guidelines.
  • I have self-reviewed my changes.
  • My changes are limited to the scope of this issue.
  • No unnecessary files or unrelated changes have been included.
  • The related issue has been linked correctly.

Summary by CodeRabbit

  • New Features

    • Added GitHub connection completion flow with automatic status detection and user data refresh upon successful connection.
  • Chores

    • Updated all page components with semantic HTML structure (<main> elements) and browser tab titles for improved accessibility and navigation.

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

@anujsharma8d is attempting to deploy a commit to the Kunal Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds unique page-level <title> tags and semantic <main> wrappers across 16 frontend pages for SEO and tab discoverability. It also implements GitHub OAuth callback handling in AccountCenterPage that reads connection status from URL params, shows a success banner, refreshes user data, and cleans the URL.

Changes

Page Titles and Semantic Structure

Layer / File(s) Summary
GitHub auth callback and AccountCenter UI updates
frontend/src/pages/AccountCenterPage.jsx
Adds useEffect that reads githubStatus/githubUsername from search params, displays success banner on connection, calls refreshUser(), and cleans the URL via window.history.replaceState. Also reformats JSX in AuthMethodCard, GitHubCard, CodeforcesCard, and DangerZone, plus wraps the page in <main> with <title>.
Page title and main wrapper pattern across pages
frontend/src/pages/{AlgoVersePage, ApexAIPage, ApexWorkspacePage, BugReportsPage, ContestAtCoderPage, ContestCodeChefPage, ContestCodeforcesPage, ContestLeetCodePage, DashboardPage, ExplorePage, LandingPage, LoginPage, NotFoundPage, PracticePage, SignupPage, TermsPage, CodeforcesPage, GitHubIntelligencePage}.jsx
Adds <main> semantic wrappers and unique <title> tags to 15 page components; applies JSX formatting refactors (attribute/prop line breaks, key/className placement) without altering conditional logic or data bindings. CodeforcesPage and GitHubIntelligencePage handle multiple render branches; GitHubIntelligencePage introduces a reusable pageTitle constant.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement, Frontend, GSSoC26, UI/UX, level:intermediate, quality:clean, type:feature, gssoc:approved, mentor:kunalverma2512

Poem

🐰 From tab-to-tab confusion, we hop away free,
Each page now shows its own identity!
OAuth flows smoothly, like carrots in a row,
SEO and usability—watch the metrics grow! 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.83% 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
Title check ✅ Passed The title 'feat(seo/ux): add title on each page' clearly and concisely summarizes the main change—adding title tags to frontend pages for SEO/UX improvements.
Description check ✅ Passed The description follows the template structure with Related Issue (#152), clear motivation, changes made, type of change selected, testing notes, and completion of the checklist items.
Linked Issues check ✅ Passed The PR successfully implements issue #152 by adding unique <title> tags across all 20 page components with the format '{Page Name} - CodeLens', covering normal and all fallback render paths (loading/error states), and uses React 19 native title hoisting without external libraries.
Out of Scope Changes check ✅ Passed All changes are scoped to adding <title> elements to page components; minor JSX formatting adjustments are incidental to wrapping content in elements and do not constitute out-of-scope changes.

✏️ 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.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

🚀 PR Received Successfully

Hello @anujsharma8d,

Thank you for taking the initiative to contribute to this project.

Please ensure that your PR follows all project guidelines properly before requesting review.

⚠️ Important Instructions

  • Maintain proper code quality and structure
  • Do not make unnecessary changes/files
  • Ensure responsiveness across devices
  • Follow existing project conventions strictly
  • Attach screenshots/videos for UI-related changes
  • Resolve merge conflicts before requesting review
  • Avoid AI-generated low quality PRs or copied implementations

📌 Mandatory for GSSoC'26 Participants

Joining the community group and announcement channel is compulsory for all contributors participating through GSSoC'26.

Failure to follow contribution guidelines may lead to PR rejection.

We appreciate your effort and wish you a great open-source journey ahead. ✨

@anujsharma8d anujsharma8d mentioned this pull request Jun 3, 2026
11 tasks
@kunalverma2512

Copy link
Copy Markdown
Owner

@anujsharma8d add screenshot of every sections of explore page and loom video or video via drive link to showcase what you have done

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

🧹 Nitpick comments (2)
frontend/src/pages/AccountCenterPage.jsx (1)

356-368: ⚡ Quick win

GitHub callback logic looks solid, but consider error handling.

The callback handling correctly reads query params, displays the success banner, refreshes the user session, and cleans the URL. However, the empty catch block on line 364 silently swallows any errors from refreshUser(). Consider logging the error for debugging purposes, even if it's non-critical.

Additionally, refreshUser should be included in the useEffect dependency array (line 368) to satisfy ESLint's exhaustive-deps rule, even though it's likely stable due to useCallback memoization in AuthContext.

🔍 Suggested improvements
     if (status === "connected") {
       setBanner(`GitHub account @${username || "connected"} linked successfully!`);
       // Refresh user profile via /auth/me so the card shows the new GitHub identity
       // WITHOUT needing a full page refresh
-      refreshUser().catch(() => { });
+      refreshUser().catch((err) => {
+        console.error("Failed to refresh user after GitHub connect:", err);
+      });
       // Clean URL
       window.history.replaceState({}, "", "/account-center");
     }
-  }, [searchParams]);
+  }, [searchParams, refreshUser]);
🤖 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/AccountCenterPage.jsx` around lines 356 - 368, The catch
block swallowing errors from refreshUser() should log the error and refreshUser
should be added to the useEffect dependency array; update the effect that reads
githubStatus/githubUsername to call refreshUser().catch(err =>
console.error(...)) (or use the app logger) instead of an empty catch, and
include refreshUser in the dependency list along with searchParams so ESLint
exhaustive-deps is satisfied; keep the existing setBanner,
window.history.replaceState, and searchParams logic unchanged.
frontend/src/pages/PrivacyPage.jsx (1)

3-4: 💤 Low value

Consider using Fragment wrapper for clearer semantics.

React 19 will correctly hoist the <title> regardless of placement, but placing it inside <main> in the JSX source can be semantically confusing. For clarity, consider:

♻️ Optional refactor for semantic clarity
 export default function PrivacyPage() {
     return(
-        <main>
+        <>
             <title>Privacy Policy - CodeLens</title>
+        <main>
         <section>
             <div className="m-20">
                 <p className="text-center text-black font-black text-2xl uppercase tracking-widest underline underline-offset-8 decoration-[3px]">Privacy Policy</p>
                 <p className="text-center text-black mt-6">
                     This is placeholder text. Replace with actual policies later.
                 </p>
             </div>
         </section>
         </main>
+        </>
     );
 }

This places <title> outside the <main> landmark in the JSX tree, making the semantic structure clearer to developers while maintaining identical runtime behavior.

Also applies to: 13-13

🤖 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/PrivacyPage.jsx` around lines 3 - 4, The <title> element
is currently inside the <main> landmark which is semantically confusing; in the
PrivacyPage component, move the <title> out of the <main> and wrap the returned
JSX with a React fragment (<>...</>) so the <title> sits at the top-level
sibling of <main>, preserving runtime behavior while making the JSX semantics
clearer.
🤖 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 `@frontend/src/pages/CodeforcesPage.jsx`:
- Line 363: Update the page title string in the CodeforcesPage component: change
the <title> content from "Codeforces - Codelens" to "Codeforces - CodeLens"
(capital L) so the branding matches other pages; locate the <title> element in
CodeforcesPage.jsx and replace the typo accordingly.

In `@frontend/src/pages/ContestCodeChefPage.jsx`:
- Line 38: The page title string in ContestCodeChefPage.jsx is misspelled as
"CodeChef Constests"; update the title element (the <title> string in the
component) to read "CodeChef Contests" so the page metadata displays the correct
spelling.

---

Nitpick comments:
In `@frontend/src/pages/AccountCenterPage.jsx`:
- Around line 356-368: The catch block swallowing errors from refreshUser()
should log the error and refreshUser should be added to the useEffect dependency
array; update the effect that reads githubStatus/githubUsername to call
refreshUser().catch(err => console.error(...)) (or use the app logger) instead
of an empty catch, and include refreshUser in the dependency list along with
searchParams so ESLint exhaustive-deps is satisfied; keep the existing
setBanner, window.history.replaceState, and searchParams logic unchanged.

In `@frontend/src/pages/PrivacyPage.jsx`:
- Around line 3-4: The <title> element is currently inside the <main> landmark
which is semantically confusing; in the PrivacyPage component, move the <title>
out of the <main> and wrap the returned JSX with a React fragment (<>...</>) so
the <title> sits at the top-level sibling of <main>, preserving runtime behavior
while making the JSX semantics clearer.
🪄 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

Run ID: 74046722-8131-4400-9172-d2b6be3fc7b1

📥 Commits

Reviewing files that changed from the base of the PR and between 2b0506e and 7e4694c.

📒 Files selected for processing (20)
  • frontend/src/pages/AccountCenterPage.jsx
  • frontend/src/pages/AlgoVersePage.jsx
  • frontend/src/pages/ApexAIPage.jsx
  • frontend/src/pages/ApexWorkspacePage.jsx
  • frontend/src/pages/BugReportsPage.jsx
  • frontend/src/pages/CodeforcesPage.jsx
  • frontend/src/pages/ContestAtCoderPage.jsx
  • frontend/src/pages/ContestCodeChefPage.jsx
  • frontend/src/pages/ContestCodeforcesPage.jsx
  • frontend/src/pages/ContestLeetCodePage.jsx
  • frontend/src/pages/DashboardPage.jsx
  • frontend/src/pages/ExplorePage.jsx
  • frontend/src/pages/GitHubIntelligencePage.jsx
  • frontend/src/pages/LandingPage.jsx
  • frontend/src/pages/LoginPage.jsx
  • frontend/src/pages/NotFoundPage.jsx
  • frontend/src/pages/PracticePage.jsx
  • frontend/src/pages/PrivacyPage.jsx
  • frontend/src/pages/SignupPage.jsx
  • frontend/src/pages/TermsPage.jsx

Comment thread frontend/src/pages/CodeforcesPage.jsx Outdated
Comment thread frontend/src/pages/ContestCodeChefPage.jsx Outdated
@anujsharma8d

Copy link
Copy Markdown
Contributor Author

Hey @kunalverma2512
I have attached a video in the PR.

@kunalverma2512

Copy link
Copy Markdown
Owner

@anujsharma8d attach loom video or via drive link

also showcase from landing page when not sign up or login and also visite worked pages and then login or sign up and then again visit every worked page and please try to add voice to showcase

@anujsharma8d

Copy link
Copy Markdown
Contributor Author

@kunalverma2512 The login system is not working.

@kunalverma2512

Copy link
Copy Markdown
Owner

@kunalverma2512 The login system is not working.

you mean that
till now you were contributing and also not running full project on your local ?

@anujsharma8d

Copy link
Copy Markdown
Contributor Author

@kunalverma2512
I was contributing in the frontend, so i didn't use the backend.

@anujsharma8d

Copy link
Copy Markdown
Contributor Author

@kunalverma2512
I am not able to make an account on the main website either.
image

@kunalverma2512

kunalverma2512 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

@kunalverma2512 I was contributing in the frontend, so i didn't use the backend.

Its not a right way to contribute
if you are not able to run project locally then you are not doing true contributions because open source is more about to understand existing codebase and think better issues and understand current issues nicely

but its okay since tasks were independent but again I will never prefer this as contributions because it will only going to increase the count but not your thinking

Thanks

@anujsharma8d

Copy link
Copy Markdown
Contributor Author

@kunalverma2512
I didn't know about that as I am new in open source but thanks for the advice, I will keep that in mind next time.

@anujsharma8d

Copy link
Copy Markdown
Contributor Author

@kunalverma2512
I have added Screenshot of initial and final changes(before login and after login) in the PR instead of video is that fine?

@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.

Caution

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

⚠️ Outside diff range comments (1)
frontend/src/pages/GitHubIntelligencePage.jsx (1)

245-247: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Ensure <title> is rendered in all return paths (loading/error included).

<title> is currently only rendered in the connected and not-connected branches. The loading branch (Line 221) and generic error branch (Line 223) can leave a stale tab title from the previous route, which breaks the page-title objective.

💡 Suggested fix
 export default function GitHubIntelligencePage() {
+  const pageTitle = <title>GitHub Intelligence - CodeLens</title>;
   const [data, setData]       = useState(null);
   const [loading, setLoading] = useState(true);
   const [error, setError]     = useState(null);
@@
-  if (loading && !data) return <Skeleton />;
+  if (loading && !data) return <>{pageTitle}<Skeleton /></>;
   if (error?.toLowerCase().includes("not connected")) return <NotConnected />;
   if (error) return (
-    <div className="w-full flex-1 flex items-center justify-center p-10">
+    <>
+      {pageTitle}
+      <div className="w-full flex-1 flex items-center justify-center p-10">
         ...
-    </div>
+      </div>
+    </>
   );
@@
   return (
     <main>
-      <title>GitHub Intelligence - CodeLens</title>
+      {pageTitle}
       <div className="w-full flex-1 bg-white px-4 sm:px-6 md:px-8 py-12 sm:py-16 relative">
🤖 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/GitHubIntelligencePage.jsx` around lines 245 - 247, The
page title element is only included in some conditional return branches, causing
stale tab titles when the component renders loading or error states; update the
GitHubIntelligencePage component so the <title> element is present for every
return path — either by moving the <title> to a top-level common wrapper
rendered before any conditional returns in the component or by adding the same
<title> into the loading and generic error branches (the branches around the
loading/error checks in GitHubIntelligencePage.jsx), ensuring the title string
remains consistent across connected, not-connected, loading, and error states.
🤖 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.

Outside diff comments:
In `@frontend/src/pages/GitHubIntelligencePage.jsx`:
- Around line 245-247: The page title element is only included in some
conditional return branches, causing stale tab titles when the component renders
loading or error states; update the GitHubIntelligencePage component so the
<title> element is present for every return path — either by moving the <title>
to a top-level common wrapper rendered before any conditional returns in the
component or by adding the same <title> into the loading and generic error
branches (the branches around the loading/error checks in
GitHubIntelligencePage.jsx), ensuring the title string remains consistent across
connected, not-connected, loading, and error states.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a5637d01-f5cc-4d72-85c0-9d4db03f082e

📥 Commits

Reviewing files that changed from the base of the PR and between 7e4694c and bb960d7.

📒 Files selected for processing (4)
  • frontend/src/pages/CodeforcesPage.jsx
  • frontend/src/pages/ContestCodeChefPage.jsx
  • frontend/src/pages/GitHubIntelligencePage.jsx
  • frontend/src/pages/PracticePage.jsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • frontend/src/pages/CodeforcesPage.jsx
  • frontend/src/pages/PracticePage.jsx
  • frontend/src/pages/ContestCodeChefPage.jsx

@anujsharma8d

Copy link
Copy Markdown
Contributor Author

Hey @kunalverma2512
Please review.

@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.

🧹 Nitpick comments (1)
frontend/src/pages/GitHubIntelligencePage.jsx (1)

222-237: ⚡ Quick win

Use <main> in loading and generic error branches for landmark consistency.

These two branches still return fragments, while the normal and not-connected states use <main>. Wrapping them in <main> keeps semantics/accessibility consistent across all render paths.

Suggested patch
-  if (loading && !data) return <>{pageTitle}<Skeleton />;</>
+  if (loading && !data) return <main>{pageTitle}<Skeleton /></main>;
   if (error?.toLowerCase().includes("not connected")) return <NotConnected />;
   if (error) return (
-    <>
-    {pageTitle}
-    <div className="w-full flex-1 flex items-center justify-center p-10">
-      <div className="border-[4px] border-black p-8 max-w-md text-center">
-        <p className="font-black uppercase tracking-widest text-sm mb-3">Failed to load GitHub data</p>
-        <p className="text-xs font-bold uppercase tracking-widest text-gray-600">{error}</p>
-        <button onClick={() => window.location.reload()}
-          className="mt-6 px-6 py-3 border-[3px] border-black font-black uppercase tracking-widest text-sm hover:bg-black hover:text-white transition-colors">
-          Retry
-        </button>
+    <main>
+      {pageTitle}
+      <div className="w-full flex-1 flex items-center justify-center p-10">
+        <div className="border-[4px] border-black p-8 max-w-md text-center">
+          <p className="font-black uppercase tracking-widest text-sm mb-3">Failed to load GitHub data</p>
+          <p className="text-xs font-bold uppercase tracking-widest text-gray-600">{error}</p>
+          <button onClick={() => window.location.reload()}
+            className="mt-6 px-6 py-3 border-[3px] border-black font-black uppercase tracking-widest text-sm hover:bg-black hover:text-white transition-colors">
+            Retry
+          </button>
+        </div>
       </div>
-    </div>
-            </>
+    </main>
   );
🤖 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/GitHubIntelligencePage.jsx` around lines 222 - 237, The
loading and generic error render paths in GitHubIntelligencePage (the branches
that return <>...</> containing pageTitle + Skeleton and the big error UI)
should use a <main> landmark like the other branches; replace the fragment
wrappers in the loading branch (where pageTitle and Skeleton are returned) and
the generic error branch (the block that shows error, error text, and Retry
button) with a <main> element so semantics match the normal and NotConnected
paths (refer to pageTitle, Skeleton, NotConnected and the error UI returned in
GitHubIntelligencePage.jsx).
🤖 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.

Nitpick comments:
In `@frontend/src/pages/GitHubIntelligencePage.jsx`:
- Around line 222-237: The loading and generic error render paths in
GitHubIntelligencePage (the branches that return <>...</> containing pageTitle +
Skeleton and the big error UI) should use a <main> landmark like the other
branches; replace the fragment wrappers in the loading branch (where pageTitle
and Skeleton are returned) and the generic error branch (the block that shows
error, error text, and Retry button) with a <main> element so semantics match
the normal and NotConnected paths (refer to pageTitle, Skeleton, NotConnected
and the error UI returned in GitHubIntelligencePage.jsx).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c7e23c0e-7128-4f58-8beb-0f53a0f7990c

📥 Commits

Reviewing files that changed from the base of the PR and between bb960d7 and 667b823.

📒 Files selected for processing (3)
  • frontend/src/pages/CodeforcesPage.jsx
  • frontend/src/pages/GitHubIntelligencePage.jsx
  • frontend/src/pages/PracticePage.jsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/src/pages/CodeforcesPage.jsx
  • frontend/src/pages/PracticePage.jsx

@anujsharma8d

Copy link
Copy Markdown
Contributor Author

Hey @kunalverma2512
Please review this PR.

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.

feat(seo/ux): Add unique <title> tags to all page components for consistent browser tab titles and SEO

2 participants