AlignmentResearch / KataGoVisualizer

MIT License
3 stars 1 forks source link

sgf-viewer: Asymmetric Go board on resize #105

Closed tomtseng closed 1 month ago

tomtseng commented 1 month ago

The Go player isn't resizing properly when resizing the window width, sometimes it takes up ~70% of the window width instead of the expected window width. Adam has a screenshot at https://github.com/AlignmentResearch/KataGoVisualizer/pull/103#pullrequestreview-2051058230 but it's not new to that PR.

I spent a little time debugging this but deprioritized it since it wasn't a new bug and it's still usable, just unsightly. The CSS class of the Go player is supposed to change at various breakpoints, but it looks like old CSS classes aren't getting removed, e.g., wgo-twocols is remaining on the Go board div unexpectedly. The CSS class is adjusted at https://github.com/waltheri/wgo.js/blob/34773562647e4e8c9c33f1a29cc3183fd1de90d8/wgo/basicplayer.js#L197

We're currently importing the minified version of wgo.js, but it's easier to debug if you import all the unminified files and add console.log statements there.

  <!-- add to index.html after downloading https://github.com/waltheri/wgo.js/tree/master/wgo files into public/wgo: -->
  <script type="text/javascript" src="/wgo/wgo.js"></script>
  <script type="text/javascript" src="/wgo/kifu.js"></script>
  <script type="text/javascript" src="/wgo/sgfparser.js"></script>
  <script type="text/javascript" src="/wgo/player.js"></script>
  <script type="text/javascript" src="/wgo/basicplayer.js"></script>
  <script type="text/javascript" src="/wgo/basicplayer.component.js"></script>
  <script type="text/javascript" src="/wgo/basicplayer.infobox.js"></script>
  <script type="text/javascript" src="/wgo/basicplayer.commentbox.js"></script>
  <script type="text/javascript" src="/wgo/basicplayer.control.js"></script>
  <script type="text/javascript" src="/wgo/player.editable.js"></script>
  <script type="text/javascript" src="/wgo/scoremode.js"></script>
  <script type="text/javascript" src="/wgo/player.permalink.js"></script>