Skip to content

Conversation

@Vaibhaviitian
Copy link

@Vaibhaviitian Vaibhaviitian commented Aug 31, 2025

This PR fixes the responsiveness of the home page .
Fixes #284

Screenshot 2025-08-31 073700

Summary by CodeRabbit

  • Style
    • Centered the Features section and increased spacing on large screens for improved balance.
    • Updated feature cards with uniform rounded corners, adjusted padding, and responsive width constraints for better fit across devices.
    • Applied responsive icon and text sizing, added font weight, and improved text wrapping/truncation to prevent overflow.
    • Preserved overall layout while refining alignment and responsiveness.
    • No changes to data fetching or core behavior.

@coderabbitai
Copy link

coderabbitai bot commented Aug 31, 2025

Walkthrough

UI-only updates in eduaid_web/src/pages/Home.jsx adjust Tailwind classes for alignment, spacing, rounding, sizing, and responsive behavior of the Features section and cards. No data flow, hooks logic, or exports changed. Minor formatting edits applied to imports and long lines.

Changes

Cohort / File(s) Summary
Home page UI responsiveness tweaks
eduaid_web/src/pages/Home.jsx
Adjusted container alignment to centered with responsive gaps; updated card rounding and padding; revised width constraints to w-full with max-w and breakpoint-based overrides; responsive icon/text sizing and truncation; multi-line formatting of effect condition and URL; no logic changes.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix responsiveness issue on home page (#284) Changes target responsive classes and layout, but adequacy of the fix across reported breakpoints cannot be confirmed from the diff alone.

Assessment against linked issues: Out-of-scope changes

Poem

I tidied grids with gentle hops,
Trimmed paddings, rounded UI tops.
Icons grew, texts learned to flow,
Cards fit snug on large to small.
With whisker-tested gaps just right—
I bounce, declare: looks tight tonight! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@Vaibhaviitian
Copy link
Author

I fix this issue

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: 0

Caution

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

⚠️ Outside diff range comments (1)
eduaid_web/src/pages/Home.jsx (1)

99-110: Don’t nest button inside Link (invalid HTML and a11y)

Make the Link the interactive element and style it as a button.

-<Link to="/question-type" className="w-full sm:w-auto">
-  <button className="w-full sm:w-auto items-center text-lg flex justify-center gap-3 text-white px-6 py-3 border-gradient hover:wave-effect rounded-md transition-all duration-300">
-    Let’s get Started
-    <img src={arrow} width={24} height={24} alt="arrow" />
-  </button>
-</Link>
+<Link
+  to="/question-type"
+  className="w-full sm:w-auto items-center text-lg flex justify-center gap-3 text-white px-6 py-3 border-gradient hover:wave-effect rounded-md transition-all duration-300"
+>
+  Let’s get Started
+  <img src={arrow} width={24} height={24} alt="" aria-hidden="true" />
+</Link>
-<Link to="/history" className="w-full sm:w-auto">
-  <button className="w-full sm:w-auto items-center text-lg flex justify-center gap-3 text-white px-6 py-3 border-gradient hover:wave-effect rounded-md transition-all duration-300">
-    Your previous Work!
-    <img src={arrow} width={24} height={24} alt="arrow" />
-  </button>
-</Link>
+<Link
+  to="/history"
+  className="w-full sm:w-auto items-center text-lg flex justify-center gap-3 text-white px-6 py-3 border-gradient hover:wave-effect rounded-md transition-all duration-300"
+>
+  Your previous Work!
+  <img src={arrow} width={24} height={24} alt="" aria-hidden="true" />
+</Link>
🧹 Nitpick comments (9)
eduaid_web/src/pages/Home.jsx (9)

3-3: Prefer consistent camelCase for asset imports

Rename for consistency/readability.

-import logo_trans from "../assets/aossie_logo_transparent.png";
+import logoTransparent from "../assets/aossie_logo_transparent.png";

And update usage:

-<img src={logo_trans} alt="logo" className="w-24 my-4 sm:my-6" />
+<img src={logoTransparent} alt="AOSSIE logo" className="w-24 my-4 sm:my-6" />

15-17: Abort GitHub fetch on unmount; add Accept header

Prevents hung requests and minorly future-proofs API usage.

-    const response = await fetch(
-      "https://api.github.com/repos/AOSSIE-Org/EduAid"
-    );
+    const response = await fetch(
+      "https://api.github.com/repos/AOSSIE-Org/EduAid",
+      { signal, headers: { Accept: "application/vnd.github+json" } }
+    );

Outside this hunk (for context), pass the signal and clean up in effect:

// change signature
async function fetchGitHubStars(signal) { /* ...as above... */ }

// in useEffect
const controller = new AbortController();
fetchGitHubStars(controller.signal)
  .then(/* ... */)
  .catch(() => setError("Failed to fetch stars"));
return () => controller.abort();

32-38: Explicit radix for parseInt to avoid implicit base

Also apply to stars parsing.

-      !isMoreThanOneDayOld(parseInt(storedTime))
+      !isMoreThanOneDayOld(parseInt(storedTime, 10))
     ) {
-      setStars(parseInt(storedStars));
+      setStars(parseInt(storedStars, 10));

75-75: Use CSS grid for predictable responsive card layout

Flex + justify-between can create uneven spacing; grid cleanly handles 1→3 columns.

-<div className="flex flex-col items-center gap-4 mt-8 sm:flex-row sm:justify-between sm:items-center lg:gap-6">
+<div className="grid grid-cols-1 sm:grid-cols-3 gap-4 lg:gap-6 mt-8 items-stretch">

81-83: Avoid index as React key

Use stable identifiers to prevent unnecessary re-renders when list order changes.

-              <div
-                key={i}
+              <div
+                key={feature}

83-83: Width constraints can be simplified with grid

If you adopt grid above, these width/max-w constraints are redundant.

-                className="flex items-center rounded-2xl px-4 py-2 sm:px-6 sm:py-3 bg-gradient-to-r from-[#FF005C] via-[#7600F2] to-[#00CBE7] gap-3 sm:gap-4 w-full sm:w-fit max-w-sm sm:max-w-none"
+                className="flex items-center rounded-2xl px-4 py-2 sm:px-6 sm:py-3 bg-gradient-to-r from-[#FF005C] via-[#7600F2] to-[#00CBE7] gap-3 sm:gap-4 w-full"

85-89: Add intrinsic dimensions and hide decorative icon from AT

Reduces CLS and avoids redundant announcements.

-                <img
-                  src={starsImg}
-                  className="h-6 w-6 sm:h-8 sm:w-8"
-                  alt=""
-                />
+                <img
+                  src={starsImg}
+                  width={24}
+                  height={24}
+                  className="h-6 w-6 sm:h-8 sm:w-8"
+                  alt=""
+                  aria-hidden="true"
+                />

90-92: Preserve full label when truncated on small screens

Expose the full text via title to improve UX.

-                <div className="text-white text-sm sm:text-base lg:text-xl font-medium truncate sm:whitespace-normal">
+                <div className="text-white text-sm sm:text-base lg:text-xl font-medium truncate sm:whitespace-normal" title={feature}>

123-131: Add loading fallback and format star count

Improves perceived performance and readability for large numbers.

-                {stars !== null ? (
-                  <>
-                    {stars}
-                    <FaGithub size={32} />
-                  </>
-                ) : (
-                  <span>{error}</span>
-                )}
+                {stars !== null ? (
+                  <>
+                    {stars.toLocaleString()}
+                    <FaGithub size={32} />
+                  </>
+                ) : error ? (
+                  <span>{error}</span>
+                ) : (
+                  <span>Loading…</span>
+                )}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5d6e4ad and 4d74632.

📒 Files selected for processing (1)
  • eduaid_web/src/pages/Home.jsx (4 hunks)

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.

Fix responsiveness issue on home page

1 participant