-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: mf-5058 missing tips in mirror post page #10768
Conversation
c8283ca
to
dd45bb5
Compare
dd45bb5
to
feb502f
Compare
feb502f
to
99e4e8c
Compare
99e4e8c
to
5cf87e2
Compare
5cf87e2
to
b1d4a41
Compare
function selector() { | ||
return querySelector( | ||
[ | ||
'div[style$="height: 56px;"] a', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matching a style attribute is easy to break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then will fallback to div:has(> div > button[data-state="closed"]) a
which is more relaible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moved div:has(> div > button[data-state="closed"]) a
to the first.
packages/mask/src/site-adaptors/mirror.xyz/injection/Tips/PostVerification.tsx
Show resolved
Hide resolved
// Only the address link | ||
return querySelector( | ||
[ | ||
`#__next div:has(h2) ~ div a[href$="/address/${authorWallet}" i]`, // address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is authorWallet case sensitive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
const isDashboard = location.href === '/' | ||
if (!component || !visitingIdentity.identifier || isMinimal || isDashboard) return null | ||
|
||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could yield HTML contains span wraps block elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only the tip button, and elements inside are isolated.
BTW span > div
is valid.
export const postsContentSelector = () => | ||
querySelectorAll( | ||
[ | ||
// In Entries | ||
'[id="__next"] > div:nth-child(2) > div > div:not([class]) > div:not(footer)', | ||
// In collection | ||
'[id="__next"] > div:nth-child(2) > div > div > div > a:has(footer)', | ||
'[id="__next"] > div:nth-child(2) a:has(footer)', | ||
'[id="__next"] > div:nth-child(2) a:has(img[alt="Card Header"][loading="lazy"])', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attention i18n alternative text will fail the selector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL if this is not the only selector, maybe it's ok
b1d4a41
to
29530fe
Compare
https://mask.atlassian.net/browse/MF-5058