Skip to content

Left Column: Keep New Chat button above chat list on initial RTL load - #516

Open
Mezdia2 wants to merge 1 commit into
Ajaxy:masterfrom
Mezdia2:fix/rtl-new-chat-button-stacking-on-reload
Open

Left Column: Keep New Chat button above chat list on initial RTL load#516
Mezdia2 wants to merge 1 commit into
Ajaxy:masterfrom
Mezdia2:fix/rtl-new-chat-button-stacking-on-reload

Conversation

@Mezdia2

@Mezdia2 Mezdia2 commented Jul 4, 2026

Copy link
Copy Markdown

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

  1. Set the interface language to an RTL language (Arabic or Persian).
  2. Hard-refresh / reload the page while that RTL language is already active.
  3. Observe the floating New Chat button in the lower corner — it sits under the chat list rows.

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-main is not a stacking context (position: relative, no z-index). The button (NewChatButton.scss) is position: absolute; z-index: var(--z-chat-float-button) and is a sibling of the chat-list Transition rendered inside #LeftColumn-main.

  • On a dynamic content/language switch, the content Transition retains a leftover transform from the slide animation. That makes it a stacking context, which contains the chat list's internal stacking, so the button reliably paints above it.
  • On an initial load, the transition is skipped (name="none"), so the Transition has 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.scss moves 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 Transition in LeftMain.scss with isolation: 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.

#LeftColumn-main {
  > .Transition {
    isolation: isolate;
    overflow: hidden;
    flex: 1;
  }
}

Verification

  • RTL — Arabic, reload with RTL already active: button floats above the chat list
  • RTL — Persian, reload with RTL already active: button floats above the chat list
  • RTL — dynamic LTR → RTL switch: still correct (unchanged)
  • LTR — no regression on load or dynamic switch

A short before/after screen recording can be attached here if useful.

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.
@netlify

netlify Bot commented Jul 4, 2026

Copy link
Copy Markdown

👷 Deploy request for telegram-tt-previews pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 83470af

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.

1 participant