Repository navigation
fix: X post tips button — displaced share button, crash-hidden button, and slot flicker - #12500
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
swkatmask
force-pushed
the
fix/mf-6844-6846-post-tips-button
branch
from
October 12, 2026 15:08
2d46e1c to
b05b8fb
Compare
swkatmask
force-pushed
the
fix/mf-6844-6846-post-tips-button
branch
from
October 12, 2026 23:31
b05b8fb to
197a512
Compare
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes for the X (Twitter) post tips button, each verified live on x.com with a dev build:
mf-6844 — hidden tips slot displaced the share button
injectTipsButtonOnPostsetflex: 1on the share wrapper (leftover from the Mirror.xyz integration). Today's X sizes that wrapper to content, flush right;flex: 1 1 0%made it an extra growing item, left-aligning the share icon and leaving dead space at the action bar's right end on every post, even when the tips button was hidden. Fix: stop touching the wrapper's flex (measured on the live stock DOM: dead space 79px→0 with the button hidden; tips flush-right + share immediately before it when visible).mf-6845 — degraded userinfo payloads crashed identity resolution
FireflyTwitter.getUserInfotrusted the proxied GraphQL shape. The backend degrades two ways:{code: 0, data: {}}(live fetch failed, nothing cached — protected accounts) crashed atres.data.data.user;__typename: 'User'withoutlegacy(suspended/rate-limited lookups) passed validation and crashed every caller readinguser.legacy.*— the reportedidentity.ts:119 Cannot read properties of undefined (reading 'screen_name'). Both crash paths feed the react-query entry poweringPostTipsSlot, hiding that author's tips button. Fix: validate the chain and requirelegacy, returningnullotherwise (AvailableTwitterUserkeeps the guaranteed shape; wire types now model the degraded shapes).mf-6846 — the tips button flickered (show → hide → show …)
Two stacked bugs in the injection:
div:has([aria-haspopup="menu"]):last-child— the injected span is appended right after the match, so the match stopped being:last-child, the watcher dropped/destroyed it, it matched again, re-injected… infinite add/remove at MutationObserver cadence (measured:visible → removed → emptycycle every ~150ms).:last-childonly existed to disambiguate from the retweet button.DOMProxy+ React tree on everyonNodeMutation/onTargetChanged, tearing the rendered button down while the fresh tree re-resolved identity/accounts, sometimes leaving the live slot empty with the tree orphaned off-DOM.Fix: match the share wrapper stably (the only action-bar menu button without a
data-testid), use the watcher-provided DOMProxy (auto re-anchored on node replacement, auto-destroyed on removal), and mount the React tree once — remount only when the post's author changes.Verification
UserUnavailable), protected ({}) and healthy handles — all resolve to a complete user ornull; callers degrade gracefully.Refs: MF-6844, MF-6845, MF-6846