Skip to content

Fix navbar/filter layout bugs and replace native alerts with Toast in Login - #37

Merged
udaycodespace merged 2 commits into
udaycodespace:mainfrom
teja-311:fix/navbar-dropdown-and-filter-overflow
Jul 26, 2026
Merged

Fix navbar/filter layout bugs and replace native alerts with Toast in Login#37
udaycodespace merged 2 commits into
udaycodespace:mainfrom
teja-311:fix/navbar-dropdown-and-filter-overflow

Conversation

@teja-311

Copy link
Copy Markdown
Contributor

Description

This PR contains two separate, focused commits:

Commit 1: Fix Settings dropdown z-index overlap and Activity Logs filter panel overflow

Fixes #24

  • Added position: relative and zIndex: 1040 to <Navbar> in NavBar.jsx so the Settings dropdown reliably renders above page content instead of behind the admin tab bar.
  • Changed .activity-filter-panel grid in ActivityLogs.css from a fixed 7-column layout to repeat(auto-fit, minmax(140px, 1fr)) so filter fields wrap onto new rows instead of overflowing the card border.

Commit 2: Add reusable Toast component and replace native alerts in Login.jsx

Fixes #36

Login.jsx used window.alert() / alert() for all user feedback (8 call sites: empty field validation, login success/failure, forgot password, reset password). Native alerts block the page and can't be styled.

Added a new reusable Toast.jsx component:

  • Auto-dismisses after 3 seconds
  • Manual close (×) button
  • Supports success / error / info styling variants
  • No external dependencies

Replaced all 8 alert() calls in Login.jsx with showToast(message, type), backed by local component state and a <Toast /> render at the top of the component.

Note: this PR also supersedes the earlier closed PR #30, which contained just the CSS fixes for #24 and those changes are now included here as Commit 1, combined with the more substantial Toast implementation as requested.

Before / After

Settings dropdown:
Screenshot 2026-07-20 181633
Screenshot 2026-07-22 203540

Filter panel overflow:
Screenshot 2026-07-20 181909
Screenshot 2026-07-22 203600

Native alert → Toast (Login flow):

learnhub.login.flow.mp4

Steps to Test

  1. Log in as Admin → open Settings on any admin tab → confirm the dropdown renders above the content, not behind it
  2. Go to Activity Logs → confirm the filter row wraps within the card instead of overflowing
  3. Go to the Login page:
    • Submit with empty fields → red error toast appears, auto-dismisses after ~3s
    • Submit with invalid credentials → red toast appears → try manually closing it with the × button
    • Click "Forgot password?" → submit with empty email → red toast appears
    • Log in with a valid demo account → redirects directly to dashboard

Build Verification

Ran npm run dev in frontend. builds and runs cleanly with no new warnings or errors.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings or console errors.
  • I have tested my changes locally and verified they work as expected.
  • Any dependent changes have been merged and published in downstream modules.

teja-311 added 2 commits July 22, 2026 20:27
…overflow

Signed-off-by: Tejashwini <deviteja76@gmail.com>
Signed-off-by: Tejashwini <deviteja76@gmail.com>
@udaycodespace
udaycodespace requested review from udaycodespace and removed request for udaycodespace July 26, 2026 10:05
@udaycodespace udaycodespace added ECSoC26 Required label for a PR to be eligible for Sentinel scoring ECSoC26-L1 Easy difficulty, auto-assigned by Sentinel — 5 points good-issue PA-awarded bonus for a well-written, well-scoped issue — +10 XP and removed frontend fullstack labels Jul 26, 2026
@udaycodespace

Copy link
Copy Markdown
Owner

Description

This PR contains two separate, focused commits:

Commit 1: Fix Settings dropdown z-index overlap and Activity Logs filter panel overflow

Fixes #24

  • Added position: relative and zIndex: 1040 to <Navbar> in NavBar.jsx so the Settings dropdown reliably renders above page content instead of behind the admin tab bar.
  • Changed .activity-filter-panel grid in ActivityLogs.css from a fixed 7-column layout to repeat(auto-fit, minmax(140px, 1fr)) so filter fields wrap onto new rows instead of overflowing the card border.

Commit 2: Add reusable Toast component and replace native alerts in Login.jsx

Fixes #36

Login.jsx used window.alert() / alert() for all user feedback (8 call sites: empty field validation, login success/failure, forgot password, reset password). Native alerts block the page and can't be styled.

Added a new reusable Toast.jsx component:

  • Auto-dismisses after 3 seconds
  • Manual close (×) button
  • Supports success / error / info styling variants
  • No external dependencies

Replaced all 8 alert() calls in Login.jsx with showToast(message, type), backed by local component state and a <Toast /> render at the top of the component.

Note: this PR also supersedes the earlier closed PR #30, which contained just the CSS fixes for #24 and those changes are now included here as Commit 1, combined with the more substantial Toast implementation as requested.

Before / After

Settings dropdown: Screenshot 2026-07-20 181633 Screenshot 2026-07-22 203540

Filter panel overflow: Screenshot 2026-07-20 181909 Screenshot 2026-07-22 203600

Native alert → Toast (Login flow):

learnhub.login.flow.mp4

Steps to Test

  1. Log in as Admin → open Settings on any admin tab → confirm the dropdown renders above the content, not behind it

  2. Go to Activity Logs → confirm the filter row wraps within the card instead of overflowing

  3. Go to the Login page:

    • Submit with empty fields → red error toast appears, auto-dismisses after ~3s
    • Submit with invalid credentials → red toast appears → try manually closing it with the × button
    • Click "Forgot password?" → submit with empty email → red toast appears
    • Log in with a valid demo account → redirects directly to dashboard

Build Verification

Ran npm run dev in frontend. builds and runs cleanly with no new warnings or errors.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings or console errors.
  • I have tested my changes locally and verified they work as expected.
  • Any dependent changes have been merged and published in downstream modules.

LGTM!

@udaycodespace
udaycodespace merged commit 813a305 into udaycodespace:main Jul 26, 2026
2 of 10 checks passed
@ecsoc-sentinel ecsoc-sentinel Bot added ECSoC26-L1 Easy difficulty, auto-assigned by Sentinel — 5 points and removed ECSoC26-L1 Easy difficulty, auto-assigned by Sentinel — 5 points labels Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ECSoC26-L1 Easy difficulty, auto-assigned by Sentinel — 5 points ECSoC26 Required label for a PR to be eligible for Sentinel scoring good-issue PA-awarded bonus for a well-written, well-scoped issue — +10 XP

Projects

None yet

2 participants