Skip to content

Feature/sc 31715/sheets desktop notifications page #2410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 56 commits into
base: modularization-main
Choose a base branch
from

Conversation

yitzhakc
Copy link
Contributor

@yitzhakc yitzhakc commented Apr 10, 2025

Description

Configure notifications page to display only sheet-related notifications.

This pull request includes several changes to enhance the notification system by introducing scoped notifications and improving the user interface. The most important changes include adding scope functionality to notifications, updating the user interface to reflect these changes, and modifying the CSS for better styling.

Code Changes

Scope functionality for notifications:

  • reader/views.py: Added active_module to the request and used it in various functions to filter notifications by scope. [1] [2] [3] [4]
  • sefaria/model/notification.py: Introduced sheets_notification_types and added a helper method _build_query_with_scope to filter notifications by scope. Updated existing methods to use this helper method. [1] [2]
  • sefaria/model/user_profile.py: Modified recent_notifications and unread_notification_count to accept a scope parameter.
  • sefaria/urls.py: Added a new URL pattern for sheet notifications.

User interface updates:

CSS improvements:

  • static/css/s2.css: Changed the font family for notification titles and summaries to sans-serif and added a new class for styling notification user names. [1] [2]##

Notes

I refactored the generation of the notification queries to add awareness of the relevant scope (sheets or library)

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • static/css/s2.css: Language not supported
Comments suppressed due to low confidence (2)

sefaria/model/user_profile.py:600

  • Consider reviewing whether unread_notification_count should also support a scope parameter for consistency with recent_notifications. A consistent behavior may reduce potential confusion in production.
# TODO: Why do we not need to scope the notifications to the module here?

sefaria/model/notification.py:356

  • [nitpick] The conditional inline operator for setting the query operator may reduce readability. Consider refactoring by assigning the operator to a variable before using it in the query to improve clarity.
query["type"] = {"$in" if scope == 'sheets' else "$nin": Notification.sheets_notification_types}

…lesforce. Interface language and educator fields were switched
relyks and others added 26 commits May 7, 2025 13:13
…form-sign-up-producing

Hebrew newsletter form sign up producing wrong data in Salesforce
Update file and link for 2024 Impact Report
…ndex-title-autocomplete

Encode question marks in titles from autocpmleter
fix: don't fail on self.save when django user doesn't have mongo odject
chore(question mark): control for question mark in templating url and…
fix: configure heap size in nodejs deployment
chore(sentry): lower server rate to 1%
Override merging due to failing playwright tests
…e-for-romanian

Feature/sc 32313/adding iso code for romanian
Overriding merge queue due to failiing playwright tests
chore: Update node memory requirements
Revert "chore: Update node memory requirements"
Clear cache in node between requests
@stevekaplan123 stevekaplan123 changed the base branch from modularization-header-main to modularization-main May 25, 2025 11:45
@stevekaplan123 stevekaplan123 marked this pull request as ready for review May 26, 2025 09:13
stevekaplan123
stevekaplan123 previously approved these changes May 26, 2025
@yitzhakc yitzhakc dismissed stevekaplan123’s stale review May 27, 2025 12:14

The merge-base changed after approval.

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.

8 participants