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

Page footers #291

Merged
merged 7 commits into from
Jan 12, 2021
Merged

Page footers #291

merged 7 commits into from
Jan 12, 2021

Conversation

macfarlandian
Copy link
Collaborator

Description of the change

Adds a standard footer on every page, and an additional footer for narrative pages with links to the other narratives.

Screen Shot 2021-01-11 at 3 50 37 PM

Some side effects to this otherwise straightforward task:

  • this required the section navigation UI to be sticky instead of fixed; to make that work in IE I had to include a polyfill and adapt the markup slightly to accommodate it. (Things had to be nested a little differently to account for some spacing collapsing when the "sticky" element takes on position: fixed in IE.)
  • state management around translating the URL to the corresponding Narrative instance was getting redundant, especially once the the footer starting needing to do it also. Instead I moved this into Mobx: the route parameters become observable, and then the corresponding Tenant and/or Narrative is a computed property based on that. withRouteSync now does this instead of explicitly calling setter methods or creating the Tenant instance directly.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Configuration change (adjusts configuration to achieve some end related to functionality, development, performance, or security)

Related issues

Part of #276

Checklists

Development

These boxes should be checked by the submitter prior to merging:

  • Manual testing against realistic data has been performed locally

Code review

These boxes should be checked by reviewers prior to merging:

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has been moved out of a Draft state, has no "Work In Progress" label, and has assigned reviewers
  • Potential security implications or infrastructural changes have been considered, if relevant

@coveralls
Copy link

coveralls commented Jan 12, 2021

Pull Request Test Coverage Report for Build 481321558

  • 54 of 59 (91.53%) changed or added relevant lines in 14 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 64.653%

Changes Missing Coverage Covered Lines Changed/Added Lines %
spotlight-client/src/index.tsx 0 1 0.0%
spotlight-client/src/NarrativeFooter/NarrativeFooter.tsx 14 18 77.78%
Totals Coverage Status
Change from base Build 478300694: 0.6%
Covered Lines: 1407
Relevant Lines: 2126

💛 - Coveralls

Copy link

@jovergaag jovergaag left a comment

Choose a reason for hiding this comment

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

Cool! It looks really beautiful.

I did find some of the transitions to be a little choppy, is there any way to smooth these out? Also found a small IE11 bug and mobile styling issue.

<SectionTitle>{section.title}</SectionTitle>
<SectionBody>{HTMLReactParser(section.body)}</SectionBody>
</SectionCopy>
<Sticker>

Choose a reason for hiding this comment

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

I'm finding the transition between sections to be pretty choppy as I scroll down the page.

2021-01-12 10 41 18

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hm yeah ... it varies a bit by browser in my experience but it especially does not like it if you try to scroll while the animation is still in progress. It's definitely still kinda buggy! I think though that I want to collect some more feedback and deal with this animation tuning in a separate PR (since I don't think it's directly affected by any of the changes in this one)

})}
onMouseOver={transitionArrow({ index, visible: true })}
onFocus={transitionArrow({ index, visible: true })}
onMouseOut={transitionArrow({ index, visible: false })}

Choose a reason for hiding this comment

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

In IE11 I found that one of the footer link arrows remained visible after clicking through to a different narrative. Was able to reproduce with:

  1. From the Sentencing page, scroll to the bottom of the page to see the Narrative Footer
  2. Click on the Probation footer link
  3. Scroll to the bottom of the page and see that the Prison arrow is still visible, even clicking elsewhere on the page.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh good catch! I think I see the issue

<NavContainer>
<Sticker>
<NavStickyContainer>
<SectionNavigation
Copy link

@jovergaag jovergaag Jan 12, 2021

Choose a reason for hiding this comment

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

I found that in IE11, clicking on the arrows in the SectionNavigation to click through to the next section to be quite slow. Enough to make me wonder the first time I clicked if something was broken. Have you noticed this?

Copy link

@jovergaag jovergaag Jan 12, 2021

Choose a reason for hiding this comment

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

Another question on the section navigation. I was a little frustrated when at the bottom of the page, i couldn't remember which narrative I was on previously so I clicked the 'Back' button, but had to hit back 8 times to actually get back to the previous Narrative. What is the reason to keep the section number in the URL? Are the sections going to be so large that the user will want to navigate between them rather than scrolling between them?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hm. it's definitely less snappy in IE 11 but for me it's not quite that bad. There is a delay of about a second or so though. I am not sure what our IE support level is going to be for this product but at the moment I am just aiming for "not completely broken" and by that standard I think this squeaks by?

Interesting point though about the URLs. I think I tend to agree with you, but this came down as a product requirement, to be able to link directly to a section. We may find that in practice we don't like the way it works. Most of them are not going to be particularly large; I think the majority will fit on a single screen.

I could try replacing the current history item when the section changes, rather than pushing it onto the stack? I don't know if that would just be confusing in a different way, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did give the replacement approach a quick try and I feel like it's .... not obviously better? you wind up on the last section of the previous page if you click on one of those footer links and then hit the back button. It feels ... also weird. Anything more sophisticated than that, or a change in the URL scheme, is a product discussion I think. I will make a note of it for later review though

/>
<NavContainer>
<Sticker>
<NavStickyContainer>

Choose a reason for hiding this comment

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

I'm getting a console warning from the NavStickyContainer

Screen Shot 2021-01-12 at 11 17 36 AM

Choose a reason for hiding this comment

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

I also think that the mobile styling needs to be adjusted now that this NavStickyContainer has been added.

Screen Shot 2021-01-12 at 11 19 24 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh yeah there is no mobile styling yet. designs should be landing sometime this week so I am punting it for now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

also, I saw that warning too. React is starting to complain about some of the dependencies using deprecated APIs. I am not super inclined to care about this at this point? It only gets raised in Strict Mode, which in practice I am finding pretty annoying and have been thinking about disabling. Maybe it's helpful as a debugging tool but as a general development tool I think it's way too noisy about stuff that's not in our direct control. (I have not been able to find a direct replacement for this dependency, one that simply wraps the polyfill in React, and I don't really think it's worth trying to figure out how to reimplement it without findDOMNode. There are various other pure-JS or pure-React libraries, in fact I used one of them in Spotlight v1 but the performance of this is way better in every browser except IE 11 because it uses the native CSS solution instead of janky JavaScript.)

Copy link

@jovergaag jovergaag left a comment

Choose a reason for hiding this comment

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

🌸

(the cherry blossom is the only emoji that autofills for ':spring' - so there you have it)

@macfarlandian macfarlandian merged commit 69d222f into master Jan 12, 2021
@macfarlandian macfarlandian deleted the ian/276-footer branch January 12, 2021 23:06
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.

3 participants