From 4b2b84793f2e3407f74a7598a47cd5b0873516df Mon Sep 17 00:00:00 2001 From: Bernard Siebens Date: Fri, 21 Aug 2026 15:00:16 +0200 Subject: [PATCH] Fix the bottom tab bar never actually highlighting the active screen active_tab/screen_title were set as class attributes on every screen view, but only ever threaded into the template context by _PlaceholderScreen's own get_context_data -- which no real M1-M7 screen has inherited from since each one got its own concrete implementation. Every screen's own get_context_data override skipped them, so `active_tab` was always undefined in the template and the tab bar never lit up. Defaulted both from the class attributes in PersonScopeMixin (every screen's shared base) via kwargs.setdefault, so a screen with its own dynamic screen_title (EventDetailView's event.title) still wins. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9 --- mobile/mixins.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mobile/mixins.py b/mobile/mixins.py index fd9d974..a2a472f 100644 --- a/mobile/mixins.py +++ b/mobile/mixins.py @@ -73,6 +73,16 @@ class PersonScopeMixin(ClubScopedPublicMixin): if self.managed_people: unread_notification_count = Notification.objects.filter(club=self.request.club, member__in=self.managed_people, read_at__isnull=True).count() + # Every screen sets these as class attributes (see e.g. HomeView.active_tab), + # but only a subclass that explicitly forwards them into its own + # get_context_data actually gets them into the template -- easy to forget + # (most screens' own get_context_data never touch either one), so default + # them here instead. setdefault, not an outright override: a screen with a + # dynamic title (EventDetailView's event.title) already passes its own + # screen_title through kwargs, and that must win. + kwargs.setdefault("active_tab", getattr(self, "active_tab", "")) + kwargs.setdefault("screen_title", getattr(self, "screen_title", "")) + return super().get_context_data( me=self.me, managed_people=self.managed_people,