Left Column: Keep New Chat button above chat list on initial RTL load - #516
Open
Mezdia2 wants to merge 1 commit into
Open
Left Column: Keep New Chat button above chat list on initial RTL load#516Mezdia2 wants to merge 1 commit into
Mezdia2 wants to merge 1 commit into
Conversation
The floating New Chat button (position: absolute, z-index: var(--z-chat-float-button)) is a sibling of the chat-list Transition inside #LeftColumn-main, which is not itself a stacking context. After a dynamic content/language switch the Transition keeps a leftover transform from the slide animation, so it forms a stacking context and contains the list's internal z-indexes, letting the button paint on top. On an initial hard load the transition is skipped, the Transition has no transform, and the chat-list content leaks into the shared parent stacking context and can render over the button. This only showed up in RTL because the button is moved to the left edge there, where it overlaps the leaked list content; in LTR it sits on the right and stays clear. Establish the stacking context unconditionally on the content Transition with isolation: isolate so the button's stacking order no longer depends on the load path.
👷 Deploy request for telegram-tt-previews pending review.Visit the deploys page to approve it
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In right-to-left locales (reproduced in both Arabic and Persian), the floating New Chat action button in the left column renders behind the chat list rows instead of floating above them, so it's partially hidden under the chat/channel/group avatars.
Steps to reproduce
The important detail for root-causing this: switching to an RTL language dynamically from an LTR session does not trigger the bug — the button stays on top as expected. It only appears after a reload with RTL already set. LTR locales are unaffected on both paths.
Root cause
#LeftColumn-mainis not a stacking context (position: relative, noz-index). The button (NewChatButton.scss) isposition: absolute; z-index: var(--z-chat-float-button)and is a sibling of the chat-listTransitionrendered inside#LeftColumn-main.Transitionretains a leftovertransformfrom the slide animation. That makes it a stacking context, which contains the chat list's internal stacking, so the button reliably paints above it.name="none"), so theTransitionhas no transform and is not a stacking context. The chat-list content then leaks into the shared parent stacking context, where it can paint over the button.It only surfaces in RTL because
NewChatButton.scssmoves the button to the left edge there (&[dir="rtl"] { right: auto; left: 1rem; }), placing it directly over the leaked list content. In LTR the button sits on the right and stays clear.Fix
Establish the stacking context unconditionally on the content
TransitioninLeftMain.scsswithisolation: isolate, so the button's paint order no longer depends on whether a transform happens to be present at load time. This keeps the existing z-index model intact — no!important, no arbitrary z-index bumps.Verification
A short before/after screen recording can be attached here if useful.