Skip to content

Fix/signup card padding#510

Closed
atharv96k wants to merge 3 commits into
GitMetricsLab:mainfrom
atharv96k:fix/signup-card-padding
Closed

Fix/signup card padding#510
atharv96k wants to merge 3 commits into
GitMetricsLab:mainfrom
atharv96k:fix/signup-card-padding

Conversation

@atharv96k
Copy link
Copy Markdown
Contributor

@atharv96k atharv96k commented May 25, 2026

Related Issue


Description

Resolved a layout layout bug on the authentication container card where components pressed flush against vertical boundaries. Replaced the generic shorthand padding rules (p-6 sm:p-10) with decoupled explicit horizontal and vertical properties (px-6 py-8 sm:px-10 sm:py-12). This guarantees steady top and bottom visual clearance safety zones, ensuring that text elements and validation warnings preserve consistent spacing buffers without clipping card borders.


How Has This Been Tested?

  • Local visual verification: Verified layout behavior across different browser viewport boundaries.
  • Error flow sanity check: Intentionally triggered form field validation error alerts and confirmed that the footer redirection text fields maintain proper padding boundaries from the outer card outline boundaries.
  • Code quality validation: Ran npm run lint locally to confirm complete linter compliance.

Type of Change

  • Bug fix
  • New feature
  • Code style update
  • Breaking change
  • Documentation update

###Screenshot
solved

Summary by CodeRabbit

  • New Features

    • Added automatic scroll-to-top functionality when navigating between pages.
  • Style

    • Improved padding and spacing layout on Login and Signup form pages.
  • Refactor

    • Enhanced form submission error handling and validation with better type safety.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 86c4722
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a1442c9c78c360008e21c3a
😎 Deploy Preview https://deploy-preview-510--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@atharv96k, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 51 minutes and 3 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e28cb17-4265-4e65-8794-2bf2bbffc483

📥 Commits

Reviewing files that changed from the base of the PR and between ad3a397 and 86c4722.

📒 Files selected for processing (1)
  • src/pages/Signup/Signup.tsx
📝 Walkthrough

Walkthrough

This PR introduces scroll-to-top behavior on route transitions, fixes authentication form vertical padding to address layout compression issues, refactors signup validation and error handling with safer Axios typing, and improves code quality through type safety upgrades and unused import removal.

Changes

App improvements and auth form refinements

Layer / File(s) Summary
Scroll-to-top route handler
src/components/ScrollToTop.tsx, src/App.tsx
New ScrollToTop component listens to useLocation changes and calls window.scrollTo(0, 0). Imported and mounted at the top level of the App layout to reset scroll position on every route navigation.
Authentication form layout and validation refinements
src/pages/Login/Login.tsx, src/pages/Signup/Signup.tsx
Login and Signup form cards change padding from px-4 to p-10 sm:px-6, addressing layout compression issues from the linked issue. Signup password validation regex is reformatted; form validation errors are restructured into multi-line conditionals; Axios error catching now types errors as unknown and guards with axios.isAxiosError() before accessing error.response?.data?.message. Form inputs, message banners, and link blocks are expanded into multi-line JSX for readability without changing behavior.
Type safety and import cleanup
src/hooks/useGitHubData.ts, src/components/Navbar.tsx, src/components/__test__/Navbar.test.tsx
useGitHubData requests array type upgraded from Promise<any>[] to Promise<unknown>[] for stricter typing. Unused Github icon removed from Navbar's lucide-react import; unused beforeEach removed from Navbar test Vitest import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • GitMetricsLab/github_tracker#255: Both PRs modify src/hooks/useGitHubData.ts—the main PR refactors request typing while the retrieved PR refactors hook signatures for server-side filtering support.
  • GitMetricsLab/github_tracker#265: Both PRs modify src/pages/Signup/Signup.tsx validation and error handling logic including field error computation and Axios error typing.
  • GitMetricsLab/github_tracker#138: Both PRs modify src/pages/Login/Login.tsx layout and styling, so they overlap at the Login form layout level.

Suggested labels

level:intermediate, quality:clean

Poem

🐰 Hop along the page, scrolling to the peak,
Forms breathe with padding, no longer meek,
Types grow strict, imports trimmed tight,
The app takes shape with care and might!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Fix/signup card padding' directly reflects the primary change—fixing padding on the signup card's authentication container to resolve the layout bug.
Description check ✅ Passed The PR description follows the template structure with all required sections completed: Related Issue (#508), detailed Description, How Has This Been Tested, Type of Change (Bug fix selected), and a screenshot.
Linked Issues check ✅ Passed The PR addresses issue #508 by implementing explicit vertical padding (py-8, py-12) on signup/login card containers. ScrollToTop addition and navbar/hook refactors are complementary improvements that do not conflict with the primary objective.
Out of Scope Changes check ✅ Passed While the PR includes a ScrollToTop component and minor refactors (navbar imports, type adjustments), these are narrowly scoped improvements that enhance code quality without introducing unrelated functionality unrelated to the core padding fix.

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

Copy link
Copy Markdown
Contributor

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

Caution

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

⚠️ Outside diff range comments (1)
src/pages/Signup/Signup.tsx (1)

285-297: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

User-facing text error causes confusion.

The text "Don't have an account?" is incorrect for the signup page. Users are already on the page to create an account. The text should read "Already have an account?" since the link navigates to the login page for users who already have accounts.

🐛 Proposed fix
             <p
               className={`${mode === "dark" ? "text-slate-500" : "text-gray-600"} text-sm`}
             >
-              Don't have an account?
+              Already have an account?
               <Link
                 to="/login"
                 className="ml-1 text-purple-400 hover:text-purple-300 transition-colors duration-300"
🤖 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 `@src/pages/Signup/Signup.tsx` around lines 285 - 297, Replace the incorrect
prompt string in the Signup component: in the paragraph that precedes the Link
(the element containing the text "Don't have an account?" and the Link
to="/login"), change the text to "Already have an account?" so the message
matches the login link; update the string inside the <p> that currently uses the
mode-based className and the Link to "/login".
🧹 Nitpick comments (2)
src/hooks/useGitHubData.ts (1)

115-115: ⚡ Quick win

Prefer explicit typing over unknown for better type safety.

While changing any to unknown is a step toward type safety, accessing .value.items and .value.total on lines 156–157 and 170–171 requires TypeScript to either accept unsafe property access on unknown or rely on type assertions. The actual return type of fetchPaginated is known: Promise<{ items: GitHubItem[], total: number }>.

Consider using an explicit type for stronger compile-time guarantees:

✨ Proposed fix for explicit typing
-        const requests: Promise<unknown>[] = [];
+        const requests: Promise<{ items: GitHubItem[], total: number }>[] = [];

This ensures TypeScript can verify property access without assertions and provides better IntelliSense support.

🤖 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 `@src/hooks/useGitHubData.ts` at line 115, Change the requests array to use the
explicit response type instead of Promise<unknown> so TypeScript can validate
accesses to .value.items and .value.total; specifically type the array as
Promise<{ items: GitHubItem[]; total: number }>[] (matching the known return
shape of fetchPaginated) and update any related generics or the fetchPaginated
signature used in useGitHubData so callers and the variable requests (and
subsequent accesses in the useGitHubData function where .value.items and
.value.total are read) have correct compile-time types.
src/pages/Signup/Signup.tsx (1)

95-98: 💤 Low value

Misleading comment about cookie handling.

The comment "Include cookies for session" suggests explicit cookie configuration, but there's no withCredentials: true set in this axios call. While same-origin requests do send cookies automatically, the comment could mislead developers into thinking there's explicit session cookie handling configured here.

Suggested clarification
       const response = await axios.post(
         `${backendUrl}/api/auth/signup`,
-        formData, // Include cookies for session
+        formData,
       );

Or make it more accurate:

       const response = await axios.post(
         `${backendUrl}/api/auth/signup`,
-        formData, // Include cookies for session
+        formData, // Cookies sent automatically for same-origin
       );
🤖 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 `@src/pages/Signup/Signup.tsx` around lines 95 - 98, The inline comment on the
axios.post call in Signup.tsx is misleading: either remove or update it to
reflect actual cookie behavior; to explicitly send cookies for cross-origin
sessions add the axios option withCredentials: true to the axios.post call
(axios.post(`${backendUrl}/api/auth/signup`, formData, { withCredentials: true
})) or change the comment to something accurate like "Same-origin cookies sent
automatically" if you intend no explicit credential flag.
🤖 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 `@src/pages/Signup/Signup.tsx`:
- Around line 285-297: Replace the incorrect prompt string in the Signup
component: in the paragraph that precedes the Link (the element containing the
text "Don't have an account?" and the Link to="/login"), change the text to
"Already have an account?" so the message matches the login link; update the
string inside the <p> that currently uses the mode-based className and the Link
to "/login".

---

Nitpick comments:
In `@src/hooks/useGitHubData.ts`:
- Line 115: Change the requests array to use the explicit response type instead
of Promise<unknown> so TypeScript can validate accesses to .value.items and
.value.total; specifically type the array as Promise<{ items: GitHubItem[];
total: number }>[] (matching the known return shape of fetchPaginated) and
update any related generics or the fetchPaginated signature used in
useGitHubData so callers and the variable requests (and subsequent accesses in
the useGitHubData function where .value.items and .value.total are read) have
correct compile-time types.

In `@src/pages/Signup/Signup.tsx`:
- Around line 95-98: The inline comment on the axios.post call in Signup.tsx is
misleading: either remove or update it to reflect actual cookie behavior; to
explicitly send cookies for cross-origin sessions add the axios option
withCredentials: true to the axios.post call
(axios.post(`${backendUrl}/api/auth/signup`, formData, { withCredentials: true
})) or change the comment to something accurate like "Same-origin cookies sent
automatically" if you intend no explicit credential flag.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 31c753c3-6fed-4939-b0e8-cc8b9657adea

📥 Commits

Reviewing files that changed from the base of the PR and between 6c6bc3e and ad3a397.

⛔ Files ignored due to path filters (2)
  • backend/bun.lock is excluded by !**/*.lock
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • src/App.tsx
  • src/components/Navbar.tsx
  • src/components/ScrollToTop.tsx
  • src/components/__test__/Navbar.test.tsx
  • src/hooks/useGitHubData.ts
  • src/pages/Login/Login.tsx
  • src/pages/Signup/Signup.tsx

@atharv96k atharv96k closed this May 25, 2026
@atharv96k atharv96k deleted the fix/signup-card-padding branch May 25, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui/ux: missing top and bottom padding/margin on authentication form cards

1 participant