Skip to content

feat: semester autofill updated#235

Merged
MrImmortal09 merged 7 commits intoiiitl:mainfrom
SrujanTag:feat/semester-autofill-updated
Apr 12, 2026
Merged

feat: semester autofill updated#235
MrImmortal09 merged 7 commits intoiiitl:mainfrom
SrujanTag:feat/semester-autofill-updated

Conversation

@SrujanTag
Copy link
Copy Markdown
Contributor

@SrujanTag SrujanTag commented Apr 12, 2026

Resolves #231 .

Description

This PR auto-fills the Batch and Semester fields on the Upload Notes and Papers pages by using the year from the user's logged-in email

Live Demo (if any)

Screenshot 2026-04-12 111351 Screenshot 2026-04-12 111329

Note for Maintainer

I added a condition inside the useEffect (if (formData.year === ''...)) . Without this check, auto-filling the semester and batch triggers the effect to run again, causing an infinite loop and crashing the page.

Checkout

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

Summary by CodeRabbit

  • New Features
    • Upload forms for notes and papers now auto-fill Year and Semester from your account email when those fields are empty, using your inferred academic timeline (semester constrained to 1–8).
  • Bug Fixes
    • Year and Semester selectors are now reliably controlled by the form state so the UI consistently reflects auto-filled values and avoids unintended overwrites.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 12, 2026

@SrujanTag is attempting to deploy a commit to the mrimmortal09's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

Walkthrough

Added a new useSemesterAutofill hook and integrated it into two upload pages to parse a 4-digit batch year from the authenticated user's email and compute a semester number based on the current date, auto-populating formData.year and formData.semester only when both are empty.

Changes

Cohort / File(s) Summary
Autofill hook
hooks/useSemesterAutofill.ts
New exported hook that reads session.user.email, extracts the first 20xx year token, computes semester from current date (clamped to 1–8), and sets form state when both year and semester are empty.
Upload pages integration
app/upload-notes/page.tsx, app/upload-papers/page.tsx
Consume session from useSession and wire useSemesterAutofill(...); make Year/Semester selects controlled (`value={formData.year

Sequence Diagram(s)

sequenceDiagram
  participant Browser as Browser (Form)
  participant Hook as useSemesterAutofill
  participant Auth as NextAuth Session
  participant State as Form State (setFormData)

  Browser->>Auth: request session (useSession)
  Auth-->>Browser: session with user.email
  Browser->>Hook: call useSemesterAutofill(session, year, semester, setFormData)
  Hook->>Hook: extract year from email (/\20\d{2}/)
  Hook->>Hook: compute semester from current date (clamped 1–8)
  alt year & semester are empty
    Hook->>State: setFormData({ year, semester })
    State-->>Browser: form updates (controlled selects show values)
  else populated
    Hook-->>Browser: no update (fields left for user)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 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.
Title check ❓ Inconclusive The title 'feat: semester autofill updated' is partially related to the changeset, referring to a real aspect of the changes (semester autofill functionality) but being vague about what was updated. Consider a more specific title like 'feat: extract useSemesterAutofill hook and fix Select value bindings' to clarify the main changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The pull request successfully implements all coding requirements from issue #231: extracts batch year from user email, calculates semester based on current date with proper clamping [1-8], and allows manual field edits.
Out of Scope Changes check ✅ Passed All changes are within scope: extracting a reusable useSemesterAutofill hook, fixing Select value bindings, and adding autofill integration align with resolving #231.

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

@SrujanTag SrujanTag changed the title Feat/semester autofill updated feat: semester autofill updated Apr 12, 2026
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)
app/upload-papers/page.tsx (1)

401-444: ⚠️ Potential issue | 🔴 Critical

Critical: Select components are missing value prop — auto-filled values won't display.

The auto-fill effect updates formData.year and formData.semester, but these Select components don't have a value prop bound to the state. The dropdowns will remain showing placeholders even after auto-fill succeeds.

Compare with upload-notes/page.tsx (lines 409-445) which correctly uses value={formData.year || ''} and value={formData.semester || ''}.

🐛 Proposed fix to add value props
               <Select
+                value={formData.year || undefined}
                 onValueChange={(value: string) =>
                   handleSelectChange('year', value)
                 }
               >
               <Select
+                value={formData.semester || undefined}
                 onValueChange={(value: string) =>
                   handleSelectChange('semester', value)
                 }
               >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/upload-papers/page.tsx` around lines 401 - 444, The Select components for
year and semester are missing bound values so auto-filled formData isn't shown;
update the two Select elements to include value props bound to state (e.g.,
value={formData.year || ''} on the year Select and value={formData.semester ||
''} on the semester Select) so the UI reflects auto-fill, keeping the existing
onValueChange handler (handleSelectChange) intact.
🧹 Nitpick comments (1)
app/upload-papers/page.tsx (1)

78-105: Consider extracting auto-fill logic to a shared custom hook.

This entire effect block is duplicated verbatim in app/upload-notes/page.tsx (lines 75-102). Extracting to a shared hook (e.g., useBatchSemesterAutofill) would reduce duplication and make future maintenance easier.

♻️ Example shared hook

Create hooks/useBatchSemesterAutofill.ts:

import { useEffect } from 'react'
import { useSession } from 'next-auth/react'

export function useBatchSemesterAutofill(
  currentYear: string,
  currentSemester: string,
  onAutofill: (year: string, semester: string) => void
) {
  const { data: session } = useSession()

  useEffect(() => {
    if (session?.user?.email && currentYear === '' && currentSemester === '') {
      const yearMatch = session.user.email.match(/\d{4}/)
      const batchYear = yearMatch?.[0]
      if (!batchYear) return

      const today = new Date()
      const yearDiff = today.getFullYear() - parseInt(batchYear)
      let calcSem = today.getMonth() + 1 >= 8 ? yearDiff * 2 + 1 : yearDiff * 2
      calcSem = Math.max(1, Math.min(8, calcSem))

      onAutofill(batchYear, String(calcSem))
    }
  }, [session, currentYear, currentSemester, onAutofill])
}

Then use in both pages:

useBatchSemesterAutofill(
  formData.year,
  formData.semester,
  useCallback((year, semester) => {
    setFormData(prev => ({ ...prev, year, semester }))
  }, [])
)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/upload-papers/page.tsx` around lines 78 - 105, The effect that auto-fills
batch year/semester is duplicated; extract it into a reusable hook (e.g.,
useBatchSemesterAutofill) and replace the inline useEffect in
app/upload-papers/page.tsx and app/upload-notes/page.tsx with a call to that
hook. The hook should read session (useSession), compute batchYear from
session.user.email (match(/\d{4}/)), calculate calcSem using current month/year
and clamp to 1..8, and invoke a callback like onAutofill(year, semester); update
the pages to call useBatchSemesterAutofill(formData.year, formData.semester,
useCallback((y,s) => setFormData(prev => ({...prev, year: y, semester: s})),
[])) so all logic (previously inside the useEffect) is centralized in
useBatchSemesterAutofill.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@app/upload-papers/page.tsx`:
- Around line 401-444: The Select components for year and semester are missing
bound values so auto-filled formData isn't shown; update the two Select elements
to include value props bound to state (e.g., value={formData.year || ''} on the
year Select and value={formData.semester || ''} on the semester Select) so the
UI reflects auto-fill, keeping the existing onValueChange handler
(handleSelectChange) intact.

---

Nitpick comments:
In `@app/upload-papers/page.tsx`:
- Around line 78-105: The effect that auto-fills batch year/semester is
duplicated; extract it into a reusable hook (e.g., useBatchSemesterAutofill) and
replace the inline useEffect in app/upload-papers/page.tsx and
app/upload-notes/page.tsx with a call to that hook. The hook should read session
(useSession), compute batchYear from session.user.email (match(/\d{4}/)),
calculate calcSem using current month/year and clamp to 1..8, and invoke a
callback like onAutofill(year, semester); update the pages to call
useBatchSemesterAutofill(formData.year, formData.semester, useCallback((y,s) =>
setFormData(prev => ({...prev, year: y, semester: s})), [])) so all logic
(previously inside the useEffect) is centralized in useBatchSemesterAutofill.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad255dbf-e5c9-441c-b5c4-4bfd77e81f68

📥 Commits

Reviewing files that changed from the base of the PR and between 6c2703b and 29cb88e.

📒 Files selected for processing (2)
  • app/upload-notes/page.tsx
  • app/upload-papers/page.tsx

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 12, 2026

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

Project Deployment Actions Updated (UTC)
student-hub Ready Ready Preview, Comment Apr 12, 2026 11:02am

@MrImmortal09
Copy link
Copy Markdown
Collaborator

@coderabbitai full-review

@MrImmortal09
Copy link
Copy Markdown
Collaborator

@coderabbitai Where is the data: session coming from? Do we store it?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

I'll fetch the changed files to perform a thorough review.


🏁 Script executed:

#!/bin/bash
echo "=== upload-notes/page.tsx ==="
cat app/upload-notes/page.tsx

echo ""
echo "=== upload-papers/page.tsx ==="
cat app/upload-papers/page.tsx

Length of output: 38766


@MrImmortal09 — Here is a full review of PR #235.


PR Review: Feat/semester autofill updated

The screenshots confirm that the auto-fill logic is mathematically correct — Batch 2024 → Semester 4 and Batch 2023 → Semester 6 for April 2026 are both right. However, there is one critical bug and several issues that need attention before merging.


🔴 Critical Bug — upload-papers/page.tsx: Auto-filled values are invisible

The Year and Semester <Select> components in upload-papers/page.tsx are missing the value prop. Even though setFormData updates the state correctly, the Radix/shadcn <Select> will continue to show its placeholder ("Select year", "Select semester") because it has no way to reflect the controlled value.

Compare the two files:

upload-notes/page.tsx (correct):

<Select
  value={formData.year || ''}           // ✅ controlled value bound
  onValueChange={(v) => handleSelectChange('year', v)}
>

upload-papers/page.tsx (broken):

<Select
  onValueChange={(value: string) => handleSelectChange('year', value)}  // ❌ no value prop
>

Fix for upload-papers/page.tsx:

{/* Year Field */}
<Select
  value={formData.year || ''}
  onValueChange={(value: string) => handleSelectChange('year', value)}
>
  <SelectTrigger>
    <SelectValue placeholder="Select year" />
  </SelectTrigger>
  ...
</Select>

{/* Semester Field */}
<Select
  value={formData.semester || ''}
  onValueChange={(value: string) => handleSelectChange('semester', value)}
>
  <SelectTrigger>
    <SelectValue placeholder="Select semester" />
  </SelectTrigger>
  ...
</Select>

🟠 Major — Code Duplication: Extract a Custom Hook

The auto-fill useEffect is identical across both files. This violates DRY and means any future bug fix must be applied in two places. Extract it into a reusable hook:

// hooks/useSemesterAutofill.ts
import { useEffect } from 'react'
import { Session } from 'next-auth'

export function useSemesterAutofill(
  session: Session | null,
  year: string,
  semester: string,
  setFormData: (updater: (prev: Record<string, string>) => Record<string, string>) => void
) {
  useEffect(() => {
    if (!session?.user?.email) return

    const yearMatch = session.user.email.match(/20\d{2}/)
    const batchYear = yearMatch ? yearMatch[0] : ''
    if (!batchYear) return

    const today = new Date()
    const currentYear = today.getFullYear()
    const currentMonth = today.getMonth() + 1
    const yearDiff = currentYear - parseInt(batchYear, 10)
    let calcSem = currentMonth >= 8 ? yearDiff * 2 + 1 : yearDiff * 2
    calcSem = Math.min(8, Math.max(1, calcSem))

    if (year === '' && semester === '') {
      setFormData((prev) => ({
        ...prev,
        year: batchYear,
        semester: String(calcSem),
      }))
    }
  }, [session, year, semester, setFormData])
}

🟡 Minor Issues

1. Regex is too broad — use /20\d{2}/ instead of /\d{4}/

email.match(/\d{4}/) matches the first 4-digit sequence in the email. For a normal IIITL email like [email protected] this is fine, but if any part of the email contained another 4-digit sequence before the year (e.g., a custom department prefix), it would silently pick the wrong number.

// Before
const yearMatch = email.match(/\d{4}/)

// After — specifically targets 20xx batch years
const yearMatch = email.match(/20\d{2}/)

2. parseInt without radix

parseInt(batchYear) should always be called with an explicit radix to avoid unexpected behavior in legacy environments.

// Before
const joinYear = parseInt(batchYear)

// After
const joinYear = parseInt(batchYear, 10)

3. Guard condition is asymmetric

if (formData.year === '' && formData.semester === '') {

If for any reason only one of the two fields is empty (e.g., the user clears just the Year field), the auto-fill will never trigger to fill it back. Consider whether this is the intended UX or if separate guards per field would be more robust.

4. Unnecessary effect re-runs on every user selection

Since formData.year and formData.semester are in the dependency array, the effect re-runs on every dropdown change. The guard prevents overwrites, but Math calculations still run on every keystroke. This is a minor performance concern. Using a useRef flag or useCallback for setFormData could address this if the form grows more complex.


✅ What's Done Well

  • The semester formula yearDiff * 2 + (month >= 8 ? 1 : 0) with [1, 8] clamping is correct and matches the expected output shown in screenshots.
  • The guard condition formData.year === '' && formData.semester === '' correctly prevents overwriting user edits.
  • After a successful upload, the form resets to '' and the effect re-autofills — this is the right behavior for repeated uploads.
  • The upload-notes/page.tsx implementation is correctly wired with value props on the Selects.

Summary Table

Severity File Issue
🔴 Critical upload-papers/page.tsx Missing value prop on Year and Semester <Select> — auto-fill state is set but not displayed
🟠 Major Both files Duplicated useEffect — should be extracted to a custom hook
🟡 Minor Both files Regex /\d{4}/ too broad — use /20\d{2}/
🟡 Minor Both files parseInt missing radix argument
🟡 Minor Both files Asymmetric guard condition for partial-empty state

The critical bug in upload-papers/page.tsx must be fixed before merging — without the value prop, the auto-fill feature effectively doesn't work on that page despite the state being correctly computed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the upload-notes page for session usage
fd "page.tsx" --full-path | grep -E "upload-notes|upload-papers" | xargs cat

# Find NextAuth configuration
fd -e ts -e tsx --full-path | xargs grep -l "NextAuth\|next-auth" 2>/dev/null | head -20

Length of output: 39242


🏁 Script executed:

#!/bin/bash
# Check NextAuth options/configuration
cat app/api/auth/\[...nextauth\]/options.ts
cat app/api/auth/\[...nextauth\]/route.ts

Length of output: 5655


@MrImmortal09 Great question! Here's the full picture:


Where does data: session come from?

const { data: session, status } = useSession()

useSession() is a client-side hook from next-auth/react. It reads the session from a signed JWT stored in a browser cookie — no extra database call happens on each render. The JWT is decoded transparently by NextAuth on the client side.


How is the session populated?

The flow is defined in app/api/auth/[...nextauth]/options.ts:

  1. At sign-in (Google OAuth or Credentials), the jwt callback runs and stores data into the token:

    async jwt({ token, user }) {
      if (user) {
        token.sub = user.id   // MongoDB _id
        token.roles = user.roles
      }
      return token
    }
  2. On each request, the session callback maps the token into the session object:

    async session({ session, token }) {
      session.user.id = token.sub
      session.user.roles = token.roles
      return session
    }

    session.user.email is automatically carried from the provider (Google or Credentials) by NextAuth itself.


Is it stored anywhere?

What Where
User record (name, email, roles, googleId, etc.) ✅ Stored in MongoDB
Session itself Not in DB — it's a stateless JWT in a browser cookie

The config explicitly sets:

session: {
  strategy: 'jwt',   // stateless, no DB session table
  maxAge: 24 * 60 * 60,  // 24-hour expiry
}

Relevance to this PR

The session.user.email used for autofill (e.g., [email protected]) comes directly from the JWT cookie set at login time. It's the IIITL institutional email that was validated during the Google sign-in flow (endsWith('@iiitl.ac.in') check in the signIn callback). No additional storage or fetch is needed to access it in the component.

@MrImmortal09
Copy link
Copy Markdown
Collaborator

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain
I'll fetch the changed files to perform a thorough review.

🏁 Script executed:

#!/bin/bash
echo "=== upload-notes/page.tsx ==="
cat app/upload-notes/page.tsx

echo ""
echo "=== upload-papers/page.tsx ==="
cat app/upload-papers/page.tsx

Length of output: 38766

@MrImmortal09 — Here is a full review of PR #235.

PR Review: Feat/semester autofill updated

The screenshots confirm that the auto-fill logic is mathematically correct — Batch 2024 → Semester 4 and Batch 2023 → Semester 6 for April 2026 are both right. However, there is one critical bug and several issues that need attention before merging.

🔴 Critical Bug — upload-papers/page.tsx: Auto-filled values are invisible

The Year and Semester <Select> components in upload-papers/page.tsx are missing the value prop. Even though setFormData updates the state correctly, the Radix/shadcn <Select> will continue to show its placeholder ("Select year", "Select semester") because it has no way to reflect the controlled value.

Compare the two files:

upload-notes/page.tsx (correct):

<Select
  value={formData.year || ''}           // ✅ controlled value bound
  onValueChange={(v) => handleSelectChange('year', v)}
>

upload-papers/page.tsx (broken):

<Select
  onValueChange={(value: string) => handleSelectChange('year', value)}  // ❌ no value prop
>

Fix for upload-papers/page.tsx:

{/* Year Field */}
<Select
  value={formData.year || ''}
  onValueChange={(value: string) => handleSelectChange('year', value)}
>
  <SelectTrigger>
    <SelectValue placeholder="Select year" />
  </SelectTrigger>
  ...
</Select>

{/* Semester Field */}
<Select
  value={formData.semester || ''}
  onValueChange={(value: string) => handleSelectChange('semester', value)}
>
  <SelectTrigger>
    <SelectValue placeholder="Select semester" />
  </SelectTrigger>
  ...
</Select>

🟠 Major — Code Duplication: Extract a Custom Hook

The auto-fill useEffect is identical across both files. This violates DRY and means any future bug fix must be applied in two places. Extract it into a reusable hook:

// hooks/useSemesterAutofill.ts
import { useEffect } from 'react'
import { Session } from 'next-auth'

export function useSemesterAutofill(
  session: Session | null,
  year: string,
  semester: string,
  setFormData: (updater: (prev: Record<string, string>) => Record<string, string>) => void
) {
  useEffect(() => {
    if (!session?.user?.email) return

    const yearMatch = session.user.email.match(/20\d{2}/)
    const batchYear = yearMatch ? yearMatch[0] : ''
    if (!batchYear) return

    const today = new Date()
    const currentYear = today.getFullYear()
    const currentMonth = today.getMonth() + 1
    const yearDiff = currentYear - parseInt(batchYear, 10)
    let calcSem = currentMonth >= 8 ? yearDiff * 2 + 1 : yearDiff * 2
    calcSem = Math.min(8, Math.max(1, calcSem))

    if (year === '' && semester === '') {
      setFormData((prev) => ({
        ...prev,
        year: batchYear,
        semester: String(calcSem),
      }))
    }
  }, [session, year, semester, setFormData])
}

🟡 Minor Issues

1. Regex is too broad — use /20\d{2}/ instead of /\d{4}/

email.match(/\d{4}/) matches the first 4-digit sequence in the email. For a normal IIITL email like [email protected] this is fine, but if any part of the email contained another 4-digit sequence before the year (e.g., a custom department prefix), it would silently pick the wrong number.

// Before
const yearMatch = email.match(/\d{4}/)

// After — specifically targets 20xx batch years
const yearMatch = email.match(/20\d{2}/)

2. parseInt without radix

parseInt(batchYear) should always be called with an explicit radix to avoid unexpected behavior in legacy environments.

// Before
const joinYear = parseInt(batchYear)

// After
const joinYear = parseInt(batchYear, 10)

3. Guard condition is asymmetric

if (formData.year === '' && formData.semester === '') {

If for any reason only one of the two fields is empty (e.g., the user clears just the Year field), the auto-fill will never trigger to fill it back. Consider whether this is the intended UX or if separate guards per field would be more robust.

4. Unnecessary effect re-runs on every user selection

Since formData.year and formData.semester are in the dependency array, the effect re-runs on every dropdown change. The guard prevents overwrites, but Math calculations still run on every keystroke. This is a minor performance concern. Using a useRef flag or useCallback for setFormData could address this if the form grows more complex.

✅ What's Done Well

  • The semester formula yearDiff * 2 + (month >= 8 ? 1 : 0) with [1, 8] clamping is correct and matches the expected output shown in screenshots.
  • The guard condition formData.year === '' && formData.semester === '' correctly prevents overwriting user edits.
  • After a successful upload, the form resets to '' and the effect re-autofills — this is the right behavior for repeated uploads.
  • The upload-notes/page.tsx implementation is correctly wired with value props on the Selects.

Summary Table

Severity File Issue
🔴 Critical upload-papers/page.tsx Missing value prop on Year and Semester <Select> — auto-fill state is set but not displayed
🟠 Major Both files Duplicated useEffect — should be extracted to a custom hook
🟡 Minor Both files Regex /\d{4}/ too broad — use /20\d{2}/
🟡 Minor Both files parseInt missing radix argument
🟡 Minor Both files Asymmetric guard condition for partial-empty state
The critical bug in upload-papers/page.tsx must be fixed before merging — without the value prop, the auto-fill feature effectively doesn't work on that page despite the state being correctly computed.

@SrujanTag note

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@hooks/useSemesterAutofill.ts`:
- Around line 17-22: The semester calculation uses client-local Date (today,
currentYear, currentMonth) which causes timezone-dependent results; switch to
using UTC-based values (getUTCFullYear and getUTCMonth) so the month/year are
computed in a standardized timezone before computing yearDiff and calcSem (keep
the existing logic that treats month>=8 as the August cutoff and the clamp with
Math.min/Math.max); update references to
today/currentYear/currentMonth/yearDiff/calcSem/batchYear accordingly.
🪄 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: ec9972a0-9640-44f9-b5eb-ddf1eb1a333c

📥 Commits

Reviewing files that changed from the base of the PR and between 29cb88e and ec8113f.

📒 Files selected for processing (3)
  • app/upload-notes/page.tsx
  • app/upload-papers/page.tsx
  • hooks/useSemesterAutofill.ts
✅ Files skipped from review due to trivial changes (1)
  • app/upload-notes/page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/upload-papers/page.tsx

Comment thread hooks/useSemesterAutofill.ts
Copy link
Copy Markdown
Collaborator

@MrImmortal09 MrImmortal09 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 ca17067 into iiitl:main Apr 12, 2026
5 checks passed
@MrImmortal09
Copy link
Copy Markdown
Collaborator

+5 for proper handling of merge conflicts

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.

[feat]: Autofill Batch & Semester in Upload Form

2 participants