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

Update PWA config with 2023 icon requirements and caching #1474

Merged
merged 7 commits into from
May 20, 2024

Conversation

spwoodcock
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Should address #1313 and also #611

Describe this PR

Code:

  • Kept vite-plugin-pwa as it's pretty good.
  • Updated the config so it works in production and development.
  • Added minimal icon requirements for PWA 2023.
  • Did a bit of refactoring on the frontend, adding a main.tsx file for code ran at first load.

User experience:

  • This should hopefully stop the issue where the PWA required two reloads after being updated.
  • The PWA should seamless update in the background when a new version is available.
  • Caching should also be enabled by default, allowing for usage in offline environments.
  • There is a popup to inform the user when all content is cached and available offline.

Alternative Approaches Considered

  • Writing the manifest and service workers manually, but I couldn't really see any advantage.
  • If the white screen / reload issue isn't solved, then we can go this route.

Review Guide

  • Test reloading the PWA on dev. There should be no white screen.
  • Test loading FMTM, then disabling internet. Some functionality should hopefully remain available.

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@spwoodcock spwoodcock self-assigned this Apr 24, 2024
@github-actions github-actions bot added docs Improvements or additions to documentation frontend Related to frontend code labels Apr 24, 2024
@spwoodcock spwoodcock assigned varun2948 and NSUWAL123 and unassigned spwoodcock Apr 24, 2024
@spwoodcock
Copy link
Member Author

spwoodcock commented Apr 24, 2024

@NSUWAL123 @varun2948 I have updated the PWA, but for some reason the map container CSS is not longer expanding the map to the full available vertical height.

I added to the index.html:

    <meta
      name="viewport"
      content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"
    />

Not sure if it's related.

I can't work out where the tailwind classes are defined on a brief inspection - could you take take a look please?
It seems to be on the id="ol-map" component where the CSS is no longer working.

@varun2948
Copy link
Contributor

will have a look into this tomorrow morning let's see where it goes

@spwoodcock spwoodcock assigned NSUWAL123 and unassigned varun2948 and NSUWAL123 May 13, 2024
@spwoodcock
Copy link
Member Author

@NSUWAL123 @varun2948 could this be prioritised for Monday so we can include in the next release? πŸ™

@NSUWAL123
Copy link
Contributor

@spwoodcock, I will have a look at this issue today

@NSUWAL123
Copy link
Contributor

NSUWAL123 commented May 20, 2024

@spwoodcock, I have fixed the map height problem in #1528. Is the issue only with the map?

@spwoodcock spwoodcock merged commit cbf008a into development May 20, 2024
7 checks passed
@spwoodcock spwoodcock deleted the fix/pwa-loading branch May 20, 2024 07:36
@spwoodcock spwoodcock restored the fix/pwa-loading branch May 20, 2024 07:40
@spwoodcock spwoodcock deleted the fix/pwa-loading branch May 20, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code docs Improvements or additions to documentation frontend Related to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants