Repository navigation
chore(refactor): start using handlebars partials - #81
Conversation
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR introduces reusable Handlebars partials for rendering date ranges and tenure entries, adds infrastructure for dynamic partial loading, and refactors the resume template to delegate rendering logic to these partials. CSS selectors are updated to support new classes introduced by the partials. ChangesPartial Extraction and Dynamic Loading
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/_partials/date.handlebars`:
- Around line 2-7: The template currently nests the end-date rendering inside
the startDate check, so endDate (or required end dates via isEndDateRequired)
are suppressed when startDate is missing; update the Handlebars logic to render
startDate only when startDate exists ({{{date startDate}}}) and independently
render endDate when endDate exists or isEndDateRequired ({{`#if` (or endDate
isEndDateRequired)}}), and ensure the dash separator is emitted conditionally
only when startDate exists (i.e., render the " - " before the end-date output
only if startDate was present).
In `@src/index.js`:
- Around line 216-221: The loop over PARTIALS_DIR registers every directory
entry, causing EISDIR and incorrect partial names; update the discovery to only
process files ending with ".handlebars" (and skip directories) before calling
Handlebars.registerPartial: use fs.readdir with { withFileTypes: true } or
filter entries by extension (checking Dirent.isFile() or using path.extname) and
then read each file with fs.readFile and register it using path.basename(p,
'.handlebars') to ensure only proper .handlebars files are registered.
🪄 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: 906d14da-9e1f-4f5d-9c9c-dbcc2275a28a
📒 Files selected for processing (5)
src/_partials/date.handlebarssrc/_partials/tenure.handlebarssrc/index.jssrc/resume.handlebarssrc/style.css
Up until now, this project as duplicated content even though some sections were clearly similar. Let's finally define a `_partials` folder and centralize some of these into reusable partials. For now, just creates `tenure` and `date` but we can slowly migrate other things into partials as well and align things so it's easier to keep sections in sync.
See commit message.
In theory, this should change nothing for end users. At most, just some of the underlying HTML elements and CSS classes assigned. But the exported CV will visually look identical.
The output HTML is a bit leaner too which is nice, the fixture in the repository goes from 6.5 kB to 6.2 kB. 💪(•ᴗ•💪)
Summary by CodeRabbit
Release Notes
Refactor
Style