Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor pop-out chat #1551

Open
ctm opened this issue Feb 1, 2025 · 1 comment
Open

Refactor pop-out chat #1551

ctm opened this issue Feb 1, 2025 · 1 comment
Assignees
Labels
bug Something isn't working chore Maintenance or other non-bug, non-feature high priority Should be done fairly soon

Comments

@ctm
Copy link
Owner

ctm commented Feb 1, 2025

Use a data representation that makes it impossible to have log be None and still think that we have docked chat.

IOW, fix the pop-up chat bug (#1550) right, rather than a quick fix. At first glance, this looks trivial to solve correctly in that we have two different fields in Table that are intrinsically tied together: log: Option<ScrollableLog> and undocked_chat: Option<chat::Parent>. AFAICT, there should always either be a log or an undocked_chat, so just slapping them into an Either fixes it for good.

My guess is that if I use an Either and then fix the compilation errors that as I'm doing so I'll have an aha moment and understand just how they could have gotten out of sync. OTOH, there's also a chance that I'll run into some spaghetti code that will take a while to navigate.

So, for now I'm labeling this high priority and easy, but I'm not going to take a look at it until I'm caught up on email.

@ctm ctm added bug Something isn't working chore Maintenance or other non-bug, non-feature easy Trivial to do (even when tired!) and semi-worthwhile high priority Should be done fairly soon labels Feb 1, 2025
@ctm ctm self-assigned this Feb 1, 2025
@ctm ctm removed the easy Trivial to do (even when tired!) and semi-worthwhile label Feb 1, 2025
@ctm
Copy link
Owner Author

ctm commented Feb 1, 2025

FWIW, I do believe that Either (or an enum of our own) is the way to go, however, it's not trivial, because currently there is a time after we undock where we send the current chat to the child window and during that time both log and undocked_chat are Some. I doubt that it will be particularly hard to fix this, but now is not the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Maintenance or other non-bug, non-feature high priority Should be done fairly soon
Projects
None yet
Development

No branches or pull requests

1 participant