PPHA-593: separate quit smoking page from periods you stopped smoking#427
Merged
jamiefalcus merged 16 commits intomainfrom Apr 10, 2026
Merged
PPHA-593: separate quit smoking page from periods you stopped smoking#427jamiefalcus merged 16 commits intomainfrom
jamiefalcus merged 16 commits intomainfrom
Conversation
stephhou
reviewed
Apr 9, 2026
…rerequisiteResponses
962cc57 to
73bdfab
Compare
Contributor
There was a problem hiding this comment.
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.
stephhou
reviewed
Apr 10, 2026
|
stephhou
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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