Skip to content

Ppha 765 former smoker navigation#444

Merged
jamiefalcus merged 10 commits intomainfrom
PPHA-765-former-smoker-navigation
Apr 23, 2026
Merged

Ppha 765 former smoker navigation#444
jamiefalcus merged 10 commits intomainfrom
PPHA-765-former-smoker-navigation

Conversation

@jamiefalcus
Copy link
Copy Markdown
Contributor

What is the change?

Adding the skipping of current and total years smoked for current and former smokers when only selecting one type of tobacco smoked.

Why are we making this change?

Prevents the repetition of questions when only one type of tobacco is being smoked by the user.

@jamiefalcus jamiefalcus force-pushed the PPHA-765-former-smoker-navigation branch from df50344 to eabfb06 Compare April 14, 2026 15:43
@jamiefalcus jamiefalcus marked this pull request as ready for review April 16, 2026 11:07
Copilot AI review requested due to automatic review settings April 16, 2026 11:07
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

Updates the smoking-history questionnaire navigation so that when a user selects only one tobacco type, the flow skips the “currently smoke” and “total years smoked” questions to avoid repetition.

Changes:

  • Route single-tobacco selections from “types” directly to “smoking frequency”, and adjust back-link behavior accordingly.
  • Auto-create default SmokingCurrentResponse and SmokedTotalYearsResponse when only one tobacco type is selected.
  • Update unit tests and cucumber features to reflect the new navigation and derived answers.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lung_cancer_screening/questions/views/types_tobacco_smoking.py Adds single-selection redirect to smoking frequency.
lung_cancer_screening/questions/views/smoking_frequency.py Adjusts back-link target based on single vs multiple selections.
lung_cancer_screening/questions/forms/types_tobacco_smoking_form.py Creates default smoking-current and smoked-total-years responses for single selection.
lung_cancer_screening/questions/tests/unit/views/test_types_tobacco_smoking.py Adds/updates redirect and derived-duration assertions for single vs multiple types (incl. former smoker).
lung_cancer_screening/questions/tests/unit/views/test_smoking_frequency.py Updates back-link tests for single vs multiple types.
lung_cancer_screening/questions/tests/unit/forms/test_types_tobacco_smoking_form.py Ensures required prerequisite responses exist for new default-response behavior.
features/types_tobacco_smoking.feature Updates journey expectations when toggling between single/multiple types.
features/smoking_history.feature Updates expected answers to reflect derived “total years” behavior.
features/smoking_frequency.feature Updates expected back link destination.
features/smoking_current.feature Adjusts setup to include multiple types where smoking-current remains relevant.
features/smoked_total_years.feature Adjusts setup to include multiple types where smoked-total-years remains relevant.
features/questionnaire.feature Updates expected answers to reflect derived “total years” behavior and removed steps.

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

Comment thread lung_cancer_screening/questions/views/types_tobacco_smoking.py
Comment thread lung_cancer_screening/questions/views/smoking_frequency.py
Comment thread lung_cancer_screening/questions/forms/types_tobacco_smoking_form.py Outdated
Comment thread lung_cancer_screening/questions/forms/types_tobacco_smoking_form.py
Comment thread lung_cancer_screening/questions/tests/unit/views/test_types_tobacco_smoking.py Outdated
Comment thread lung_cancer_screening/questions/views/types_tobacco_smoking.py Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

The review app at this URL has been deleted:
https://pr-444.non-live.digital-lung-cancer-screening.nhs.uk

Comment thread features/age_when_started_smoking.feature Outdated
Comment thread lung_cancer_screening/questions/tests/unit/views/test_types_tobacco_smoking.py Outdated
@jamiefalcus jamiefalcus force-pushed the PPHA-765-former-smoker-navigation branch from e5f3898 to 202679a Compare April 23, 2026 09:04
@sonarqubecloud
Copy link
Copy Markdown

@jamiefalcus jamiefalcus merged commit ccc49d8 into main Apr 23, 2026
26 checks passed
@jamiefalcus jamiefalcus deleted the PPHA-765-former-smoker-navigation branch April 23, 2026 10:20
mrlockstar pushed a commit that referenced this pull request Apr 29, 2026
# What is the change?

Adding the skipping of current and total years smoked for current and
former smokers when only selecting one type of tobacco smoked.

# Why are we making this change?

Prevents the repetition of questions when only one type of tobacco is
being smoked by the user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants