Skip to content

Updated with latest repo#11

Open
vaimeo wants to merge 5052 commits into
vaimeo:developfrom
DimensionDev:develop
Open

Updated with latest repo#11
vaimeo wants to merge 5052 commits into
vaimeo:developfrom
DimensionDev:develop

Conversation

@vaimeo

@vaimeo vaimeo commented Jun 1, 2022

Copy link
Copy Markdown
Owner

Description

Closes # (NO_ISSUE)

Type of change

  • Documentation
  • Code refactoring (Restructuring existing code w/o changing its observable behavior)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (a fix or feature that would make something no longer possible to do/require old user must upgrade their Mask Network to this new version)

Previews

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
    • I have removed all in development console.logs
    • I have removed all commented code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have read Internationalization Guide and moved text fields to the i18n JSON file.

If this PR depends on external APIs:

  • I have configured those APIs with CORS headers to let extension requests get passed.
    • chrome extension: chrome-extension://[id]
    • firefox extension: moz-extension://[id]
  • I have delegated all web requests to the background service via the internal RPC bridge.

guanbinrui and others added 23 commits January 25, 2025 09:41
* fix: token badge icon

* fix: solana redpacket expired
* chore: bump version to 2.31.0

* refactor: rename ERC20RedPacket to TokenRedPacket (#12075)

* fix: connect/change wallet label (#12076)

* fix: get redpacket state without parse api (#12077)

* fix: token badge icon (#12078)

* fix: token badge icon

* fix: solana redpacket expired

* fix: adjust layout in token approval (#12079)

* fix: hard code fix for virtual on base (#12080)

---------

Co-authored-by: Wukong Sun <swkatmask@gmail.com>
* chore: update linter

* fix: prettier

---------

Co-authored-by: Jack-Works <Jack-Works@users.noreply.github.com>
* feat(Wallet): mf-6516 disable permit

* fixup! feat(Wallet): mf-6516 disable permit

* fixup! fixup! feat(Wallet): mf-6516 disable permit

* refactor: abort with error

---------

Co-authored-by: guanbinrui <guanbinrui@mask.io>
guanbinrui and others added 30 commits May 10, 2026 22:39
Signed-off-by: cuoguojida <cuoguojida@outlook.com>
…ard (#12382)

- Remove NFT search capability from DSearch engine (NFTScan imports, handlers, rules)
- Delete searchCollectionListByTwitterHandle method and NFT early-return
- Delete MentionModifier component (NFT collection hover on @mentions)
- Delete CollectionProjectAvatarBadge component
- Simplify AvatarBadge to always use ProfileAvatarBadge
- Remove isCollectionProjectPopper from entire TrendingView pipeline
- Clean up NFT telemetry in SearchResultInspector
- Remove NFT MSW handlers from vitest setup
- Simplify Trader shouldDisplay to only FungibleToken
- Clean up NonFungibleCollectionResult residual types in TagModifier and ProfileTab
…base (#12383)

* refactor: remove all NFT functionality across the entire codebase

Phase 1: Delete pure NFT plugins (Avatar, Collectible, ArtBlocks)
Phase 2: Clean NFT parts from mixed plugins (RedPacket, Tips, Trader, RSS3, Approval, ProfileCard)
Phase 3: Delete content-script NFT injections (Twitter, Facebook, Instagram)
Phase 4: Delete popup NFT pages (CollectibleDetail, NFTAvatarPicker, UnlockERC721Token, NonFungibleTokenSection, WalletCollections)
Phase 5: Delete shared NFT UI components (NFTCard, NFTFallbackImage, NFTList, CollectibleList, AddCollectibles, ERC721Boundary, modals)
Phase 6: Delete NFT web3 hooks (10 useNonFungible* + 2 useERC721* hooks)
Phase 7: Delete NFT web3 providers (NFTScan, NFTSpam, HubNonFungible)
Phase 8: Delete NFT types, contracts, constants, events, telemetry, icons, locales
Phase 9: Final verification - fix TypeScript errors, remove dead code (Zora, Alchemy, OpenSea, LooksRare, MagicEden, SimpleHash, AvatarStore, etc.), add back needed SourceType values, simplify TransactionPreview/TokenTransactionConfirmModal

Retained: ERC721.json/ERC1155.json ABIs for transaction decoding, ERC721 transaction descriptor, token redpacket (non-NFT) functionality

* fixup! refactor: remove all NFT functionality across the entire codebase
#12384)

* refactor: mf-6777 remove all NextID functionality across the entire codebase

* fix: resolve TypeScript errors from NextID removal

* fix: linter

---------

Co-authored-by: swkatmask <swkatmask@users.noreply.github.com>
* feat(efp): recognize profile links

* feat(efp): render twitter embeds

* fix(efp): hide native twitter preview

* fix(efp): scope native twitter card hiding to post root

Replace the body-wide GlobalInjection MutationObserver with a per-post
hook that uses usePostInfoDetails.rootNode() (NextID pattern) and
queries [data-testid=card.wrapper] within the post (Mask Twitter
PostInspector pattern). The previous broad scan plus EFP-specific
metadata heuristics didn't reliably catch Twitter's lazy-rendered card,
leaving a duplicate native preview below the EFP card.

* fix(efp): query card.wrapper from the tweet, not from rootNode

The post's rootNode (per twitter selector at
packages/mask/content-script/site-adaptors/twitter.com/utils/selector.ts:186)
is the tweetText/tweetPhoto/div[lang] — the card.wrapper is its
sibling inside [data-testid=tweet], not a descendant. Climb up to the
tweet element before querying so the native EFP card is actually
found.

* fix(efp): detect via aria-label and hide card container

The native EFP detection was failing because Twitter wraps the link
in t.co (no href match) and the card.wrapper's textContent only holds
'brantly.eth' — the 'efp.app' reference lives in aria-label on the
inner anchor and in the 'From efp.app' footer that is a sibling of
card.wrapper. Detect via aria-label so isEFPCard returns true, and
hide the parent that's aria-labelledby the card so the footer is
hidden along with the wrapper.

* fix(efp): widen search root to article parent

[data-testid="tweet"] is sometimes on a nested div (not the article)
in this version of Twitter, so closest() can land on an element that
doesn't contain card.wrapper. Search from article.parentElement (the
timeline section / detail view container) instead — that covers both
the timeline layout (card inside article) and the detail layout
(card in a sibling subtree). Falls back to document.body when no
article ancestor is found.

* fix(efp): use card.contains(rootNode) to skip own injection target

Twitter's postsContentSelector matches [data-testid="card.wrapper"]
directly for link-only tweets, so rootNode can BE the card.wrapper.
The strict equality check was correct for that case but missed the
defensive case where rootNode might end up nested inside the wrapper.
contains() covers both.

* fix(efp): scope to article in timeline view

article.parentElement is the entire timeline container, so the
observer's textContent fallback in isEFPCard could hide a sibling
tweet whose Twitter preview happens to mention efp.app/ethfollow.xyz
(news article, embed of an EFP-related quote, etc.) even though no
EFP plugin is rendering for that post. Use isFocusing to detect
detail view, where the card can live in a sibling subtree of the
article (per twitter's postsContentSelector at
packages/mask/content-script/site-adaptors/twitter.com/utils/selector.ts:195),
and only widen the search root there. Timeline view stays scoped to
the article.

* fix(efp): clear lint errors in native twitter card hook

- Read rootNode/isFocusing via useContext(PostInfoContext) instead of
  the usePostInfoDetails proxy. The proxy returns plain values for
  fields like rootNode (no real hook is invoked under the hood) and
  react-compiler flags the property-access call as 'hook referenced
  as a normal value'. Reading from the context directly sidesteps
  the rule and is also one fewer indirection.
- Add the 'u' flag to /\\s+/ (require-unicode-regexp).
- Use optional chaining on labelledBy.split(...) per
  @typescript-eslint/prefer-optional-chain.

Confirmed clean with 'pnpm exec eslint packages/plugins/EFP --no-cache'.

* fix(efp): hide native card on link-only tweets

For tweets that are just an EFP link, Twitter's postsContentSelector
matches data-testid=card.wrapper directly as the post's rootNode, and
the plugin UI mounts in rootElement.afterShadow — a sibling of the
card.wrapper, not a descendant. The previous guard skipped hiding any
card that contained rootNode, leaving the native preview rendered
alongside the EFP card.

Replace the skip with a target choice: hide the card itself when the
container would also contain rootNode (so we don't take an ancestor
— which holds our afterShadow sibling — down with it), and keep
hiding the full container otherwise (so the 'From efp.app' footer
goes away with the wrapper).

* chore(efp): polish for review — i18n, dedup, drop completed TODOs

- Wrap user-visible strings in <Trans> per repo convention
  (ProfileCard eyebrow/metrics/footer/link, ApplicationEntries name + description)
- Dedup EFP host & reserved-path lists between constants.ts and helpers/url.ts
- Dedup host-keyword literals in isEFPCard via EFP_HOST_KEYWORDS
- Pass parsed EFPProfileLink from inspectors to Renderer (was parsed twice)
- Drop completed TODO list from README

* feat(efp): add dedicated EFP icon

Replace the generic Icons.Web3Profile placeholder with the EFP brand
logo (gold rounded square + arrow + plus mark) at all three call sites:
the App entry tile, the post wrapper, and the og-image fallback inside
ProfileCard.

* refactor(efp): route data API calls through background RPC

Move fetchEFPProfile (and the EFPProfileResponse type) to a Worker
module and expose it via PluginEFPRPC, mirroring the CyberConnect
pattern. Network requests now run in the background context instead
of the content script, sidestepping CORS preflight on the
data.ethfollow.xyz origin and aligning with repo convention for
external API calls.

* fix(efp): match protocol-less EFP links in PostInspector

X often renders link text without a scheme (efp.app/vitalik.eth).
mentionedLinks() requires URL.canParse (i.e. a protocol), so those
get dropped before parseEFPProfileLink can see them. Switch to
rawMessage() + parseURLs(text, false), matching the DecryptedInspector
in the same file and the rawMessage pattern used by NextID and
ScamSniffer.

* chore: whitelist efprpc in cspell.json

cspell tokenises PluginEFPRPC as Plugin / EFPRPC (consecutive caps
stay in one block), and EFPRPC isn't in any default dictionary.
Add it to ignoreWords in alphabetical order.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix(efp): restore native Twitter card when the plugin unmounts

useHideNativeTwitterCard sets display:none and aria-hidden=true on
the native Twitter card but the cleanup only disconnected the
MutationObserver, so on unmount (navigation, plugin disabled, post
leaving the viewport) the card stayed hidden with no way back.

Track each modified element with its previous display/aria-hidden
values and revert them on cleanup. Skip elements we've already
hidden so re-firings of the observer don't overwrite the stored
previous state.

* fix(efp): match cards by parsed link, not substring

isEFPCard used a[href*="efp.app"] and lowercase substring scans of
aria-label and textContent. That would hide any Twitter card whose
title or description happens to mention efp.app, or whose host
contains the substring.

Walk each anchor inside the card and run its href, visible text, and
aria-label through parseEFPProfileLink. Only valid EFP profile/list
URLs match, which also handles t.co-wrapped hrefs (the real URL
surfaces as the anchor's display text). Drops the now-unused
EFP_HOST_KEYWORDS export.

* refactor(efp): use useQuery for profile data fetching

Replace the hand-rolled useReducer + useEffect + cancellation flag
with @tanstack/react-query (already a workspace dep, used by
CyberConnect the same way). The select callback narrows the
EFPProfileResponse via isProfileResponse so the rest of ProfileCard
keeps its existing data?.foo access shape.

Drops the EFPProfileState / EFPProfileAction types, reduceEFPProfileState
and the useEFPProfile wrapper. getDisplayName now also accepts
undefined since useQuery's data is undefined during the initial load.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix(efp): detect and hide EFP links rendered as t.co cards

Two related cases failed because the EFP URL never appears as readable
text in the post: a link-preview card whose tweet body has no URL, and
a long wallet-address URL that X truncates with an ellipsis.

Detection: also scan usePostInfoDetails.mentionedLinks(), where the
site adaptor deposits t.co links resolved to their real destination, in
addition to the protocol-less body parse. This covers both cases (the
resolved URL is the full, untruncated address/card link).

Hiding: isEFPCard could not recognise these cards either — the t.co
href is opaque and the destination only surfaces as the media anchor's
aria-label ("efp.app vitalik.eth"). Match the first whitespace token
(Twitter's declared card-source host) against EFP_HOSTS by exact
equality. Without this the native card would stay visible next to the
plugin card, i.e. two cards. Both halves ship together by design.

* fix(efp): accept http links resolved from t.co redirects

X rewrites protocol-less links into http:// t.co redirect targets, so an
EFP link surfaced through t.co resolution arrives as http and was
rejected by the https-only protocol check. Accept http alongside https;
every emitted URL is still built from the https EFP_APP_URL constant.

* fix(efp): detect EFP cards from the card DOM, not only collected links

When X renders a link-preview card it strips the URL from the tweet
text, leaving the card anchor's t.co href as the only trace of the EFP
link. The site adaptor does resolve card anchors into mentionedLinks,
but that collection runs once when the post's text node is first
processed — a card that mounts later (common on slow connections) is
never collected, so the plugin stayed inert.

Watch the post's card area directly (same scoping as the hide logic),
collect anchors from cards that pass isEFPCard, and resolve their t.co
hrefs through the shared background resolver. The card is only adopted
once its target parses as an EFP profile URL, and the lookup stays
disabled whenever the post text or collected links already produced a
link.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* fix: mf-6781 lens follow status query on unresolved handle

* fix: mf-6781 strip .lens handle suffix in lens account lookup
…12387)

* refactor: mf-6787 remove NFT descriptions from app settings

* fix: mf-6780 price chart crash on dsearch cards

Replace json-stable-stringify in useLineChart's effect dep array with
the destructured dimension primitives (top/right/bottom/left/width/
height). The default-import interop resolved to a non-callable value in
the bundled price-chart chunk, throwing on render. Dimension is a flat
struct of numbers, so listing the fields directly keeps deps stable
without the dependency.

* fix: mf-6783 fiat on-ramp widget fails to open

Replace json-stable-stringify in useTransakURL's useMemo dep array with
native JSON.stringify. The default-import interop resolved to a
non-callable value in the bundled Transak chunk, throwing on render
inside BuyTokenDialog so the fiat on-ramp never opened. config is a
generic Partial<TransakConfig>, so JSON.stringify keeps deps stable
across all fields without the dependency — same fix shape as mf-6780.

* fix: linter

---------

Co-authored-by: swkatmask <swkatmask@users.noreply.github.com>
* fix: mf-6789 hide load network file upload entry

* fix: linter

---------

Co-authored-by: swkatmask <swkatmask@users.noreply.github.com>
* fix: mf-6786 hide web3 profile entry from application board

* fix: linter

---------

Co-authored-by: swkatmask <swkatmask@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: verify chainId in tx based on provider

* fix: linter

---------

Co-authored-by: Jack-Works <Jack-Works@users.noreply.github.com>
#12407)

* fix: mf-5297 fire red-packet share telemetry on successful post instead of encrypt click

* fix: eslint

* fix: linter

---------

Co-authored-by: swkatmask <swkatmask@users.noreply.github.com>
Co-authored-by: Jack-Works <Jack-Works@users.noreply.github.com>
Co-authored-by: guanbinrui <52657989+guanbinrui@users.noreply.github.com>
* fix: mf-5445 keep wallet connected after device standby

* fix: eslint

* fix: linter

---------

Co-authored-by: swkatmask <swkatmask@users.noreply.github.com>
Co-authored-by: Jack-Works <Jack-Works@users.noreply.github.com>
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.