nathancarter/group-explorer

Changing the default representation to a user defined naming scheme breaks the page

Closed this issue · 5 comments

When I add a new naming scheme, make it the default, then refresh the page, nearly everything breaks and I get the following alert:

Chrome:
TypeError: Cannot read property '1' of undefined

Firefox:
TypeError: this.group.representations[this.group.representationIndex] is undefined

To restore functionality, I have to clear the site data.

Steps to reproduce:

  1. Go to the A4 Group Info page
  2. Under "Naming Schemes", click the link to create a new representation for this group
  3. Click "Ok"
  4. Under "Naming Schemes" -> "User-defined naming schemes" -> "1.", click the link to make this the default representation
  5. Refresh the page

System:

  • Browsers (normal and in incognito/private with no extensions):
    • Chrome 80.0.3987.116
    • Firefox 73.0.1
  • OS: Windows 10 64 bit, Version 1809 (OS Build 17763.1039)

Side notes on the "Edit naming scheme" modal dialog box:

  • The "change me" default input text should behave like placeholder text, disappearing on user input. Better yet, the default new names should be the old element names.
  • In Firefox, the table overlaps the "OK" and "Cancel" buttons.

Thank you for the extremely detailed report! I can confirm the behavior on both Chrome and Firefox on my end. One of us will get to this as soon as we can (which may be a little while with volunteers, but as soon as we can).

One question: Could you explain what you mean by the following? Thanks!

To restore functionality, I have to clear the site data.

The easiest way to remove the errant custom representation is to enter into the JavaScript console:

localStorage.clear()

Alternatively, in Chrome, click the lock icon -> "Site settings" -> "Clear data", and in Firefox, click the hamburger -> "Library" -> "History" -> "Show All History" -> right click on a page from Group Explorer -> "Forget About This Site".

Of course, this is a large hammer, but without knowing the specific keys to remove, this is how I got whichever Group Info page working again (A4 was the first I'd tried, but other groups I've tried since are also affected).

Commit b13c994 fixes this, I believe. (I have to apologize:. the commit dates from Jan 5, but I only checked it into a dev branch because I didn't think there was a problem in the public version. My bad.)

I can hardly believe you got as far as you did using Firefox, btw -- my version (73) doesn't scroll the pop-up editor properly, and the 'OK' button is obscured so you can't finish your editing! Gotta fix that. Chrome and Safari (Win10, MacOS, Linux/Ubuntu, IOS) all seem to work ok.

Let me know how this works for you, or if you have any further problems.

Improved the look of the user-defined naming scheme editor across platforms and browsers.

Thanks for bringing this to our attention. Let me know if you have an further problems.

Awesome, looks good! This is indeed working now. Thanks for fixing it. I'll leave it to you to close this issue in case you want to keep it for some reason, but as far as I'm concerned it is resolved.

Thank you for creating this useful tool. It is certainly helping me understand group theory, and I look forward to seeing where it goes from here.