Skip to content

fix(redesign): sort the injected report link behind RoyalRoad's own buttons - #142

Merged
Seismix merged 1 commit into
devfrom
fix/redesign-report-link-mobile-order
Jul 31, 2026
Merged

fix(redesign): sort the injected report link behind RoyalRoad's own buttons#142
Seismix merged 1 commit into
devfrom
fix/redesign-report-link-mobile-order

Conversation

@Seismix

@Seismix Seismix commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

On RoyalRoad's redesign (beta), the injected "Report Recap" / "Report Blurb" link
broke the chapter action column's mobile layout, splitting RoyalRoad's own buttons
across separate rows and leaving two empty grid cells.

RoyalRoad orders that column with Tailwind order-* utilities (Donate is
order-2 col-span-2, Report Chapter order-1). Our link had no order, so it
took the default order: 0 and sorted ahead of both — and because it also
carries grid-column: 1 / -1, it forced a full-row break right in the middle of
the Fiction Page / Report Chapter pair.

The fix is order: 99 on the injected link, so it always sorts behind every host
button regardless of what RoyalRoad adds to that column later.

Changes

  • redesign-adapter.ts: add order: 99 to REDESIGN_CHROME.reportLink.style
  • Document why, so the next person doesn't "clean up" the magic number

Testing

Verified live on the beta layout (beta-ui-v2 cookie) with the built extension
loaded in Chromium, on a fiction that has a Donate button:

https://www.royalroad.com/fiction/179470/bloodstone-immortal-a-righteous-xianxia/chapter/3749121/26-second-layer-of-qi-condensation

Before, at 413px — note the two empty cells and the split pair:

Element y x width order
Fiction Page 317 12 183 0
Report Recap 365 12 374 0
Report Chapter 415 12 183 1
Donate 463 12 374 2

After, at 413px — host buttons pack as intended, injected link goes underneath:

Element y x width order
Fiction Page 317 12 183 0
Report Chapter 317 203 183 1
Donate 365 12 374 2
Report Recap 413 12 374 99

At 1400px the column is md:flex-col, where order still applies and
grid-column is ignored: Fiction Page, Donate, Report Chapter, Report Recap all
at x=1129 w=161 — the column did not grow.

  • Tested on Chrome/Edge
  • Tested on Firefox — not run; the change is a single inline CSS declaration
    with no browser-specific behaviour
  • Tested on Android (if applicable)

pnpm check: 989 files, 0 errors, 0 warnings.

Screenshots

Measurements above were taken from the live DOM rather than eyeballed, so they
capture the regression more precisely than a screenshot would.

…uttons

RoyalRoad's chapter action column is a two-up grid on mobile and a flex
column from md. It orders its children with order-* utilities: Fiction
Page has none (order 0), Report Chapter is order-1, and the Donate
button — recently added, and absent from the fiction this was originally
built against — is order-2 col-span-2.

The injected report link carried no order, so it sorted at 0 alongside
Fiction Page, and its grid-column: 1 / -1 forced a full-row break
between Fiction Page and Report Chapter. That split the row those two
are meant to share and left two empty cells:

    [ Fiction ] [  empty  ]
    [    Report Recap     ]
    [ Report  ] [  empty  ]
    [      Donate         ]

Sort it behind every host button instead. RoyalRoad's own buttons then
pack exactly as they intend and the full-width link lands underneath,
which holds whatever they add to that column next.

Verified live on a chapter with a Donate button, real extension loaded:
at 413px Fiction Page and Report Chapter share the top row (y=317,
x=12/x=203) with Donate and Report Recap full-width below; at 1400px all
four stay 161px, so the shrink-to-fit column does not grow.
@Seismix
Seismix merged commit 66ffb64 into dev Jul 31, 2026
4 checks passed
@Seismix
Seismix deleted the fix/redesign-report-link-mobile-order branch July 31, 2026 12:44
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