ctm / mb2-doc

Mb2, poker software
https://devctm.com
7 stars 2 forks source link

Pop-out chat input not adjusting after resize #1350

Closed ctm closed 4 months ago

ctm commented 4 months ago

Fix so the chat input is in the right place after resizing the the pop-up chat window.

This used to work, although I think the code has always had some hinky race-condition. I'll have to review the existing code, but I think we track resize events, but have to play some games because UIKit is also tracking resize events and we need to do something after they do something and there's no hook to allow us to be sure when to do it.

ctm commented 4 months ago

This is sufficiently trivial to reproduce (just pop out chat and enlarge the pop-out chat window by dragging the bottom of the window down) that it's presumably trivial to fix. I'll take a look "now".

ctm commented 4 months ago

This does not appear to be a recent regression. Commit 7c00cc32 seems to work. Unfortunately, git bisect can be a bit of a PITA due to the need to revert db migrations. Still, enough of our migrations are reversible that I should be able to go back several months, if not a year, and see if the bug is still there. If it is still there in code from a year ago, then there may be something else that has changed. Unfortunately, I've never kept all the docker images we build, since that would be the easiest way to look for regressions.

ctm commented 4 months ago

I rolled back to 7a3328d5, which is a year old and the problem was still there. However, the lobby doesn't exhibit this problem, so I'm going to take a look at the UIKit instrumentation of the lobby and compare it to the pop-out chat window. It may take some fiddling, but my guess is that will be sufficient to track this down.

ctm commented 4 months ago

Turns out the lobby code jumps through a lot more hoops to deal with resizes than the chat window does. I started the introduction of pop-out chat in December of 2021, and I'm not sure when they diverged. Seeing how lobby window resizing works and chat window resizing doesn't, I'll try to use the same technique the lobby uses in the chat window and see if that works. I now know Rust well enough that I should be able to DRY up the code once I see it working.

ctm commented 4 months ago

Copy and paste hack and slash did indeed fix the problem. I need to make a trait that both Lobby and Chat can implement that contains the code common to both.

ctm commented 4 months ago

DRYed. Deploying now.