Neriderc/GVExport

Change how settings are saved and loaded for logged out users

Closed this issue · 0 comments

As per notes in #460, logged out users have settings stored in cookies which are sent to the server to load the page with settings already set. Browsers limit cookie size because they are sent on every page load, which has a performance impact. Because of the large number of settings available in GVExport, we are starting to hit this limit.

To get around this, we should adjust what is saved in cookies. Rather than sending all settings, we should only send settings that are (or might be) visible on page load. Many settings are hidden behind toggles and will never be seen until the user interacts with the toggle. Rather than sending these in cookies, they could be loaded via javascript when the page first loads. Limiting it to these settings prevents the visual jumble that happens if all settings are loaded via javascript.

To complete this work, we should:

  • Reduce number of settings saved in cookie to only those that may be visible when loading the page. This will not include most settings in the advanced Appearance section, as they are hidden behind toggles.
  • Store full settings in browser storage
  • Use javascript to load settings on page load, to finish loading saved settings. Existing functionality could be reused here.
  • Wait for settings to be loaded by javascript before updating the diagram
  • Allow logged out users to use option to style based on shared note links