Skip to content

Conversation

@jordyBSK
Copy link
Contributor

@jordyBSK jordyBSK commented Nov 18, 2025

image

@gemini-code-assist
Copy link

Summary of Changes

Hello @jordyBSK, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the child's timeline feature by incorporating child pictures alongside existing correspondence and gift entries. This provides users with a unified and richer chronological view of a child's journey, making the timeline a more complete record of interactions and milestones.

Highlights

  • Timeline Integration: Child pictures are now seamlessly integrated into the existing child timeline view, providing a more comprehensive chronological record.
  • Backend Data Fetching: The SQL queries responsible for fetching timeline data and total counts have been extended to include records from the compassion_child_pictures table.
  • Frontend Rendering: A new template block has been added to correctly render child picture entries within the timeline, displaying a link to the full image and its creation date.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds child's pictures to the timeline view. The changes include updating the backend controller to fetch picture data from the compassion_child_pictures table and modifying the timeline template to render these new items. My review focuses on improving code maintainability. I've noticed that several docstrings and an important explanatory comment have been removed from my_compassion/controllers/my2_children.py. I recommend restoring them to keep the code well-documented. Additionally, the SQL query formatting in _get_timeline_data has become inconsistent, and I suggest standardizing it for better readability. Finally, the docstring for _get_timeline_count should be updated to reflect the inclusion of child pictures in the count. The implementation for displaying the pictures in the timeline appears correct.

@jordyBSK
Copy link
Contributor Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully adds a new feature to display a child's pictures in the timeline. The changes involve updating the backend controller to fetch picture data and modifying the frontend template to render these new timeline items. While the feature implementation is good, I have identified a potential security concern in the data fetching logic that needs to be addressed. Additionally, I've noted some opportunities to improve code maintainability by restoring removed documentation.

Comment on lines 129 to 130
FROM compassion_child_pictures p
WHERE p.child_id = %(child_id)s

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The query for compassion_child_pictures is filtered only by child_id, while the queries for correspondence and sponsorship_gift are also filtered by partner_id. This inconsistency could potentially lead to information disclosure, where a sponsor might see pictures not intended for them if a child has had multiple sponsors over time.

If child pictures are meant to be visible to any sponsor with access to the child's profile, this may be intentional. However, the discrepancy with other timeline items warrants a security review.

If filtering by partner is required, and the compassion_child_pictures table contains a partner_id (or equivalent), please add the additional filter condition. For example:

WHERE p.child_id = %(child_id)s AND p.partner_id = ANY(%(partner_ids)s)

A similar change would be needed in the _get_timeline_count method. If the table structure doesn't support this, it might be worth discussing if the data model needs an update to ensure proper access control.

website=True,
sitemap=False,
)
def my2_render_child_timeline_page(self, child, **kwargs):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The docstring for this function was removed. To improve code readability and maintainability, it's best practice to include a docstring that explains the function's purpose. Please consider restoring it.

Suggested docstring:

"""Renders the main timeline page with the initial batch of records."""

website=True,
sitemap=False,
)
def my2_get_child_timeline_items(self, child, **kwargs):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The docstring and an important explanatory comment were removed from this function. This information is valuable for understanding the function's purpose as an API endpoint and the reasoning behind the error handling logic. Please consider restoring them to maintain code clarity.

The removed docstring was:

"""API endpoint for infinite scroll. Returns a rendered HTML snippet."""

And the comment:

# For an API, it's better to return an empty or error response
# than to redirect.

auth="user",
website=True,
)
def get_center_weather(self, child, **kw):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The docstring for get_center_weather was removed. Adding it back would help other developers understand what this controller does at a glance. Please consider restoring it.

The previous docstring was:

"""
This controller returns the child's center weather as a JSON object.
"""

…n-Timeline

# Conflicts:
#	my_compassion/controllers/my2_children.py
#	my_compassion/templates/components/my2_sponsor_child_timeline_batch.xml
@NoeBerdoz NoeBerdoz merged commit afc2fde into 14.0-MyCompassion2.0 Jan 14, 2026
1 check passed
@NoeBerdoz NoeBerdoz deleted the T2681-Add-Child's-pictures-in-Timeline branch January 14, 2026 15:09
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.

3 participants