XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

"Scrolling Avatars" feature

Open enchanted-sword opened this issue 1 year ago • 5 comments

Description

Adds a "Scrolling Avatars" feature that hides the reblog parent avatars in post headers and changes them back to the 64px sticky-style scrolling avatars that appear beside posts.

Resolves #1310.

Testing steps

  1. Enable the "Scrolling Avatars" feature
  2. Navigate to the dashboard

enchanted-sword avatar Oct 30 '23 15:10 enchanted-sword

Two things I should note:

The scrolling avatars function identically to the original ones, but they don't have blog popovers. It could be possible that there is a way to clone the existing popovers (I tried with no success) or create new popovers.

The avatars do require custom CSS. Most of the class keys for the scrolling avatars refer to multiple obfuscated classes, and from my testing there's no way to get the expected style behavior with keyToClasses() without specifying a specific index in the class array, which defeats the point of using the key function in the first place. In the unmodified Tumblr layout before the header update, I found that which classes out of the array actually end up in the DOM seemed to depend on your browser's perceived window size.

enchanted-sword avatar Oct 30 '23 15:10 enchanted-sword

Does this break with #1291? I assume it probably does. Not a huge deal.

marcustyphoon avatar Oct 30 '23 15:10 marcustyphoon

Does this break with #1291? I assume it probably does. Not a huge deal.

Possibly, I haven't looked at that PR yet. These are the changes that feature makes to resize the wrapper to fit the icons:

const styleElement = buildStyle(`
  ${keyToCss('mainContentWrapper')} { margin-left: 85px; }
  @media (min-width: 990px) {
    ${keyToCss('tabsHeader')} { margin-left: -105px !important; }
  }
`);

enchanted-sword avatar Oct 30 '23 15:10 enchanted-sword

I believe previously there were no scrolling avatars in the <990px mobile view; should this reproduce that? That should be as simple as putting all of the CSS in a style element and setting its media attribute, as well as setting display:none on the added elements in the opposite case.

marcustyphoon avatar Oct 30 '23 15:10 marcustyphoon

I suppose it would make sense to address https://github.com/AprilSylph/XKit-Rewritten/pull/1315#issuecomment-1789822651 here as well.

marcustyphoon avatar Nov 01 '23 23:11 marcustyphoon