diff --git a/src/utils/ui_enhancement.py b/src/utils/ui_enhancement.py index 4a07fdad..88017de6 100644 --- a/src/utils/ui_enhancement.py +++ b/src/utils/ui_enhancement.py @@ -20,6 +20,7 @@ def __init__(self): self.navigation_structure: Dict = {} self.accessibility_features: Dict[str, bool] = {} self.user_preferences: Dict[str, Dict] = {} + self.navigation_history: List[Dict] = [] def add_filter_option(self, category: str, options: List[str]): """Add filter options for a category.""" @@ -128,9 +129,18 @@ def get_ui_guidance(self, page: str) -> Dict: def track_navigation_flow(self, user_id: str, from_page: str, to_page: str): """Track user navigation for UX improvements.""" - return { + record = { "user_id": user_id, "from": from_page, "to": to_page, "timestamp": str(datetime.utcnow()), } + self.navigation_history.append(record) + return record + + def get_navigation_history(self, user_id: str) -> List[Dict]: + """Return navigation history for a specific user.""" + return [ + entry for entry in self.navigation_history + if entry.get("user_id") == user_id + ]