refactor: make gif day noodle last 3 days - #3076
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe Changesgif-day schedule
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@app/components/Noodle/index.ts`:
- Line 80: Update the Noodle GIF configuration’s dateTo value from 2026-09-08 to
2026-09-07 so the inclusive range covers only September 5–7; keep the existing
date value unchanged.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: afd87c93-9a36-4f46-833d-e77ac8231716
📒 Files selected for processing (1)
app/components/Noodle/index.ts
| logo: NoodleGifDayLogo, | ||
| date: '2026-09-05', | ||
| dateTo: '2026-09-05', | ||
| dateTo: '2026-09-08', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg '(^|/)Noodle/index\.ts$|(^|/)IntroHeader\.vue$|(^|/)package\.json$' || true
echo "== Noodle outline =="
ast-grep outline app/components/Noodle/index.ts --view compact || true
echo "== Noodle relevant section =="
sed -n '1,130p' app/components/Noodle/index.ts 2>/dev/null || true
echo "== IntroHeader relevant sections =="
rg -n "date|dateTo|today|gif|GIF|Gif" app/components/Landing/IntroHeader.vue -C 3 || true
echo "== imports/usages of Noodle date props =="
rg -n "Noodle|date:|dateTo:" app -C 2 || true
echo "== git diff stat/name =="
git diff --stat HEAD~1..HEAD 2>/dev/null || git diff --stat 2>/dev/null || true
git diff -- app/components/Noodle/index.ts 2>/dev/null | sed -n '1,160p' || trueRepository: npmx-dev/npmx.dev
Length of output: 40415
🏁 Script executed:
#!/bin/bash
set -euo pipefail
node - <<'JS'
function calendarDays(startDate, endDate) {
const start = Date.UTC(Number(startDate.split('-')[0]), Number(startDate.split('-')[1]) - 1, Number(startDate.split('-')[2]))
const end = Date.UTC(Number(endDate.split('-')[0]), Number(endDate.split('-')[1]) - 1, Number(endDate.split('-')[2]))
if (end < start) throw new Error('end before start')
return Math.abs(Math.round((end - start) / 86400000)) + 1
}
const cases = [
{ date: '2026-09-05', dateTo: '2026-09-08' },
{ date: '2026-09-05', dateTo: undefined },
{ date: '2026-07-17', dateTo: '2026-07-19' },
{ date: '2026-06-06', dateTo: '2026-06-08' },
{ date: '2026-09-05', dateTo: '2026-09-07' },
]
for (const { date, dateTo } of cases) {
const currentActive = date && dateTo
? function todayMatches(date, dateTo) {
return function today(today) {
return today >= date && today <= dateTo
}
}(date, dateTo)
: undefined
console.log(JSON.stringify({
date,
dateTo,
calendarDays: dateTo ? calendarDays(date, dateTo) : null,
includedDays: currentActive
? ['2026-09-04','2026-09-05','2026-09-06','2026-09-07','2026-09-08','2026-09-09']
.filter(todayActive => currentActive(todayActive))
: undefined,
}))
}
JSRepository: npmx-dev/npmx.dev
Length of output: 602
Keep the GIF Day range to three days
IntroHeader.vue compares today with both date and dateTo inclusively. With date: '2026-09-05', setting dateTo: '2026-09-08' makes the noodle active on 5, 6, 7 and 8 September. Change it to 2026-09-07 unless the extended fourth day is intentional.
🤖 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 `@app/components/Noodle/index.ts` at line 80, Update the Noodle GIF
configuration’s dateTo value from 2026-09-08 to 2026-09-07 so the inclusive
range covers only September 5–7; keep the existing date value unchanged.
📚 Description
As suggested by @trueberryless, I've bumped the GIF day noodles to 3 days.
3 days of GIFs is better than 1 day of GIFs.