Skip to content

Story #2439: Manage Mailing Lists in the Profile Edit UI - #2538

Merged
herzog0 merged 10 commits into
developfrom
teo/2439-manage-mailing-list
Aug 25, 2026
Merged

Story #2439: Manage Mailing Lists in the Profile Edit UI#2538
herzog0 merged 10 commits into
developfrom
teo/2439-manage-mailing-list

Conversation

@herzog0

@herzog0 herzog0 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Issue: #2439

Summary & Context

Adds mailing list management to the edit profile page. The existing subscribe/manage card (already used on the community, learn, library, and release pages) is reused as-is at the bottom of the left column, and the "Delete account" card moves to the bottom of the right column to make room for it.
⚠️ This implementation drifts from the Figma specification, but this is intentional and confirmed/accepted by Rob in this thread.

Changes

  • CurrentUserProfileView now includes MailingListCardMixin (users/views.py), so the edit page gets the same mailing_list_card_* context (subscribe/modal URLs, subscription state, list options) as every other page that embeds the card.
  • templates/v3/user_profile_edit.html: the mailing-list card (_mailing_list_card.html) is now rendered at the bottom of the left column, right after the Profile card. No new markup, CSS, or JS - it's the exact same include and behavior (quick-subscribe form, "Manage your lists" modal, HTMX swap, no-JS PRG fallback) used elsewhere.
  • The "Delete account" card moved to the bottom of the right column, after the account-connections card.
  • No new CSS was needed - mailing-list-card.css is already loaded globally via css/v3/components.css in base.html.

‼️ Risks & Considerations ‼️

Please list any potential risks or areas that need extra attention during review/testing

  • Purely a placement/wiring change - no changes to the mailing list card's markup, styles, or view logic, so its existing behavior (states, HTMX, no-JS fallback) carries over unchanged.
  • manage_url for this card resolves to profile-account (this same edit page), so "Manage your lists" from other pages and the card's own state on this page both point back here - confirmed this doesn't create a redirect loop.
  • Noticed a pre-existing, unrelated console error (autoInit is not defined) coming from the Biography WYSIWYG editor init script on this page - present before this change and not touched by it.

Screenshots

image image image

Peer-review testing steps

First of all, checkout the new doc file in docs/mailman/local-testing.md. After reading through that and settings things up, come back to the steps below (skipping what you've already done).

  1. Enable the v3 Waffle flag and log in.
  2. Go to /users/me/?edit=true. Confirm the "Join the Boost Developers Mailing List" card renders at the bottom of the left column, right after the Profile card.
  3. Confirm "Delete account" now renders at the bottom of the right column, after Account connections.
  4. Enter an email and submit the quick-subscribe form - confirm the "Join the Boost Developer Mailing List" modal opens with the list checkboxes, same as on /community/.
  5. Confirm/select lists and hit Confirm - verify the card swaps in place (HTMX) to reflect the new subscription state.
  6. If your test user already has an active/pending subscription, confirm the card shows the "Subscribed"/"Pending" state with a "Manage your lists" button that reopens the modal.
  7. Toggle dark mode and confirm both the mailing-list card and the relocated Delete account card render correctly.
  8. With JS disabled, confirm the quick-subscribe form still submits (PRG) and the page reloads with the correct card state.

Self-review Checklist

  • Tag at least one team member from each team to review this PR
  • Link this PR to the related GitHub Project ticket

Frontend

  • UI implementation matches Figma design
  • Tested in light and dark mode
  • Responsive / mobile verified
  • Accessibility checked (keyboard navigation, etc.)
  • Ensure design tokens are used for colors, spacing, typography, etc. - No hardcoded values
  • Test without JavaScript (if applicable)
  • No console errors or warnings

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added a mailing list preferences card to the user profile page.
  • UI Changes

    • Improved mailing list selection with checkbox counting and Select All controls.
    • Reordered profile sections and updated the Delete Account area with a static warning and shared error styling.
  • Documentation

    • Expanded Mailman local end-to-end testing instructions and updated references.
  • Chores

    • Updated local Mailman configuration and helper scripts to derive list domains automatically.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The profile view now renders mailing-list controls through MailingListCardMixin. Local Mailman list creation derives domains from MAILMAN_REST_API_URL. The profile template adds the mailing-list card and moves the delete-account card to a later position.

Changes

Mailing-list profile integration and local setup

Layer / File(s) Summary
Mailman domain derivation and local workflow
scripts/dev-mailman-helpers, env.template, docker-compose.yml, docs/mailman/*
The helper creates fixed-prefix lists under the domain derived from MAILMAN_REST_API_URL. Local alias configuration, environment settings, and subscribe/confirm testing documentation are updated.
Mailing-list card wiring and interaction
users/views.py, templates/v3/user_profile_edit.html, templates/v3/includes/_mailing_list_card.html
CurrentUserProfileView inherits MailingListCardMixin. The profile template renders the mailing-list card. The modal supports checkbox counting and select/unselect-all behavior.
Delete-account card placement
templates/v3/user_profile_edit.html
The delete-account card is rendered later. Scheduled-deletion controls are replaced with static warning text and a shared submit button.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • boostorg/website-v2#2439 — Covers mailing-list management on the user profile, matching the profile card and Mailman setup changes.

Possibly related PRs

Suggested reviewers: ycanales, julิโuang, kattyode

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the mailing-list management change in the profile edit UI.
Description check ✅ Passed The description covers the issue, context, changes, risks, screenshots, and testing steps, but the checked Figma and console-error items need clarification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch teo/2439-manage-mailing-list

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.

@herzog0 herzog0 changed the title feat: add mailing list card to edit profile page, move delete account below it Story #2439: Manage Mailing Lists in the Profile Edit UI Jul 21, 2026
@herzog0 herzog0 linked an issue Jul 21, 2026 that may be closed by this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
users/views.py (1)

106-106: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Avoid recomputing mailing-list context on v3 requests.

With MailingListCardMixin before V3Mixin, the v3 context flow re-enters CurrentUserProfileView.get_context_data(), causing the mailing-list state lookup and subscribed-ID query to execute twice per request. Cache the mixin context for the request or adjust the v3 context hook so this work runs once.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@users/views.py` at line 106, Update the context flow involving
MailingListCardMixin, V3Mixin, and CurrentUserProfileView.get_context_data so
mailing-list state and subscribed-ID lookups execute only once for each v3
request. Cache the mixin-generated context per request or adjust the v3 context
hook to reuse the existing result, while preserving the current context values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@users/views.py`:
- Line 106: Update the context flow involving MailingListCardMixin, V3Mixin, and
CurrentUserProfileView.get_context_data so mailing-list state and subscribed-ID
lookups execute only once for each v3 request. Cache the mixin-generated context
per request or adjust the v3 context hook to reuse the existing result, while
preserving the current context values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b3af821e-564f-4b10-b776-ce2c3d10791b

📥 Commits

Reviewing files that changed from the base of the PR and between f5d611f and 5f8f5e4.

📒 Files selected for processing (2)
  • templates/v3/user_profile_edit.html
  • users/views.py

@julhoang julhoang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @herzog0 ! I'm having a bit of trouble testing this. Do you happen to know what's going on here?

The mailman-core and mailman-web containers in docker-compose.yml were disabled a few weeks back – I already uncommented them and run just rebuild and docker compose up but still see some errors:

Image

@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2026
9 tasks
@julhoang

julhoang commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Hi @herzog0 ! I was able to get the testing working, however I had to make a few code changes because I ran into an issue with the mailman host & lists.

Here's the steps that I did:

  1. Uncommented mailman-core and mailman-dev in docker-compose.yml
  2. docker compose build
  3. docker compose up
  4. ./scripts/dev-mailman-helpers – I ran delete lists first to reset everything, then create lists. That created 3 lists: boost-announce.lists.boost.org, boost.lists.boost.org, boost-users.lists.boost.org
  5. I then went to the app to try the subscription flow, and saw the lists coming through with the mailman-core domain instead of lists.boost.org:
Screenshot 2026-07-24 at 11 47 58 AM
  1. To narrow it down, I set MAILMAN_DOMAIN = "lists.boost.org" directly in constants.py instead of using the get_domain_with_subdomains function.
  2. With that change in place, the subscription flow works as expected:
Screenshot 2026-07-24 at 12 04 06 PM

I'm curious if my set up was wrong somehow that leads to me having to hardcode the domain, since I had already went though the original set up steps without having this override back when you implemented the first subscription ticket. 🤔

@herzog0

herzog0 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

Hey @julhoang my apologies, I forgot to add the new test instructions for this here.
The issue with my initial implementation was that the lists domains are different across environments. They can all be derived from the URL though.
Also, there's a constraint with Mailmain's API, where it won't let us create lists with reserved domains, only fully qualified ones, so I had to make this change. Another option would be to explicitly set all lists with their domains, but I chose to build them implicitly with Mailman's REST API domain.
I'm adding testing notes to a doc file in the repo (will be included in this PR) and let you know when it's done. Good thing you were able to finish the tests yourself for now!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/mailman/README.md`:
- Around line 53-59: Update the ngrok discussion in the documentation to explain
that changing its hostname changes the import-time MAILMAN_DOMAIN and managed
list IDs, so existing lists and subscriptions under the previous domain appear
missing; advise using a stable hostname or recreating the lists and restarting
all consumers after changing the URL.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 849db1b7-a15d-4982-b2a9-984f69bbd215

📥 Commits

Reviewing files that changed from the base of the PR and between 5f8f5e4 and d407aa4.

📒 Files selected for processing (3)
  • docs/mailman/README.md
  • env.template
  • scripts/dev-mailman-helpers
💤 Files with no reviewable changes (1)
  • env.template

Comment thread docs/mailman/README.md Outdated
@herzog0
herzog0 force-pushed the teo/2439-manage-mailing-list branch from d407aa4 to eff31fc Compare July 27, 2026 20:34

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hey @julhoang, I made small modifications to the helper script and the docker compose file, now things should be easier to test. I also added this doc file here. Let me know if you have any other questions!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a ton for this!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/mailman/local-testing.md`:
- Line 11: Update the fenced environment-variable example in the `.env`
documentation block to specify a language identifier, preferably dotenv (or
text), immediately after the opening backticks so it satisfies Markdownlint
MD040.
- Around line 60-68: The troubleshooting section should lead with a general
Mailman subscription failure rather than implying the API is unreachable, then
check the existing DNS resolution, configuration restart, and list-creation
steps in order. Add domain-mismatch diagnosis alongside missing lists, directing
readers to verify the requested list domain matches the domain configured in
Mailman.
- Around line 26-28: Update the initial “list lists” step in the local testing
instructions to state that an empty instance is expected to emit “No lists found
at $URL” on stderr and exit non-zero, rather than printing nothing. Keep the
subsequent create-lists and verification steps unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 61e38af8-f596-40bb-ae6c-2e99035e12a7

📥 Commits

Reviewing files that changed from the base of the PR and between d407aa4 and eff31fc.

📒 Files selected for processing (5)
  • docker-compose.yml
  • docs/mailman/README.md
  • docs/mailman/local-testing.md
  • env.template
  • scripts/dev-mailman-helpers
🚧 Files skipped from review as they are similar to previous changes (2)
  • env.template
  • scripts/dev-mailman-helpers

Comment thread docs/mailman/local-testing.md Outdated
Comment thread docs/mailman/local-testing.md Outdated
Comment thread docs/mailman/local-testing.md Outdated
@herzog0
herzog0 requested a review from julhoang July 27, 2026 20:51

@julhoang julhoang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This works great, thanks for adding the testing documentation too @herzog0 ! 🙌

Comment thread templates/v3/includes/_mailing_list_card.html Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a ton for this!

@javiercoronadonarvaez
javiercoronadonarvaez self-requested a review July 30, 2026 13:34

@javiercoronadonarvaez javiercoronadonarvaez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Great work as always Teo.

@herzog0
herzog0 force-pushed the teo/2439-manage-mailing-list branch from 254f470 to 33c8b7b Compare August 12, 2026 17:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@templates/v3/user_profile_edit.html`:
- Around line 291-305: Replace the inert delete-account card in the profile
template with the existing conditional delete flow from the earlier
delete-account section, including its form action, dialog trigger, and
cancellation state when delete_permanently_at is set. Remove the original card
so only one delete-account card renders, and remove the left-column copy while
preserving the existing modal behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 08b18eec-d7d0-4a99-ab80-90b1820d237d

📥 Commits

Reviewing files that changed from the base of the PR and between 254f470 and 33c8b7b.

📒 Files selected for processing (2)
  • templates/v3/user_profile_edit.html
  • users/views.py

Comment thread templates/v3/user_profile_edit.html
@herzog0
herzog0 force-pushed the teo/2439-manage-mailing-list branch from 33c8b7b to 3993a79 Compare August 14, 2026 20:13

@kattyode kattyode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA Approved

@herzog0
herzog0 force-pushed the teo/2439-manage-mailing-list branch from f6ad703 to f868eab Compare August 25, 2026 01:46
@herzog0
herzog0 merged commit 6d9d515 into develop Aug 25, 2026
5 checks passed
@herzog0
herzog0 deleted the teo/2439-manage-mailing-list branch August 25, 2026 02:08
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.

Webpage Integration: Manage Mailing List

4 participants