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

Remove custom apple touch icons and redirects in static #3428

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

MartinJJones
Copy link
Contributor

@MartinJJones MartinJJones commented Sep 9, 2024

What

  • Remove custom apple touch icons included in static
    • apple-touch-icon.png (120x120px)
    • apple-touch-icon-152x152.png
    • apple-touch-icon-167x167.png
    • apple-touch-icon-180x180.png
  • Remove redirects for apple-touch-icons
  • Remove references to apple-touch-icons from publishing_api.rake
  • Update tests for icon redirects
    • Now only references favicon.ico
    • Uncommented test that was previously broken when checking for apple touch icons. It appears that in order for the tests to pass, there needs to be an entry in both routes.rb and publishing_api.rake, for example favicon.ico and apple-touch-icon.png pass (referenced in both files), apple-touch-icon-152x152 does not pass (only referenced in routes.rb)

Trello card

Why

  • This change should help make maintenance of the crown logo easier, no need to create custom icons in different sizes, add more routes or run a rake task to update references to the icons in the content store
  • The current solution to redirecting the icons is a bit complex and not clear how to maintain it, nearly half of the icons referenced in routes.rb and publishing_api.rake resulted in a 404 error when tested
  • The custom apple touch icons are not required in static as we use the apple-touch-icon provided by govuk-frontend (Design System) across GOV.UK via the link tag in layout_for_public.html.erb

Further info

The apple touch icon is primarily used on the iOS/iPadOS home screen.

I tested this change on Staging on older iOS devices to check the apple-touch-icon still works as expected when adding the GOV.UK website to the home screen, screenshots below.

iPhone 7 - iOS 10.3

iOS-10 3

iPhone 8 - iOS 11.4

iOS-11 4

@MartinJJones MartinJJones force-pushed the remove-apple-touch-icon-redirects branch from fdefa7b to f437fe9 Compare September 17, 2024 09:01
@MartinJJones MartinJJones changed the title Remove apple touch icon redirects Remove custom apple touch icons and redirects in static Sep 17, 2024
The custom apple touch icons are not required in static as we use the apple-touch-icon provided by govuk-frontend (Design System) across GOV.UK via the link tag in layout_for_public.html.erb from the govuk_publishing_components gem
The IconRedirectController will now only redirect the favicon.ico file provided by govuk-frontend (Design System)

All references to `apple-touch-icons` have been removed as this approach is not required. The apple-touch-icon is provided by govuk-frontend (Design System) across GOV.UK via the link tag in layout_for_public.html.erb from the govuk_publishing_components gem.
The test will now only check that the favicon.ico file is redirected.

Uncommented a test that was previously broken when checking for apple touch icons. It appears that in order for the tests to pass, there needs to be an entry in both routes.rb and publishing_api.rake, for example favicon.ico and apple-touch-icon.png pass (referenced in both files), but apple-touch-icon-152x152 does not (only referenced in routes.rb)
@MartinJJones MartinJJones force-pushed the remove-apple-touch-icon-redirects branch from f437fe9 to f37d969 Compare September 18, 2024 11:36
@MartinJJones MartinJJones marked this pull request as ready for review September 18, 2024 11:38
Copy link
Contributor

@KludgeKML KludgeKML left a comment

Choose a reason for hiding this comment

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

LVGTM! (Looks Very Good To Me)

Excellent work!

Copy link
Contributor

@hannako hannako left a comment

Choose a reason for hiding this comment

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

Thank you Martin for your deep dive into the archives! 🏅

hannako added a commit that referenced this pull request Sep 19, 2024
@hannako hannako force-pushed the remove-apple-touch-icon-redirects branch from 29ec945 to f37d969 Compare September 19, 2024 13:26
hannako added a commit that referenced this pull request Sep 19, 2024
@MartinJJones MartinJJones merged commit a1daebe into main Sep 19, 2024
20 checks passed
@MartinJJones MartinJJones deleted the remove-apple-touch-icon-redirects branch September 19, 2024 14:11
hannako added a commit that referenced this pull request Sep 19, 2024
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