Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nj 243 - Add headers to review screen #5563

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jachan
Copy link
Contributor

@jachan jachan commented Feb 11, 2025

Link to pivotal/JIRA issue

https://github.com/newjersey/affordability-pm/issues/243

Is PM acceptance required? (delete one)

  • Yes - don't merge until JIRA issue is accepted!

Reminder: merge main into this branch and get green tests before merging to main

What was done?

How to test?

  • Navigate to nj_review, validate that the headings appear correctly in english and spanish

Screenshots (for visual changes)

  • Before
image
  • After
image

Copy link

Heroku app: https://gyr-review-app-5563-299e99447ffd.herokuapp.com/
View logs: heroku logs --app gyr-review-app-5563 (optionally add --tail)

@jachan jachan marked this pull request as ready for review February 11, 2025 21:32
@mmazanec22
Copy link
Contributor

This structure makes more sense overall! One [pebble] I noticed: income forms collected is not an h3, which seems to be inconsistent with how we're structuring other boxes

Screenshot 2025-02-11 at 4 38 48 PM

payments_made_h3s = 1
use_tax_h3s = 1
reveal_h3 = 1
total_expected_h3s = household_details_h3s + income_details_h3s + dependents_attending_college_h3s + where_you_lived_as_of_dec_31_h3s + disability_exemption_h3s + veterans_exemption_h3s + medical_expenses_h3s + property_tax_h3s + payments_made_h3s + use_tax_h3s + reveal_h3
Copy link
Contributor

Choose a reason for hiding this comment

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

[pebble ] The purpose of the test before was to make sure every white-group section box began with an h2, for consistent structure. Hence comparing the number of h2s to the number of white group boxes.

Now that we're beginning boxes with h3s instead, I think it makes sense to check that structure instead of just counting elements. Maybe checking that each white group has at least one h3? And that it comes before any other content?

Copy link
Contributor

Choose a reason for hiding this comment

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

^ agree that just checking the totals (white groups = h3s) makes more sense. this looks like it's checking that each section has an h3 but since it just adds them up in the end it's actually not a very specific test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue with the previous test is that not every white group on the page starts with a single h3 heading. Examples:

The previous test (white-groups=h2s) was not testing what we wanted to test , since abstract_header had been using h3 headings in its white-group sections and we were previously checking against h2 headings.

https://github.com/codeforamerica/vita-min/blob/c75ad162f29742abd773e98eba6e566608530ea3/app/views/state_file/questions/shared/_abstract_review_header.html.erb

I started trying to modify the math to make it work, but with all the cases above, it seemed much more readable to just assert what I expected for each section. Happy to explore other options if folks have suggestions, but just pulling the # of white groups and trying to modify that to match the number of h3s required a lot of arithmetic that seemed really opaque.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just read Melanie's comment more closely and found the suggestion to check for the presence of a header before any other content in the white-group, which would make a lot more sense here rather than just asserting that every white-group has an h3. Exploring that solution now!

Copy link
Contributor

Choose a reason for hiding this comment

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

We should use consistent heading structure, and the visual appearance should reflect the markup. It doesn't make sense to start some white groups with h2s and others with h3s-- all of the content should be broken into sections if any of it is. The design might need to be tweaked if this isn't currently possible

@@ -6,7 +6,7 @@
<% if current_intake.dependents.count(&:under_22?).positive? %>
<section id="college-dependents" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-5"><%=t(".college_dependents") %></h2>
<h3 class="text--body text--bold spacing-below-5"><%=t(".college_dependents") %></h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

typo?

Suggested change
<h3 class="text--body text--bold spacing-below-5"><%=t(".college_dependents") %></h2>
<h3 class="text--body text--bold spacing-below-5"><%=t(".college_dependents") %></h3>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh my gosh! Thanks for catching, I'm so sorry - I forgot to change all these closing tags. Will put out a revision.

@@ -26,7 +26,7 @@
<% if current_intake.dependents.any? && current_intake.has_health_insurance_requirement_exception? %>
<section id="missing-health-insurance" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-5"><%=t(".missing_health_insurance") %></h2>
<h3 class="text--body text--bold spacing-below-5"><%=t(".missing_health_insurance") %></h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<h3 class="text--body text--bold spacing-below-5"><%=t(".missing_health_insurance") %></h2>
<h3 class="text--body text--bold spacing-below-5"><%=t(".missing_health_insurance") %></h3>

@@ -46,7 +46,7 @@
<% if current_intake.filing_status_qw? %>
<section id="year-of-death" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-5"><%=t(".year_of_death") %></h2>
<h3 class="text--body text--bold spacing-below-5"><%=t(".year_of_death") %></h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<h3 class="text--body text--bold spacing-below-5"><%=t(".year_of_death") %></h2>
<h3 class="text--body text--bold spacing-below-5"><%=t(".year_of_death") %></h3>

@@ -59,7 +59,7 @@

<section id="county-municipality" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-5"><%=t(".county_municipality", filing_year: current_tax_year) %></h2>
<h3 class="text--body text--bold spacing-below-5"><%=t(".county_municipality", filing_year: current_tax_year) %></h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<h3 class="text--body text--bold spacing-below-5"><%=t(".county_municipality", filing_year: current_tax_year) %></h2>
<h3 class="text--body text--bold spacing-below-5"><%=t(".county_municipality", filing_year: current_tax_year) %></h3>

@@ -74,11 +74,11 @@
<section id="disabled_exemption" class="white-group">
<div class="spacing-below-5">
<% unless current_intake.primary_disabled_unfilled? %>
<h2 class="text--body text--bold spacing-below-5"><%= t(".primary_disabled") %></h2>
<h3 class="text--body text--bold spacing-below-5"><%= t(".primary_disabled") %></h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

i.....didn't realize how many of these there are. you get the point 🙈

@@ -6,7 +6,7 @@
<% if current_intake.dependents.count(&:under_22?).positive? %>
<section id="college-dependents" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-5"><%=t(".college_dependents") %></h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

[a mound of pebbles] - looks like the h2 -> h3 change was only on the opening tag and not on the closing one. And that seems to apply to all the changes in this PR. it might still render correctly in browsers and test drivers which would hide the issue, but we should fix it

Copy link
Contributor

@jenny-heath jenny-heath left a comment

Choose a reason for hiding this comment

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

gotta fix the closing tags! (also would love to see melanie's testing suggestion implemented but that's not blocking)

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