[FEAT] Allow users to add custom/override emission factors (#152)#167
Conversation
fix: wrap login form in Suspense for useSearchParams build requirement
ci: run checks on Node 18.x and 20.x
ci: add coderabbit config and run checks on dev and main branches
Fix instructions for Open Source Contributions
Update readme
Merging Pull request from dev
Merging from dev to main branch
Merging dev into main branch Date: 28 june 2026
Merging dev into main branch (1 july 2026)
merging dev into main (7 july 2026)
Merging dev into main branch (8 july 2026)
…-tests test: Add unit tests for core functionality
…ub-actions ci: Implement GitHub Action for automated CI testing
…erfile build: Add Dockerfile for containerized development
…itecture docs: Create ARCHITECTURE.md documentation
|
@Dev1822 is attempting to deploy a commit to the Arghya's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThe emission factors settings page now loads system and custom factors separately, combines them with override metadata, and supports tabs, search, scope filtering, create/update forms, citations, controlled deletion, and system-factor overrides. A protected system-factors API route and dashboard navigation entry were added. ChangesEmission Factor Management
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5ee38386-5c55-4a1f-8a7a-c0bf5901b005
📒 Files selected for processing (4)
app/(dashboard)/settings/factors/page.tsxapp/api/system-factors/route.tscomponents/dashboard/dashboard-nav.tsxcomponents/ui/factor-row.tsx
📜 Review details
⚠️ CI failures not shown inline (1)
Commit Status: Vercel: Vercel
Conclusion: failure
Authorization required to deploy.
🔇 Additional comments (5)
app/api/system-factors/route.ts (1)
5-21: LGTM!components/dashboard/dashboard-nav.tsx (1)
23-23: LGTM!Also applies to: 41-41
app/(dashboard)/settings/factors/page.tsx (2)
27-34: LGTM!
156-201: LGTM!components/ui/factor-row.tsx (1)
8-134: LGTM!
Signed-off-by: Arghyadeep Bag <arghyadeep192@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
arghya29
left a comment
There was a problem hiding this comment.
@Dev1822 LGTM, I have fixed the Merge Conflicts.
One thing, the commit history is messy. Please always make branch from the latest dev branch to avoid such messy commit history.
I am doing squash and merge due to that reason for this PR
Description
This PR implements a full custom and override emission factor management feature. Authenticated users/organizations can now create, edit, list, and delete custom emission factors that take precedence over standard seeded system factors during carbon footprint calculations.
Key changes included:
/settings/factors) in the dashboard sidebar menu.GET /api/system-factorsroute to expose seeded standard emission factors.FactorRowcomponent with clear origin badges (SystemvsCustom), overridden badges, and active override details.SCOPE_1,SCOPE_2,SCOPE_3).window.confirm()withConfirmDialogfor safe deletion UX.Related Issue
Closes #152
Type of Change
Checklist
npm testand all tests pass (15 test suites, 83 tests passed)npm run lintwith no errorsSummary by CodeRabbit
New Features
Bug Fixes