Skip to content

Conversation

@schlawg
Copy link
Contributor

@schlawg schlawg commented Mar 24, 2025

give option to show live board in place of chat for broadcasts. this feature seems awful redundant for people who can see their multi-boards below, so it could be restricted to contributors to make loepare happy. there are no player bars (those would be redundant as well), the orientation is fixed at white.

also let tournament players hide chat, clean up chat state functions

i imagine you will rightly have concerns about multiRedraw, hit me up on zulip or discord.

@ornicar
Copy link
Collaborator

ornicar commented Mar 25, 2025

the orientation is fixed at white

I don't think that's going to fly with the content team

this.vm.chapterId = id;
componentCallbacks(id);
await this.xhrReload();
componentCallbacks();
Copy link
Collaborator

Choose a reason for hiding this comment

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

moving componentCallbacks() before xhrReload() is likely to break something. Is it necessary, why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It allows the redraw of the live board to happen at the same time as the main board. otherwise that redraw lags behind a second for some UI flows as it needs onChapterChange. we could insert extra redraw logic to keep the two in sync for all of the various ways in which a chapter can be selected, but i went with MultiRedraw and onChapterChange to cover all the bases.

What could it break?

Copy link
Collaborator

@ornicar ornicar Mar 26, 2025

Choose a reason for hiding this comment

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

Well, componentCallbacks is supposed to tell components about things having changed. It used to do it after things have changed, and now it does it before, so it seemed like it could break something. If said components were reading the data that has changed.
But if it doesn't 🤷

@ornicar
Copy link
Collaborator

ornicar commented Mar 25, 2025

This is terrifying like adding extra stories to a building with noodle foundations.

I wish there was a simpler way to handle that exotic use case, but can't come up with one.

@schlawg
Copy link
Contributor Author

schlawg commented Mar 25, 2025

the problem is that chat views have their own patch function. if we want chat plugins with non-trivial functions such as externally triggered redraw, we need something like MultiRedraw.

ultimately, i think chat should just expose a VNode constructor in addition to its controller and get rid of the patching. maybe you could do that if you're itching to refactor things. there's really only two places we have chat right? round & analyse (and all their flavors)

@schlawg
Copy link
Contributor Author

schlawg commented Mar 25, 2025

the orientation is fixed at white

I don't think that's going to fly with the content team

Good thing they can look at chat instead.

@schlawg
Copy link
Contributor Author

schlawg commented Mar 25, 2025

I kid though, I just thought of it from the standpoint of what Dominik was asking for (truly independent of analysis). And we don't flip the multiboard when the big board is toggled either.

It's a simple thing to listen for pubsub flip but I'm not at all sure a streamer would want that.

@schlawg
Copy link
Contributor Author

schlawg commented Mar 25, 2025

An alternative to MultiRedraw would be a global site.redraw() function for redraws and a site.addRedraw() function to register patches. seems like we wouldn't need to pass them around from controller to controller. i don't like adding things to site but one could arge if anything deserves to be there, it is redraw.

@ornicar
Copy link
Collaborator

ornicar commented Mar 25, 2025

there's really only two places we have chat right? round & analyse (and all their flavors)

and swiss, arena, simuls and teams

@schlawg
Copy link
Contributor Author

schlawg commented Mar 25, 2025

2 is roughly equal to 6.

export interface ChatPlugin extends Tab {
name: string;
view(): VNode;
kidSafe?: boolean; // default false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

curious about why we don't (seem to) load tournament standing plugin in kid mode.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No reason I can think of. It's probably an unintended effect of disabling the chat for kids.

@ornicar ornicar merged commit 0374298 into lichess-org:master Mar 26, 2025
6 checks passed
@schlawg schlawg deleted the ui-broadcast-chat-liveboard branch April 1, 2025 13:51
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.

2 participants