Update changes
Dieser Commit ist enthalten in:
@ -879,13 +879,13 @@ pause
|
||||
"""Check if this project has active users"""
|
||||
from services.activity_sync import activity_service
|
||||
|
||||
logger.debug(f"check_activity called for project: {self.project.name}")
|
||||
# Cache the previous state to avoid unnecessary updates
|
||||
if not hasattr(self, '_last_activity_state'):
|
||||
self._last_activity_state = {'active': False, 'users': '', 'is_own': False}
|
||||
|
||||
# First check if this is our own current activity
|
||||
is_own_current = activity_service.is_project_active_for_user(self.project.name)
|
||||
|
||||
logger.debug(f"Current activity check - is_own_current: {is_own_current}")
|
||||
|
||||
# Get all activities for this project from server
|
||||
active_users = []
|
||||
is_own_activity = False
|
||||
@ -908,25 +908,30 @@ pause
|
||||
else:
|
||||
has_other_users = True
|
||||
|
||||
logger.debug(f"Server activities - active_users: {active_users}, is_own_activity: {is_own_activity}, has_other_users: {has_other_users}")
|
||||
|
||||
# If we have a local current activity, ensure it's included
|
||||
if is_own_current:
|
||||
is_own_activity = True
|
||||
if activity_service.user_name not in active_users:
|
||||
active_users.append(activity_service.user_name)
|
||||
logger.debug(f"Added local user to active_users: {activity_service.user_name}")
|
||||
|
||||
if active_users:
|
||||
# Show indicator with all active users
|
||||
user_text = ", ".join(active_users)
|
||||
# If both own and others are active, show as others (orange) to indicate collaboration
|
||||
final_is_own = is_own_activity and not has_other_users
|
||||
logger.info(f"Updating activity status for {self.project.name}: active=True, users={user_text}, is_own={final_is_own}")
|
||||
self.update_activity_status(True, user_text, final_is_own)
|
||||
else:
|
||||
logger.info(f"Updating activity status for {self.project.name}: active=False")
|
||||
self.update_activity_status(False)
|
||||
# Determine new state
|
||||
new_state = {
|
||||
'active': bool(active_users),
|
||||
'users': ', '.join(active_users) if active_users else '',
|
||||
'is_own': is_own_activity and not has_other_users if active_users else False
|
||||
}
|
||||
|
||||
# Only update UI if state has changed
|
||||
if new_state != self._last_activity_state:
|
||||
self._last_activity_state = new_state
|
||||
|
||||
if new_state['active']:
|
||||
# Only log significant changes (not every periodic check)
|
||||
logger.info(f"Activity status changed for {self.project.name}: active=True, users={new_state['users']}, is_own={new_state['is_own']}")
|
||||
self.update_activity_status(True, new_state['users'], new_state['is_own'])
|
||||
else:
|
||||
logger.info(f"Activity status changed for {self.project.name}: active=False")
|
||||
self.update_activity_status(False)
|
||||
|
||||
def _start_activity_animation(self):
|
||||
"""Start animated border for team activity"""
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren