Commit Graph

22 Commits

Author SHA1 Message Date
TerryM
4c684d75a3 Revert "fix: hide download URL in in-app browser guide"
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m18s
This reverts commit 3275aff121.
2026-06-05 21:09:42 +08:00
TerryM
3275aff121 fix: hide download URL in in-app browser guide
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m3s
Stop exposing the internal /apnew/api/.../download URL in the guide. The dialog no longer renders the file URL or copies it to the clipboard; instead the user copies the current page link (window.location.href) and opens it in their system browser, then taps download again — which uses the real fetch+blob path. Updated step copy and intro in all 7 locales to match the new flow.
2026-06-05 19:15:10 +08:00
TerryM
356d8a0207 fix: use absolute URL in in-app download guide
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m10s
Production builds the frontend with VITE_API_URL="" so attachmentDownloadUrl() returns a relative path like /apnew/api/.../download. Pasting that into Safari from another origin fails. Convert the URL to an absolute one (window.location.origin + path) before showing it in the in-app browser guide, and update the modal text in all 7 locales to make clear the copied link is the direct file download URL that, when opened in the system browser, triggers the download automatically.
2026-06-05 19:10:44 +08:00
TerryM
7a33a62c8f fix: in-app browser download opens file inline
- Detect in-app WebViews (WeChat / TokenPocket / imToken / Telegram / iOS WKWebView, etc.) and show a guide modal asking the user to open the link in their system browser, with a copy-link action.
- For normal browsers, fetch the attachment as a Blob and trigger download from a same-origin object URL so the file always lands in the user's Downloads folder with the original filename, even when the browser would otherwise inline-preview the response.
- Fall back to the anchor download for files larger than 50MB (avoid loading them entirely into memory) or when fetch fails.
- Pass `sizeBytes` from known call sites so the threshold actually applies.
- Add localized strings for the guide modal in all 7 locales.

See .unipi/docs/debug/2026-06-05-in-app-browser-download-debug.md.
2026-06-05 19:06:53 +08:00
TerryM
292c745549 feat(wallet): redesign drawer wallet states to match Figma 4476-15287/15669
Disconnected state (Figma 4476-15287): bump the compact CTA to the
spec'd dimensions — h-12 (48px), text-[15px], font-medium — so the
yellow 链接钱包 button matches the Figma pill exactly while leaving
the desktop header pill (compact=false) untouched.

Connected state (Figma 4476-15669/16024): rebuild the compact branch as
the spec'd info card + danger button:
- A transparent 登录地址 label (text-[13px] font-bold #E5E5E5) with an
  8px gap to the full 0x… address, which uses Figma's character-level
  styling: first 5 and last 5 chars rendered bold white, middle 32
  chars rendered #A8A9AE / font-medium, replicating Figma's
  characterStyleOverrides.
- A full-width 48px disconnect pill at bg-[#2A1B20] with #F36161 text
  and the LogOut glyph on the right at 15px font-medium.

Add a new walletLoginAddress i18n key across all 7 locales (en, zh-CN,
ja, ko, vi, id, ms) for the new 登录地址 label.
2026-06-05 12:22:41 +08:00
TerryM
1fcf2ea46d fix: fall back to original language on post redirect 2026-06-04 17:50:03 +08:00
TerryM
4059ec3f20 feat: confirm desktop wallet address
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 32s
2026-06-04 11:55:13 +08:00
TerryM
90f27b050c i18n: translate wallet desktop guidance
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 38s
2026-06-04 11:36:28 +08:00
TerryM
b4ef5ddb61 Merge branch 'main' into terry-wallet-login
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 31s
# Conflicts:
#	src/components/messageStream/MessageStream.tsx
2026-06-03 14:42:07 +08:00
TerryM
985463b7da fix(stream): resolve search deep-links without pagination stall
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 37s
Search results can link to older posts that are not present in the first
/browse page. The previous deep-link flow kept paginating the all-assets
stream until the target id appeared, leaving users stuck on the waiting
indicator for very old posts.

Fetch /api/posts/:id directly for ?post= arrivals and inject the resolved
target post at the top of the stream when it is not already in loaded
items. The normal paginated feed still loads below for context. Keep the
explicit finding/not-found status messages as a fallback for slow or
missing direct fetches.

Verified with search result c5eeb17d-3bd0-4d32-9c92-5efa6e4a015c: target
post rendered within 100ms instead of waiting for pagination. Checks:
tsc, format:check, tests, build.
2026-06-03 01:40:21 +08:00
TerryM
f0209eb894 fix(wallet): improve mobile login and logout flows 2026-06-02 21:05:01 +08:00
TerryM
0898744deb Merge remote-tracking branch 'origin/main' into terry-wallet-login 2026-06-02 12:08:45 +08:00
TerryM
387b25f1e3 feat(stream): friendlier pagination loading + error retry
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 29s
- Replace the bare '…' loading dots at the bottom of the post stream
  with a skeleton bubble that matches the initial-load placeholders, so
  pagination feels like content arriving instead of a frozen indicator.
- Localize the retry control via new 'retry' / 'loadMoreFailed' keys
  across all 7 locales and surface a user-friendly error string instead
  of the raw exception message.
- Retry button now picks reset() vs loadMore() based on item count so a
  pagination failure only refetches the next page, not the whole stream.
- When a banner deep-link can't find its target post and pagination
  errors, break out of the retry loop and release the scroll lock so the
  user sees the inline retry instead of an endless freeze.

Verified in the browser: zh-CN renders '加载更多资料失败,请检查网络后重试。'
with a '重试' button; banner clicks with empty / '#' / 'javascript:' /
null linkUrls render no anchor and do not navigate.
2026-06-02 11:39:17 +08:00
TerryM
ed04e1fb7e fix: TokenPocket mobile deep-link login, desktop empty-state, toast above modal
- Mobile TokenPocket now opens the tpoutside:// sign deep link and returns to
  the original browser to finish login (no wallet in-app browser); desktop
  keeps the QR. Fixes mobile login + logout being trapped in TP's browser.
- Desktop without an injected wallet shows a clear message instead of a dead
  button; TokenPocket login card is always available as a working path.
- Raise toast z-index above the login modal so feedback is visible.
- Add native TokenPocket-login strings across 7 locales.
- Document that the live backend lacks favorites + TokenPocket routes (404),
  the real blocker for those features in production.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 04:00:30 +08:00
TerryM
7abe4a868c feat: redesign wallet login and favorites, fix desktop/mobile bugs
- Remove forced BNB chain switch on injected login (signature is chain-agnostic)
- Refine isMobileDevice so touch Macs stay on desktop flow
- Wire RainbowKit/WalletConnect as a real MetaMask/imToken QR fallback,
  gated on a valid VITE_WALLETCONNECT_PROJECT_ID
- Rebuild login modal: single desktop primary action, collapsible other
  methods, mobile open-app fallback feedback, brand icons
- Add My Favorites entry points (header, mobile menu, wallet dropdown)
- Favorites page: error retry, mobile filter drawer
- Auto sign-out and re-login prompt on favorites 401
- Full native translations for all wallet strings across 7 locales

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 03:43:13 +08:00
TerryM
de93e883c9 feat: build favorites page 2026-06-02 00:39:36 +08:00
TerryM
337e8f7e67 feat: add favorites state and buttons 2026-06-02 00:36:11 +08:00
TerryM
43700d9fdc feat: add wallet login modal 2026-06-02 00:32:46 +08:00
TerryM
71dac8373e feat: add wallet provider foundation 2026-06-02 00:28:22 +08:00
TerryM
097c12bab5 copy: polish save album guide
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 36s
2026-06-01 23:09:25 +08:00
TerryM
e096d59fa6 feat: add media save guide 2026-06-01 23:00:28 +08:00
TerryM
c53032155b feat(i18n): add full ja/vi/id/ms translations and drop languageNames fallback
- Add complete dicts: src/locales/{ja,vi,id,ms}.ts (115 keys each)
- Remove languageNames override map; dict object now points directly to each locale
- i18n.tsx shrinks from ~414 lines to ~81 lines
2026-06-01 15:54:29 +08:00