Skip to content

feat(prelogin): public marketing site at /#1167

Open
jjackson wants to merge 1 commit intodimagi:mainfrom
jjackson:emdash/prelogin-cbn2e
Open

feat(prelogin): public marketing site at /#1167
jjackson wants to merge 1 commit intodimagi:mainfrom
jjackson:emdash/prelogin-cbn2e

Conversation

@jjackson
Copy link
Copy Markdown
Member

@jjackson jjackson commented May 7, 2026

Product Description

Visitors to / now land on a public marketing page (currently a placeholder mockup from Gillian, sourced manually from dimagi-internal/connect-prelogin) instead of the existing pages/home.html template. A header Login CTA takes signed-in users to /accounts/login/ (which then bounces them onward via LOGIN_REDIRECT_URL = users:redirect); anonymous visitors see the marketing page. Sign Up CTA links out to connect.dimagi.com/accounts/signup/.

This is the public-facing companion to a parallel landing site running on labs.connect.dimagi.com/ (connect-labs#169 — already merged). The new prelogin app is intentionally self-contained (no labs-specific or connect-specific imports beyond the one configurable setting) so the two deployments can stay in sync.

Technical Summary

  • New Django app commcare_connect/prelogin/ with one TemplateView for /.
  • The mockup HTML lives in commcare_connect/templates/prelogin/home.html as a self-contained document (own DOCTYPE + inline <style>, no base.html extension — the mockup ships its own typography and palette).
  • Header Login CTA's URL is read from PRELOGIN_APP_LOGIN_URL setting; default /accounts/login/.
  • Replaces the existing TemplateView(template_name="pages/home.html") at /.
  • Two prep edits applied at re-import time, documented in a Django comment at the top of home.html: strip the .mockup-bar element + its CSS rule (the top "MOCKUP" banner used in Gillian's preview), and template the login link's href.
  • name="home" is now namespaced as prelogin:home; the one inbound reverse("home") call in commcare_connect/users/views.py is updated.

Layout follows the project's house-style conventions (per CLAUDE.md):

  • Tests in commcare_connect/prelogin/tests/test_views.py (directory layout, pytest.mark-style fixture-based tests).
  • Template in top-level commcare_connect/templates/prelogin/ (not app-local).
  • No app-local static/; future static assets go in top-level commcare_connect/static/prelogin/.

Safety Assurance

Safety story

Static page, no models, no migrations, no data access, no auth changes. The only behavioral change is that / no longer renders pages/home.html — anonymous and authenticated visitors both see the marketing page; logged-in users navigate into the app via the header Login CTA (which falls through to allauth, which then forwards them via LOGIN_REDIRECT_URL). Blast radius: anyone with / bookmarked who expected the old pages/home.html content gets the new marketing page instead.

Automated test coverage

Three tests in commcare_connect/prelogin/tests/test_views.py:

  • test_renders_with_brandGET / returns 200 with expected branding text.
  • test_login_url_defaults_to_accounts_login — verifies the default for the login CTA.
  • test_login_url_respects_setting_override — locks the contract that the PRELOGIN_APP_LOGIN_URL override flows through.

QA Plan

  • Visit / on the deployed environment and confirm the marketing page renders without the "MOCKUP · Connect by Dimagi · v11 reshape …" top banner.
  • Confirm header Login CTA navigates to /accounts/login/ (and from there forwards correctly for already-signed-in users).
  • Confirm Sign Up CTA still points to connect.dimagi.com/accounts/signup/.

🤖 Generated with Claude Code

New `commcare_connect.prelogin` Django app — visitors to `/` land on a
self-contained marketing page (mockup sourced manually from
dimagi-internal/connect-prelogin) instead of the previous
`pages/home.html` template. The header Login CTA's URL is
configurable via the `PRELOGIN_APP_LOGIN_URL` setting (default
`/accounts/login/`).

Notes
- App is intentionally self-contained (no commcare-connect-specific
  imports beyond the setting) so the same files can also live in
  parallel deployments (labs).
- The mockup template is a single self-contained HTML document with
  inline `<style>`; it does not extend `base.html`. Two prep edits
  applied at re-import time and documented at the top of the file:
  strip the `.mockup-bar` mockup banner element + CSS, and template
  the login link's `href`.
- The previous global `name="home"` URL is now namespaced as
  `prelogin:home`; the one inbound `reverse("home")` call in
  `users/views.py` is updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cd77ee84-d256-43c9-ad60-708c7918914c

📥 Commits

Reviewing files that changed from the base of the PR and between 0245f06 and 328cdb0.

📒 Files selected for processing (10)
  • commcare_connect/prelogin/__init__.py
  • commcare_connect/prelogin/apps.py
  • commcare_connect/prelogin/tests/__init__.py
  • commcare_connect/prelogin/tests/test_views.py
  • commcare_connect/prelogin/urls.py
  • commcare_connect/prelogin/views.py
  • commcare_connect/templates/prelogin/home.html
  • commcare_connect/users/views.py
  • config/settings/base.py
  • config/urls.py

Walkthrough

This pull request introduces a new Django app commcare_connect.prelogin to provide a dedicated prelogin home page. The app is registered in settings, configured with a TemplateView that renders prelogin/home.html with a dynamic app_login_url context from settings, and wired into the root URL pattern. The root URL route is redirected from serving pages/home.html directly to including the prelogin app's URLconf. The user redirect view is updated to route users without memberships to prelogin:home. Tests verify the home page renders, brand text displays, and the login URL context respects both defaults and setting overrides.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: introducing a public marketing site at the root URL path. It directly reflects the primary product objective.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, covering product goals, technical implementation, safety assurance, and QA plan.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant