timche / gmail-desktop

:postbox: Nifty Gmail desktop app for macOS, Linux & Windows
MIT License
832 stars 91 forks source link

Fix/move google chat status menu #313

Closed DinCahill closed 2 years ago

DinCahill commented 2 years ago

The position of the Google Chat status dropdown is calculated in javascript. When compact header mode is enabled, it isn't positioned correctly, presumably because of the elements we've hidden.

They position it with the top and left properties, so I've used transform: translateX(-100px) to apply a constant offset.

Before:

before narrow before wide

After:

fixed narrow fixed wide

And when <body dir='rtl'>:

arabic
DinCahill commented 2 years ago

Something like this?

:not([dir='rtl']).gmail-desktop_compact-header
  [style*='top:'][style*='left:'][style*='visibility:']
timche commented 2 years ago

As you're only targeting style values, I'm not 100% sure if this is unique enough. Are there any other attributes or paths you could use?

DinCahill commented 2 years ago

As you're only targeting style values, I'm not 100% sure if this is unique enough. Are there any other attributes or paths you could use?

There are no other attributes. It has a single hardcoded Gmail class, so if we used that, the selector could just be :not([dir='rtl']).gmail-desktop_compact-header .tP.

timche commented 2 years ago

Thanks for explaining.

Let's use the Gmail class instead, although it's not good, but safer, because [style*='top:'][style*='left:'][style*='visibility:'] could also target another element with the same attributes.