Skip to content

feat: add PasswordInput component and integrate it into signup and lo…#234

Merged
Joshkovu merged 2 commits into
mainfrom
fix/loading
May 17, 2026
Merged

feat: add PasswordInput component and integrate it into signup and lo…#234
Joshkovu merged 2 commits into
mainfrom
fix/loading

Conversation

@Joshkovu
Copy link
Copy Markdown
Owner

…gin pages

Copilot AI review requested due to automatic review settings May 17, 2026 08:01
@netlify
Copy link
Copy Markdown

netlify Bot commented May 17, 2026

Deploy Preview for logifypro ready!

Name Link
🔨 Latest commit 121a4dd
🔍 Latest deploy log https://app.netlify.com/projects/logifypro/deploys/6a0976a56a2eb00008ea5ce3
😎 Deploy Preview https://deploy-preview-234--logifypro.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Review Change Stack

Warning

Rate limit exceeded

@Joshkovu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 43 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cd067ccb-cd8e-4a37-b77b-d3ffd0178a5d

📥 Commits

Reviewing files that changed from the base of the PR and between 8eba3c2 and 121a4dd.

📒 Files selected for processing (2)
  • logify-frontend/src/components/ui/PasswordInput.jsx
  • logify-frontend/src/tests/authRoutes.test.jsx

Walkthrough

A new reusable PasswordInput component with visibility toggle is extracted into a dedicated UI module. The component is then integrated across four authentication pages (LoginPage, AdminSignupPage, StudentSignupPage, SupervisorSignupPage) to replace inline password field markup, reducing duplication while preserving form state binding and validation.

Changes

Password Input Component Extraction

Layer / File(s) Summary
PasswordInput Component Definition
logify-frontend/src/components/ui/PasswordInput.jsx
New component accepts label, name, value, onChange, optional placeholder/error/className, and forwards remaining props. Uses isVisible state to toggle input type between "password" and "text", renders optional label and error message, and includes show/hide button with icon swap (Eye/EyeOff). PropTypes validates required and optional props.
Integration across Authentication Pages
logify-frontend/src/pages/LoginPage.jsx, logify-frontend/src/pages/AdminSignupPage.jsx, logify-frontend/src/pages/StudentSignupPage.jsx, logify-frontend/src/pages/SupervisorSignupPage.jsx
Each page imports and uses PasswordInput component(s) in place of inline password field blocks. Form field values (formData.password, formData.confirmPassword), existing onChange handlers, placeholders, and validation errors (fieldErrors) are passed to the component instances. Form state, validation logic, and submission flows remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


🐰 A toggle for each secret,
Four pages now respect it,
Eyes peek through the night,
Password fields, shining bright!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is truncated ('...gin pages') and lacks meaningful detail about the changes, making it too vague to convey information about the changeset. Expand the description to explain what the PasswordInput component does and why it improves the signup/login pages.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a PasswordInput component and integrating it into signup and login pages, which aligns with the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/loading

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.

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
logify-frontend/src/components/ui/PasswordInput.jsx (1)

56-64: 🏗️ Heavy lift

Replace propTypes with TypeScript types or explicit runtime schema validation.

In React 19, propTypes on function components are no longer executed by the React runtime—they're silently ignored. This leaves no runtime guarantee that the component receives correct prop types. For runtime validation guarantees, use explicit schema validation (e.g., Zod, Yup) or migrate to TypeScript for static type checking.

🤖 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 `@logify-frontend/src/components/ui/PasswordInput.jsx` around lines 56 - 64,
The PasswordInput.propTypes block must be replaced with either TypeScript props
definitions or an explicit runtime schema validation; remove the
PasswordInput.propTypes assignment and instead (a) if migrating to TS, define an
interface PasswordInputProps (with label?: string, name: string, value: string,
onChange: (e: any) => void, placeholder?: string, error?: string, className?:
string) and annotate the PasswordInput function signature with that type, or (b)
if keeping JS, create a Zod/Yup schema (e.g., passwordInputSchema) describing
the same fields and call schema.parse/validate at the top of the PasswordInput
function (handle validation errors and surface them appropriately) so props are
validated at runtime; ensure all references to PasswordInput.propTypes are
removed.
🤖 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 `@logify-frontend/src/components/ui/PasswordInput.jsx`:
- Around line 24-37: The label and error text in the PasswordInput component are
not programmatically associated with the input; add an id for the input (derive
from the name prop or accept an id prop) and set the label's htmlFor to that id,
and for error text render an element with a unique id (e.g. `${id}-error`) and
add aria-describedby on the input when an error exists so screen readers
announce the error; update the PasswordInput JSX to wire label -> input via
htmlFor/id and input -> error via aria-describedby (and ensure the error element
uses role="alert" or similar if needed).

---

Nitpick comments:
In `@logify-frontend/src/components/ui/PasswordInput.jsx`:
- Around line 56-64: The PasswordInput.propTypes block must be replaced with
either TypeScript props definitions or an explicit runtime schema validation;
remove the PasswordInput.propTypes assignment and instead (a) if migrating to
TS, define an interface PasswordInputProps (with label?: string, name: string,
value: string, onChange: (e: any) => void, placeholder?: string, error?: string,
className?: string) and annotate the PasswordInput function signature with that
type, or (b) if keeping JS, create a Zod/Yup schema (e.g., passwordInputSchema)
describing the same fields and call schema.parse/validate at the top of the
PasswordInput function (handle validation errors and surface them appropriately)
so props are validated at runtime; ensure all references to
PasswordInput.propTypes are removed.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fdaf1175-46f2-4dec-a943-2a8dd62b6124

📥 Commits

Reviewing files that changed from the base of the PR and between b8d6e47 and 8eba3c2.

📒 Files selected for processing (5)
  • logify-frontend/src/components/ui/PasswordInput.jsx
  • logify-frontend/src/pages/AdminSignupPage.jsx
  • logify-frontend/src/pages/LoginPage.jsx
  • logify-frontend/src/pages/StudentSignupPage.jsx
  • logify-frontend/src/pages/SupervisorSignupPage.jsx

Comment thread logify-frontend/src/components/ui/PasswordInput.jsx Outdated
…ve label association; adjust test for password field accessibility
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 17, 2026

Deploying logify-frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: 121a4dd
Status: ✅  Deploy successful!
Preview URL: https://59e6a2fc.logify-frontend.pages.dev
Branch Preview URL: https://fix-loading.logify-frontend.pages.dev

View logs

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a reusable PasswordInput UI component (with a show/hide toggle) and replaces inline password <input type="password" /> fields in the login and signup pages to reduce duplication and unify UX.

Changes:

  • Added PasswordInput component under src/components/ui/.
  • Replaced password + confirm password fields in Student/Admin/Supervisor signup pages with PasswordInput.
  • Replaced the Login page password field with PasswordInput.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
logify-frontend/src/components/ui/PasswordInput.jsx Adds the new reusable password input with visibility toggle.
logify-frontend/src/pages/LoginPage.jsx Swaps the login password field to use PasswordInput.
logify-frontend/src/pages/StudentSignupPage.jsx Swaps password + confirm password fields to use PasswordInput.
logify-frontend/src/pages/AdminSignupPage.jsx Swaps password + confirm password fields to use PasswordInput.
logify-frontend/src/pages/SupervisorSignupPage.jsx Swaps password + confirm password fields to use PasswordInput.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +37
return (
<div>
{label && (
<label
htmlFor={inputId}
className="text-xs font-black uppercase tracking-widest text-maroon-dark dark:text-gold"
>
{label}
</label>
)}
<div className="relative mt-2">
<input
id={inputId}
type={isVisible ? "text" : "password"}
name={name}
Comment on lines +17 to +43
const inputId = id || `password-input-${name}`;

const toggleVisibility = () => {
setIsVisible(!isVisible);
};

return (
<div>
{label && (
<label
htmlFor={inputId}
className="text-xs font-black uppercase tracking-widest text-maroon-dark dark:text-gold"
>
{label}
</label>
)}
<div className="relative mt-2">
<input
id={inputId}
type={isVisible ? "text" : "password"}
name={name}
value={value}
onChange={onChange}
placeholder={placeholder}
className={`w-full rounded-xl border border-border bg-white px-4 py-3 pr-10 text-sm outline-none transition focus:border-gold dark:border-slate-700 dark:bg-slate-800 ${className}`}
{...props}
/>
Comment on lines +29 to +37
>
{label}
</label>
)}
<div className="relative mt-2">
<input
id={inputId}
type={isVisible ? "text" : "password"}
name={name}
@Joshkovu Joshkovu merged commit f2c31aa into main May 17, 2026
11 checks passed
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.

2 participants