gb-opcodes icon indicating copy to clipboard operation
gb-opcodes copied to clipboard

Solve a general issue of configurability of the display

Open SonoSooS opened this issue 1 year ago • 1 comments

There is a problem with being able to add new ways to display the opcode table differently.

It's actually quite easy to add code to change how things display via some config.

The problem is that since all variants have to be pre-rendered to be served from a static webpage, and no query parameters can be used to specify the config, currently the config of the layout is simply just encoded into the URL itself (like dark, classicoctal, etc.). The problem with this approach is that it can't be scaled: eventually we'd have ridiculous URLs like ClassicOctalHexShortaluMcycle (first letters capitalized for readability, all URLs are lowercase currently otherwise).

There have been some other suggestions, but they also have their own downsides:

  • Javascript would be the "obvious" solution, but it has its own problems:
    • compatibility issues between browsers
    • script blockers and browsers without a Javascript engine
    • it has to be maintained alongside with the static page script, which is just disasters to happen
    • additional bloat
    • you must wait for the page to fully load before the feature even starts to function
  • CSS
    • no matter how clever we can make it, pretty sure it would break Internet Explorer compatibility somehow, which could only be fixed (if even) with even more CSS, adding more to the size of the page
    • can't be made persistent in any way without requiring user interaction on each page reload

While I sadly don't have any better clue on how to deal with this issue, I have thought of something: It might be possible to keep the static URLs for "mainline" combinations (like dark or classicoctal), but more situation-specific configs (like the beforementioned ClassicCotalHexShortaluMcycle) could just have an optional prefix with a completely meaningless (sequential?) number attached to it (so something like /optables/layout-203, or simly just /optables/203). If we end up considering this URL layout, then I also suggest branching off the colorscheme/theme as an URL part if possible (so /optables/classic/203 for example), so we have less pain which would be caused by this numbering scheme. Although an alternative could also be to always include the theme as a prefix, and the rest of the configs would be just an arbitary number (so /optables/classic-203 for example). I think this would be the best option, especially if the /optables/<theme>/<config> format is not possible.

Whatever the case, I don't think it's possible to flag this in any way on Github, but this issue blocks basically all other issues which are requesting an alternative way to display some information.

SonoSooS avatar Oct 19 '22 20:10 SonoSooS