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

Fix differ issues from json->edn conversion #7565

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

NoahTheDuke
Copy link
Collaborator

@NoahTheDuke NoahTheDuke commented Jul 17, 2024

Closes #7424.

Would be handled by #7564 but that's a mess and would break all game histories, so that's on pause.

Differ handles sequential types in a special way, with :+ meaning "insert at the end". Our reliance on json means that it was always being treated as "+" and thus differ would ignore it. I believe this has infected every portion of the entire frontend as long as we've used differ, but it's only surfaced here cuz we tend to ignore nils everywhere lol.

The result of this bug would be that the diff from the waiting prompt to the choices prompt would have :choices ["+" {:value {:title "Overseer Matrix" ...} ...} "+" {:value {:title "Overseer Matrix" ...} ...} "+" {:value {:title "Overseer Matrix" ...} ...} "+" {:value {:title "Yakov Erikovich Avdakov" ...} ...}], and thus be rendered incorrectly because you can't destructure a string. With this fix, it'll now just be the correct values merged in to their right place.

Having written all of this out, I have also updated the prompt-state differ stuff to be smarter, borrowing code from #7564.

#(card-highlight-mouse-out % value button-channel)}
(render-message (or (not-empty (get-title value)) value))]))))]))
(doall (for [{:keys [idx uuid value]} choices
:when (not= value "Hide")]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but we shouldn't return nil anyway.

@NoahTheDuke NoahTheDuke merged commit 2d7ea55 into mtgred:master Jul 17, 2024
3 checks passed
@NoahTheDuke NoahTheDuke deleted the nb/fix-7424-empty-buttons branch July 17, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overseer Matrix' UI shows additionalt blank options
1 participant