Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Home Link in Navbar Not Navigating to Home Page on About Page. #968

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hbSrujana
Copy link

@hbSrujana hbSrujana commented Oct 31, 2024

Pull Request for Resum-Resume 💡

Issue Title : Navbar Home Link Not Navigating to Home Page on About Page.

Info about the related issue (Aim of the project) : Ensure that all navbar links are functional and provide smooth navigation throughout the application.
Name : Srujana H B
GitHub ID : hbSrujana
Email ID : hbsrujana6@gmail.com

Closes: #933

Describe the add-ons or changes you've made 📃 :
Fixed the navigation issue by updating the href for the Home link in the navbar on the About page, so it correctly navigates to the Home page.

Screenshots :
Screenshot 2024-10-31 210850

Type of change ☑️
What sort of change have you made:

  • Bug fix (non-breaking change which fixes an issue)
  • [ x] New feature (non-breaking change which adds functionality)
  • [x ] Code style update (formatting, local variables)
  • [ x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ x] This change requires a documentation update

How Has This Been Tested? ⚙️ :
Tested the navigation by clicking the Home link on the About page to verify that it redirects to the Home page as expected. Ensured there are no additional errors or unexpected behaviors in the navbar.

Checklist: ☑️

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added things that prove my fix is effective or that my feature works.
  • [ x] Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • New Features

    • Enhanced navigation structure with direct links to "Home" and "About Us" pages.
    • Added dynamic behavior to hide the "Login" link when on the login page.
  • Style

    • Updated styles for improved visual consistency, including new colors and hover effects.
    • Enhanced footer layout for better readability and responsiveness on smaller screens.

Copy link

coderabbitai bot commented Oct 31, 2024

Walkthrough

The changes in this pull request involve updates to the navigation links and styling in the about.html and login.html files. The "Home" link in about.html was modified to direct users to index.html, enhancing navigation. Various CSS variables were introduced for consistent styling, and hover effects were refined. In login.html, the navigation structure was adjusted to hide the "Login" link when on the login page, improving user experience without altering the underlying logic.

Changes

File Change Summary
about.html Updated "Home" link to direct to index.html, added CSS variables for colors, refined hover effects, adjusted footer layout and responsive design.
login.html Added id to "Login" link for dynamic behavior, updated navigation links to direct to respective pages.

Assessment against linked issues

Objective Addressed Explanation
On the About page, the Home link in the navbar is not navigating to the Home page. (#933)

Possibly related PRs

Suggested labels

hacktoberfest, level1, gssoc-ext, hacktoberfest-accepted

Suggested reviewers

  • GarimaSingh0109

Poem

In the land of code where rabbits play,
Navigation links now lead the way.
With colors bright and styles anew,
A smoother path for me and you.
Hopping through pages, no more to roam,
Every link now finds its home! 🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hbSrujana
Copy link
Author

I created an Issue, issue Title: Navbar Home Link Not Navigating to Home Page on About Page.
issue number: #933
and solve this issue. ( PR Title : Fix: Home Link in Navbar Not Navigating to Home Page on About Page. #968).
could you please review my PR? 😊

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

🧹 Outside diff range and nitpick comments (2)
about.html (2)

Line range hint 520-524: Fix needed: Update mobile navigation Home link.

The Home link in the mobile navigation menu still uses a fragment identifier #home which will cause the same navigation issue. This needs to be updated to match the main navigation.

Apply this change to maintain consistency:

-            <a href="#home">Home</a>
+            <a href="index.html">Home</a>

Line range hint 403-471: Clean up: Remove commented-out code.

There are large blocks of commented-out code that should be removed if they're no longer needed:

  1. Navbar styles (lines 403-471)
  2. Back button HTML (lines 615-617)

This will improve code maintainability and reduce confusion.

Also applies to: 615-617

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7b65fe0 and ddc6347.

📒 Files selected for processing (2)
  • about.html (1 hunks)
  • login.html (1 hunks)
🔇 Additional comments (3)
login.html (1)

21-21: Verify navigation consistency across pages.

Let's ensure all pages use consistent navigation links.

about.html (2)

476-476: LGTM! This fixes the Home link navigation.

The change from fragment identifier to proper path index.html resolves issue #933 where the Home link wasn't working on the About page.


476-476: Verify: Check for other instances of fragment navigation.

Let's verify there are no other instances of #home being used for navigation that need to be updated.

Comment on lines +29 to +34
<script>
// Hide the "Login" link if the user is on the login page
if (window.location.pathname.endsWith("login.html")) {
document.getElementById("login-link").style.display = "none";
}
</script>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Move inline script to external file and improve path handling.

The current implementation has several potential improvements:

  1. Inline scripts should be moved to external files
  2. Path checking could be more robust

Move this code to login.js and enhance it:

// In login.js
document.addEventListener('DOMContentLoaded', function() {
    const loginLink = document.getElementById('login-link');
    if (loginLink) {
        // More robust check using pathname or URL
        const currentPath = window.location.pathname;
        const isLoginPage = currentPath.toLowerCase().includes('login.html');
        if (isLoginPage) {
            loginLink.style.display = 'none';
        }
    }
});

Then remove the inline script from login.html:

-  <script>
-      // Hide the "Login" link if the user is on the login page
-      if (window.location.pathname.endsWith("login.html")) {
-          document.getElementById("login-link").style.display = "none";
-      }
-  </script>

Comment on lines +19 to +27
<nav>
<ul id="nav-menu">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="resume.html">Resume</a></li>
<li><a href="signup.html">Sign Up</a></li>
<li id="login-link"><a href="login.html">Login</a></li>
</ul>
</nav>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance navigation accessibility and user experience.

While the navigation structure is semantically correct, consider these improvements:

  1. Add ARIA landmarks for better accessibility
  2. Indicate the current page in the navigation menu
-    <nav> 
+    <nav aria-label="Main navigation"> 
       <ul id="nav-menu">
-          <li><a href="index.html">Home</a></li>
-          <li><a href="about.html">About Us</a></li>
-          <li><a href="resume.html">Resume</a></li>
-          <li><a href="signup.html">Sign Up</a></li>
-          <li id="login-link"><a href="login.html">Login</a></li>
+          <li><a href="index.html" aria-label="Home page">Home</a></li>
+          <li><a href="about.html" aria-label="About us page">About Us</a></li>
+          <li><a href="resume.html" aria-label="Resume builder">Resume</a></li>
+          <li><a href="signup.html" aria-label="Sign up page">Sign Up</a></li>
+          <li id="login-link"><a href="login.html" aria-current="page" aria-label="Login page">Login</a></li>
       </ul>
   </nav>
📝 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
<nav>
<ul id="nav-menu">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="resume.html">Resume</a></li>
<li><a href="signup.html">Sign Up</a></li>
<li id="login-link"><a href="login.html">Login</a></li>
</ul>
</nav>
<nav aria-label="Main navigation">
<ul id="nav-menu">
<li><a href="index.html" aria-label="Home page">Home</a></li>
<li><a href="about.html" aria-label="About us page">About Us</a></li>
<li><a href="resume.html" aria-label="Resume builder">Resume</a></li>
<li><a href="signup.html" aria-label="Sign up page">Sign Up</a></li>
<li id="login-link"><a href="login.html" aria-current="page" aria-label="Login page">Login</a></li>
</ul>
</nav>

hbSrujana added a commit to hbSrujana/Open-source-Practice that referenced this pull request Nov 9, 2024
Hi GSSOC 2024 extd team 
this is the pr i have raised and it's not been merged.
its Level 1 PR
could yo review and merge it.
GarimaSingh0109/Resum-Resume#968
hbSrujana added a commit to hbSrujana/Open-source-Practice that referenced this pull request Nov 9, 2024
Hi GSSOC 2024 extd team 
this is the pr i have raised and it's not been merged.
its Level 1 PR
could yo review and merge it.
GarimaSingh0109/Resum-Resume#968
vishanurag/Canvas-Editor#737
GarimaSingh0109/Resum-Resume#944
@aslams2020
Copy link

You've created a direct PR without being assigned, this PR cannot be reviewed and merged by the team.

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.

On the About page, the Home link in the navbar is not navigating to the Home page.
2 participants