Skip to content

Conversation

@estyxx
Copy link
Member

@estyxx estyxx commented Jan 19, 2026

What

ToDo

CleanShot 2026-01-19 at 08 47 27@2x

@estyxx estyxx self-assigned this Jan 19, 2026
@vercel
Copy link

vercel bot commented Jan 19, 2026

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

Project Deployment Review Updated (UTC)
pycon Ready Ready Preview Jan 19, 2026 9:55am

@estyxx
Copy link
Member Author

estyxx commented Jan 19, 2026

@claude do the code review. Missing a test, add one.

@claude
Copy link
Contributor

claude bot commented Jan 19, 2026

Claude finished @estyxx's task in 2m 36s —— View job


Code Review

Summary: This PR adds internal notes functionality to the grants recap view, allowing reviewers to edit internal notes directly from the recap page.

Changes reviewed:

  • backend/reviews/admin.py - Added POST data parsing for notes and update logic
  • backend/reviews/templates/grants-recap.html - Added UI for notes textarea and styling

Overall: The implementation looks good. A few observations:

backend/reviews/admin.py

  1. Lines 295-299: The notes parsing logic follows the same pattern as existing code. Good consistency.

  2. Lines 402-411: The notes update logic is straightforward:

    • It only updates grants where the notes have actually changed (good for avoiding unnecessary DB writes)
    • The code correctly checks if grant.internal_notes != new_notes before saving
  3. Minor suggestion: Consider adding an admin log entry when internal notes are changed, similar to how pending_status changes are logged (lines 363-367). This would provide an audit trail for note changes. However, this is optional since notes may be edited frequently and logging every change could be noisy.

backend/reviews/templates/grants-recap.html

The template changes are clean:

  • CSS styling for tooltip, notes-cell, and text alignment is well organized
  • The textarea includes proper permission check with {% if perms.reviews.decision_reviewsession %}
  • The read-only fallback shows {{ item.internal_notes|default:"-" }} for users without permission

No blocking issues found.


Tests Added

I've added two tests to backend/reviews/tests/test_admin.py:

  1. test_save_review_grants_updates_internal_notes - Tests that internal notes can be:

    • Added to a grant with empty notes
    • Updated on a grant with existing notes
    • Cleared on a grant with existing notes
  2. test_save_review_grants_does_not_update_unchanged_internal_notes - Tests that grants are not unnecessarily updated when notes haven't changed


Summary

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.43%. Comparing base (e34c7a8) to head (58ffa06).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4533   +/-   ##
=======================================
  Coverage   94.43%   94.43%           
=======================================
  Files         352      352           
  Lines       10162    10162           
  Branches      738      738           
=======================================
  Hits         9596     9596           
  Misses        468      468           
  Partials       98       98           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@estyxx estyxx merged commit f74c682 into main Jan 19, 2026
7 checks passed
@estyxx estyxx deleted the grants/review-recap-add-internal-notes branch January 19, 2026 13:37
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