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

Add auto-collapse capability to pinned messages based on timeout provided by bannerProperties #156

Merged
merged 2 commits into from
Dec 29, 2024

Conversation

FlaminSarge
Copy link
Contributor

@FlaminSarge FlaminSarge commented Dec 23, 2024

This also updates the impl in ChatSummary, and adds a fix for responseIsAction for summary (in case YT ever starts sending summary in liveChatContinuation instead of initial data).
Note that in all cases, the behavior is auto-collapse instead of YT's default behavior of removing certain banners entirely after the time expires.

bannerProperties exists both on the top-level object as well as inside the liveChatBannerRenderer.
This impl does the following:

  • Get top-level isEphemeral.
  • If true, use top-level bannerTimeoutMs, or 0 if not present, and return.
  • If false, use top-level autoCollapseDelay, or liveChatBannerRenderer autoCollapseDelay if not present, or 0 if also not present, and return.

In stock YT, Redirects and AI Chat Summary use the top-level properties with isEphemeral=true and bannerTimeoutMs, and pinned chat messages use the inner object with just autoCollapseDelay.
AI Chat Summary also has an inner object with isEphemeral=true and autoCollapseDelay, but it never seems to get used by stock YT, and has a 30-second value instead of the 12 seconds of the top-level properties (the actual behavior uses 12 seconds).

Tested on mv3/chrome

…ided by bannerProperties

Also updates the impl in ChatSummary
This didn't affect summary since it never came through the chat interceptor, only on initial load, but will be needed for redirect as well
@KentoNishi KentoNishi merged commit 579d9a8 into LiveTL:master Dec 29, 2024
@FlaminSarge FlaminSarge deleted the pin-timeout branch December 29, 2024 22:18
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