Skip to content

Add locally-triggered impact-stories prompt for super admins#14729

Merged
marcellamaki merged 1 commit into
learningequality:developfrom
rtibbles:laura_has_a_message_for_you
May 25, 2026
Merged

Add locally-triggered impact-stories prompt for super admins#14729
marcellamaki merged 1 commit into
learningequality:developfrom
rtibbles:laura_has_a_message_for_you

Conversation

@rtibbles
Copy link
Copy Markdown
Member

Summary

An in-app prompt asking super admins to share a Kolibri impact story, triggered locally so it reaches deployments the central pingback channel never sees. Appears when:

  • Sustained learner activity on the device over the last 90 days
  • No facility on the device is registered with KDP
  • Viewer is a super admin and UI language is English
State Screenshot
Desktop Desktop
Mobile Mobile

Accessibility audit (axe-core, WCAG AA): clean for the banner. The one pre-existing critical violation on the Device page (channel thumbnails missing alt) is unrelated to this PR.

References

No linked issue.

Reviewer guidance

Test plan:

  • Seed a row (`LocalNotification.objects.create(key="impact-stories")`), sign in as super admin in English UI — banner shows on `/device/` and `/facility/`
  • Dismiss removes the row
  • Non-English UI / non-superuser: no banner, no API call
  • Mobile viewport: QR hidden, link tappable

Risky areas:

  • `IsSuperuser.has_object_permission` (`kolibri/core/device/permissions.py`) — shared class; affects any future `IsSuperuser`-gated viewset with object-level actions
  • Bounded `ContentSessionLog` scan (`local_notifications.py`) — confirm the slice query plan is reasonable on your DB

AI usage

Used Claude Code for the PRD brainstorm, implementation, and a cleanup pass (reuse of `get_learner_count`, bounded query scan). User steered architecture and copy throughout, rejected several drafts. Verified end-to-end in a browser before commit.

@github-actions github-actions Bot added DEV: backend Python, databases, networking, filesystem... APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) DEV: frontend SIZE: large labels May 19, 2026
@rtibbles rtibbles force-pushed the laura_has_a_message_for_you branch from f780f0a to 5cc2b54 Compare May 21, 2026 19:34
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

@rtibbles rtibbles force-pushed the laura_has_a_message_for_you branch 2 times, most recently from dc27112 to dd007db Compare May 25, 2026 15:05
Surfaces an in-app banner on the Facility and Device pages asking
super admins to share a Kolibri impact story. The trigger is evaluated
entirely from local state — sustained learner activity over the last
90 days, no KDP-registered facilities on device — so the banner reaches
deployments that never come online for the central pingback channel.

Frontend gated to English UI for v1 (mirrors attendance / picture-login
pattern). Dismiss is a hard DELETE; cooldown is enforced by the
generator task rescheduling itself rather than by retaining dismissed
rows. Renders a WhatsApp QR + number paired with an online-form link;
QR is omitted on small viewports where the link is directly tappable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rtibbles rtibbles force-pushed the laura_has_a_message_for_you branch from dd007db to 8e69a54 Compare May 25, 2026 16:21
@rtibbles rtibbles marked this pull request as ready for review May 25, 2026 16:21
Copy link
Copy Markdown
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

reviewed code and manually tested end-to-end. works as described for all scenarios:

  • english display to admins
  • no display in non-english languages
  • no display after dismissal (dismissal persists on page refresh, and logging out and logging back in again)
  • QA code correctly opens whatsapp messaging to correct number, and is properly integrated with support channel

@marcellamaki marcellamaki merged commit eec38fb into learningequality:develop May 25, 2026
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend SIZE: large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants