Skip to content

PPHA-593: separate quit smoking page from periods you stopped smoking#427

Merged
jamiefalcus merged 16 commits intomainfrom
PPHA-593-separate-quit-smoking-page
Apr 10, 2026
Merged

PPHA-593: separate quit smoking page from periods you stopped smoking#427
jamiefalcus merged 16 commits intomainfrom
PPHA-593-separate-quit-smoking-page

Conversation

@Themitchell
Copy link
Copy Markdown
Contributor

@Themitchell Themitchell commented Apr 2, 2026

What is the change?

Create a separate page in the former smoker journey so users can enter when they quit

Why are we making this change?

So that users can differentiate between when they quite and periods they stopped smoking. This allows clarity and stops the user having to calculate the total years stopped themselves

@Themitchell Themitchell changed the title Ppha 593 separate quit smoking page PPHA-593: separate quit smoking page from periods you stopped smoking Apr 2, 2026
Comment thread lung_cancer_screening/questions/forms/when_you_quit_smoking_form.py
Comment thread features/smoking_history.feature
@jamiefalcus jamiefalcus force-pushed the PPHA-593-separate-quit-smoking-page branch from 962cc57 to 73bdfab Compare April 10, 2026 12:48
@jamiefalcus jamiefalcus marked this pull request as ready for review April 10, 2026 12:48
Copilot AI review requested due to automatic review settings April 10, 2026 12:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated “when you quit smoking” step to the former-smoker journey so users can record quit age separately from long stop-periods, and updates navigation/presentation to reflect the split.

Changes:

  • Introduces WhenYouQuitSmokingResponse, form, view, template, URL, and acceptance/unit tests for the new page.
  • Updates smoking-history navigation/back links and “check your answers” presenter to conditionally include “Age you quit smoking” for former smokers.
  • Refactors prerequisite-response enforcement for tobacco history views into a dedicated mixin.

Reviewed changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
lung_cancer_screening/questions/views/when_you_quit_smoking.py New question view for former smokers to enter quit age.
lung_cancer_screening/questions/views/smoking_frequency.py Switches to new smoking-history prerequisite mixin.
lung_cancer_screening/questions/views/smoked_total_years.py Switches to new smoking-history prerequisite mixin.
lung_cancer_screening/questions/views/smoked_amount.py Switches to new smoking-history prerequisite mixin.
lung_cancer_screening/questions/views/question_base_view.py Minor formatting change (blank line).
lung_cancer_screening/questions/views/periods_when_you_stopped_smoking.py Adjusts back-link behavior based on smoker type and change-flow referer.
lung_cancer_screening/questions/views/mixins/ensure_smoking_history_prerequisite_responses.py New mixin to enforce tobacco-history prerequisites per tobacco_type.
lung_cancer_screening/questions/views/mixins/ensure_prerequisite_responses.py Narrows prerequisite handling to ResponseSet-level prerequisites (age started smoking).
lung_cancer_screening/questions/views/age_when_started_smoking.py Routes former smokers to the new “when you quit” page after answering age started.
lung_cancer_screening/questions/urls.py Adds route for /when-you-quit-smoking.
lung_cancer_screening/questions/tests/unit/views/test_when_you_quit_smoking.py Adds view tests for GET/POST behavior and navigation.
lung_cancer_screening/questions/tests/unit/views/test_relatives_age_when_diagnosed.py Removes WIP tag line.
lung_cancer_screening/questions/tests/unit/views/test_periods_when_you_stopped_smoking.py Updates back-link tests for current vs former smoker flows.
lung_cancer_screening/questions/tests/unit/views/test_have_you_ever_smoked.py Adds test ensuring quit-age response is reset when changing to non-smoker.
lung_cancer_screening/questions/tests/unit/views/test_age_when_started_smoking.py Updates tests for current vs former smoker routing and change-flow behavior.
lung_cancer_screening/questions/tests/unit/views/mixins/test_ensure_smoking_history_prerequsite_response_mixin.py Adds unit tests for new smoking-history prerequisite mixin.
lung_cancer_screening/questions/tests/unit/views/mixins/test_ensure_prerequsite_response_mixin.py Updates unit tests for revised prerequisite mixin semantics.
lung_cancer_screening/questions/tests/unit/presenters/test_tobacco_smoking_history_presenter.py Adjusts presenter tests setup for new smoker-state assumptions.
lung_cancer_screening/questions/tests/unit/presenters/test_response_set_presenter.py Adds presenter tests for smoking-history section items (current vs former).
lung_cancer_screening/questions/tests/unit/models/test_when_you_quit_smoking_response.py Adds model validation tests for quit-age response.
lung_cancer_screening/questions/tests/unit/models/test_tobacco_smoking_history.py Updates setup with smoker-state response.
lung_cancer_screening/questions/tests/unit/models/test_smoked_total_years_response.py Updates setup with smoker-state response.
lung_cancer_screening/questions/tests/unit/models/test_response_set.py Updates completeness logic tests for former smokers and quit-age requirement.
lung_cancer_screening/questions/tests/unit/models/test_periods_when_you_stopped_smoking_response.py Extends validation tests to incorporate former-smoker quit-age dependency.
lung_cancer_screening/questions/tests/unit/models/test_have_you_ever_smoked_response.py Adds tests for new is_former_smoker() helper.
lung_cancer_screening/questions/tests/unit/models/test_age_when_started_smoking_response.py Updates setup with smoker-state response.
lung_cancer_screening/questions/tests/unit/forms/test_when_you_quit_smoking_form.py Adds form tests for quit-age input and related behaviors.
lung_cancer_screening/questions/tests/unit/forms/test_periods_when_you_stopped_smoking_form.py Updates labels/hints for former smokers and adjusts setup.
lung_cancer_screening/questions/tests/unit/forms/test_age_when_started_smoking_form.py Updates date-of-birth prerequisite error message text.
lung_cancer_screening/questions/tests/factories/when_you_quit_smoking_response_factory.py Adds factory for quit-age response.
lung_cancer_screening/questions/tests/factories/have_you_ever_smoked_response_factory.py Adjusts “eligible” trait value.
lung_cancer_screening/questions/presenters/response_set_presenter.py Adds “Age you quit smoking” item for former smokers on check-your-answers.
lung_cancer_screening/questions/models/when_you_quit_smoking_response.py Adds new model with validations for quit-age constraints.
lung_cancer_screening/questions/models/response_set.py Requires quit-age response for former smokers; adds former_smoker() helper.
lung_cancer_screening/questions/models/have_you_ever_smoked_response.py Adds is_former_smoker() and a post-save cleanup signal.
lung_cancer_screening/questions/models/age_when_started_smoking_response.py Computes years smoked differently for former smokers (uses quit-age).
lung_cancer_screening/questions/migrations/0010_whenyouquitsmokingresponse.py Creates WhenYouQuitSmokingResponse table.
lung_cancer_screening/questions/migrations/0011_alter_whenyouquitsmokingresponse_response_set.py Changes response_set relationship to OneToOne.
lung_cancer_screening/questions/jinja2/when_you_quit_smoking.jinja Adds new template content for quit-age page.
lung_cancer_screening/questions/forms/when_you_quit_smoking_form.py Adds new form for quit-age entry and error messages.
lung_cancer_screening/questions/forms/periods_when_you_stopped_smoking_form.py Updates labels/hints and adds quit-age prerequisite error messaging.
lung_cancer_screening/questions/forms/age_when_started_smoking_form.py Updates prerequisite error message wording.
features/when_you_quit_smoking.feature Adds end-to-end feature scenarios for new quit-age page and change-flow.
features/steps/preflight_steps.py Extends step to support “current” vs “former” smoker setup.
features/steps/accessibility_steps.py Uses generate_report() for accessibility assertion output.
features/smoking_history.feature Trims/adjusts a change-journey scenario.
features/age_when_started_smoking.feature Splits scenarios for former vs current smoker navigation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lung_cancer_screening/questions/views/when_you_quit_smoking.py
Comment thread lung_cancer_screening/questions/jinja2/when_you_quit_smoking.jinja
Comment thread lung_cancer_screening/questions/tests/unit/views/test_have_you_ever_smoked.py Outdated
@sonarqubecloud
Copy link
Copy Markdown

@jamiefalcus jamiefalcus merged commit 2d03d98 into main Apr 10, 2026
25 checks passed
@jamiefalcus jamiefalcus deleted the PPHA-593-separate-quit-smoking-page branch April 10, 2026 14:11
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.

4 participants