Skip to content

Update year label to clarify its meaning#203

Merged
MrImmortal09 merged 1 commit intomainfrom
MrImmortal09-patch-1
Jan 11, 2026
Merged

Update year label to clarify its meaning#203
MrImmortal09 merged 1 commit intomainfrom
MrImmortal09-patch-1

Conversation

@MrImmortal09
Copy link
Collaborator

@MrImmortal09 MrImmortal09 commented Jan 6, 2026

Resolves #{{TODO: add issue number}}.

Description

What is the purpose of this pull request?

Live Demo (if any)

If applicable, include a link or screenshots of a live demo

Note for Maintainer

Add any special notes for the maintainer

Checkout

  • I have read all the contributor guidelines for the repo.

Summary by CodeRabbit

  • Chores
    • Updated the Year field label on the upload papers page for improved clarity.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Contributor

vercel bot commented Jan 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
student-hub Ready Ready Preview, Comment Jan 6, 2026 0:33am

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

Walkthrough

A form field label in the upload papers page was updated to provide clearer context. The "Year " label was changed to "Batch(The Joining Year of the batch that gave the exam)" to better describe the field's purpose. No functional changes or logic modifications were made.

Changes

Cohort / File(s) Summary
Form Label Update
app/upload-papers/page.tsx
Updated field label text from "Year " to "Batch(The Joining Year of the batch that gave the exam)" for improved clarity. No logic or validation changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update year label to clarify its meaning' directly and accurately describes the main change: updating the Year field label from 'Year ' to 'Batch(The Joining Year of the batch that gave the exam) for clarification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

@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 (2)
app/upload-papers/page.tsx (2)

30-30: Remove unused session destructuring.

The session variable from useSession() is never referenced in the component. Only status is used for authentication checks. Removing it will resolve the pipeline warning and improve code clarity.

🔎 Proposed fix
- const { data: session, status } = useSession()
+ const { status } = useSession()

49-49: Remove unused isLoadingSubjects state variable.

The state is updated during the fetch operation (lines 62, 71) but never read in the component. The subjects are loaded regardless of this state. Either use it to display loading feedback to the user (e.g., disable the subject dropdown, show a skeleton, or spinner) or remove it entirely.

🔎 Proposed fix

Option 1: Remove the unused state

- const [isLoadingSubjects, setIsLoadingSubjects] = useState(false)
  
  useEffect(() => {
    const fetchSubjects = async () => {
      try {
-       setIsLoadingSubjects(true)
        const response = await fetch('/api/papers/subjects')
        const data = await response.json()
        if (data.success) {
          setSubjects(data.subjects)
        }
      } catch (error) {
        console.error('Failed to fetch subjects:', error)
-     } finally {
-       setIsLoadingSubjects(false)
      }
    }
    
    fetchSubjects()
  }, [])

Option 2: Use it to improve UX (show loading state)

  <Select
    onValueChange={(value) =>
      handleSelectChange('subject', value)
    }
+   disabled={isLoadingSubjects}
    value={...}
  >
🧹 Nitpick comments (1)
app/upload-papers/page.tsx (1)

370-370: Label text is clearer but verbose and may have mobile layout implications.

While the expanded label provides helpful context, the text is lengthy and could wrap awkwardly on smaller screens. Consider breaking it into multiple lines or using a more concise format with better visual hierarchy.

🔎 Suggested refactoring options

Option 1: Line break for better readability

- Batch(The Joining Year of the batch that gave the exam)*
+ Batch<br/>(The Joining Year of the batch that gave the exam)*

Option 2: More concise with sub-label (preferred for responsive design)

  <Label htmlFor="year" className="flex items-center gap-2">
    <Calendar className="h-4 w-4" />
-   Batch(The Joining Year of the batch that gave the exam)*
+   Batch Year *
  </Label>
+ <p className="text-xs text-muted-foreground">
+   The joining year of the batch that gave the exam
+ </p>

Option 3: Tooltip for additional context (if your component library supports it)

- Batch(The Joining Year of the batch that gave the exam)*
+ Batch Year *
+ {/* Add Tooltip component showing the description */}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9951fe9 and 425bc60.

📒 Files selected for processing (1)
  • app/upload-papers/page.tsx
🧰 Additional context used
🪛 GitHub Actions: Verify
app/upload-papers/page.tsx

[warning] 30-30: 'session' is assigned a value but never used. (no-unused-vars)


[warning] 49-49: 'isLoadingSubjects' is assigned a value but never used. (no-unused-vars)

Copy link
Contributor

@TanishMoral11 TanishMoral11 left a comment

Choose a reason for hiding this comment

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

LGTM !!

@MrImmortal09 MrImmortal09 merged commit fab46be into main Jan 11, 2026
4 of 5 checks passed
@MrImmortal09 MrImmortal09 deleted the MrImmortal09-patch-1 branch January 11, 2026 17:45
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