-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes in this pull request involve updates to the navigation links and styling in the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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:
- Navbar styles (lines 403-471)
- 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
📒 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.
<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> |
There was a problem hiding this comment.
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:
- Inline scripts should be moved to external files
- 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>
<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> |
There was a problem hiding this comment.
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:
- Add ARIA landmarks for better accessibility
- 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.
<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> |
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
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
You've created a direct PR without being assigned, this PR cannot be reviewed and merged by the team. |
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 :
Type of change ☑️
What sort of change have you made:
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: ☑️
Summary by CodeRabbit
New Features
Style