code icon indicating copy to clipboard operation
code copied to clipboard

Green overlay ontop of moderation button not accounted for on initial project load

Open EvieTheOwl opened this issue 9 months ago • 5 comments

Please confirm the following.

What browsers are you seeing the problem on?

Firefox

Describe the bug

If you load one of your own projects the green overlay that shows when a button is selected expands to the right causing it to fill other un-selected buttons.

Steps to reproduce

  1. Open a project that you own
  2. Observe the green button overlay expand to the right as the moderation button is added conditionally

Expected behavior

Green overlay should not overlap multiple buttons

Additional context

Image

EvieTheOwl avatar Feb 15 '26 01:02 EvieTheOwl

Yeah the overlay also seems to be offset on some buttons, so when I click gallery it's over changelog, when I click changelog it's over versions, etc., and then for moderation it's over gallery.

EclipsedReaper avatar Feb 15 '26 14:02 EclipsedReaper

Oh yeah I also get those

Alfix-Januarivinter avatar Feb 15 '26 15:02 Alfix-Januarivinter

Mine looks slightly different: Image

I assume this is related to https://github.com/modrinth/code/issues/5226 (cc: @IMB11)

srnyx avatar Feb 15 '26 23:02 srnyx

I assume this is related to #5226 (cc: @IMB11)

That looks like a different issue. I think this is unique because it's not related to the green overlay overlapping the wrong button the issue is it's overlapping multiple buttons at once which shouldn't happen.

EvieTheOwl avatar Feb 16 '26 00:02 EvieTheOwl

I tried to fix this issue, which seems to be caused by dynamically inserted Gallery and Moderation tabs. I rewrote the getTabElement function to no longer depend on the tabLinkElements reference array, but instead query the DOM directly within the scrollContainer to find the tab at the specific physical index.

IsQuyet avatar Feb 16 '26 00:02 IsQuyet