Skip to content

Conversation

@schlawg
Copy link
Contributor

@schlawg schlawg commented Mar 31, 2025

Screencast_20250331_163344.webm

@kraktus
Copy link
Member

kraktus commented Apr 2, 2025

could also be a solution for tournaments #12995 (or could make the description/chat togglable)

@schlawg schlawg marked this pull request as draft April 3, 2025 04:55
@schlawg schlawg marked this pull request as ready for review April 3, 2025 06:34
@ornicar
Copy link
Collaborator

ornicar commented Apr 5, 2025

when I first tried it, the default configuration had the game list higher than the page, with the chat fully invisible:

image

@schlawg
Copy link
Contributor Author

schlawg commented Apr 5, 2025

the behavior:

  • first time ever (nothing in local storage) - initial games list height is the smaller of fit-content and window.innerHeight / 2
  • on resize, pane settings are written for generic broadcasts in addition to the specific one
  • for a new broadcast not found in local storage - same size as the generic setting. if resized it is tracked independently.

it's a combo of initial reuse of the previous size while still allowing specific broadcasts to differ. this strategy will not always get it right, but is arguably an improvement over global flex & grid constraints

key: 'relay-games',
id: resizeId,
min: () => 48,
max: () => 48 * study.chapters.list.size(),
Copy link
Collaborator

@ornicar ornicar Apr 8, 2025

Choose a reason for hiding this comment

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

silently hardcoding the expected rendered height of a chapter in the list. Just mentioning it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

every time i look at it, i feel liberated.

@ornicar
Copy link
Collaborator

ornicar commented Apr 8, 2025

The chat viewers have migrated below .relay-admin__container

image

It's not a big deal and only worth fixing if it can be done easily.

@ornicar
Copy link
Collaborator

ornicar commented Apr 8, 2025

after resizing the page from col2 to col1, the chat viewers element is duplicated

image

@ornicar
Copy link
Collaborator

ornicar commented Apr 8, 2025

after resizing the page from col2 to col1 (which can happen if you rotate your tablet from horizontal to vertical), the slider elements are removed, but the mutation observers remain, and an exception is thrown due to el being null:

        const onDomChange = () => {
          const el = divider.previousElementSibling as HTMLElement;
          if (el.style.height) return;

@schlawg
Copy link
Contributor Author

schlawg commented Apr 8, 2025

good catches.

@schlawg schlawg marked this pull request as draft April 8, 2025 21:04
@schlawg schlawg marked this pull request as ready for review April 9, 2025 01:02
@schlawg
Copy link
Contributor Author

schlawg commented Apr 9, 2025

some of the hooks and indirections in analysis chat are gone. there is one ChatCtrl instance per page boot and chat views are constructed inline with VNodes.

round and tournament chat still use the external snabbdom patch, mostly because i don't want to pull on these noodles at the moment. teams patches as well because that javascript has no controller.

but i think chat/patch.ts goes away eventually.

window.removeEventListener('pointercancel', up);
const height = parseInt(el.style.height);
heightStore(o.key, height);
if (o.id) heightStore(`${o.key}.${o.id}`, height);
Copy link
Collaborator

@ornicar ornicar Apr 9, 2025

Choose a reason for hiding this comment

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

this is a default/global stored height mechanism. Setting a height somewhere also sets the (default) height of similar elements (for o.key) on other pages (o.id).

I just ran into a user issue due to it:

Copy link
Collaborator

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

@schlawg schlawg Apr 9, 2025

Choose a reason for hiding this comment

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

maybe only chat size needs a generic category fallback store. good catch and you're right, we should track game picker size individually with no generic fallback, instead always default to min(fit-content, initialHeight / 2).

@ornicar
Copy link
Collaborator

ornicar commented Apr 9, 2025

I see liveboard code, but I don't see any liveboard on a broadcast page.

@ornicar
Copy link
Collaborator

ornicar commented Apr 9, 2025

image

the viewers are now inside a %box-neat, they were meant to be outside

window.removeEventListener('pointercancel', up);
const height = parseInt(el.style.height);
heightStore(o.key, height);
if (o.id) heightStore(`${o.key}.${o.id}`, height);
Copy link
Collaborator

Choose a reason for hiding this comment

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

image

const { study, gamebookPlayView, gaugeOn } = ctx;

return renderMain(ctx, [
console.log(ctrl.opts.chat);
Copy link
Collaborator

Choose a reason for hiding this comment

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

debug

@schlawg
Copy link
Contributor Author

schlawg commented Apr 9, 2025

the viewers are now inside a %box-neat, they were meant to be outside

yeah but it's tough to keep it close to chat because it competes with the resize bar. at least inside the box neat it's clearly part of the element to be resized rather than dangling underneath.

could it be integrated with the "Please be nice in the chat" placeholder text? "i.e. viewers so be nice!"

since we no longer list individual chat members, we could conceivably just move it somewhere else. like above the game selector.

@schlawg
Copy link
Contributor Author

schlawg commented Apr 9, 2025

we could integrate it with the divider control?

@ornicar
Copy link
Collaborator

ornicar commented Apr 9, 2025

could it be integrated with the "Please be nice in the chat" placeholder text? "i.e. viewers so be nice!"

interesting idea but there also are user links in there. not anymore apparently. That would be a broadcast thing.

@schlawg
Copy link
Contributor Author

schlawg commented Apr 9, 2025

try that one

@ornicar
Copy link
Collaborator

ornicar commented Apr 9, 2025

github no longer lets me push to this PR, I can't tell if they're wrong or if I am.

error: Authentication error: Authentication required: You must have push access to verify locks
error: failed to push some refs to 'https://github.com/schlawg/lila.git'

@ornicar ornicar merged commit 7a39d8a into lichess-org:master Apr 9, 2025
3 checks passed
@schlawg schlawg deleted the ui-broadcast-draggable-side-divider branch April 21, 2025 16:11
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.

3 participants