Commit Graph

350 Commits

Author SHA1 Message Date
cbaa06f77d Merge pull request 'terry-staging' (#16) from terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 1m0s
Reviewed-on: #16
2026-06-05 16:33:11 +00:00
85a24ef982 Merge pull request 'terry-wallet-login' (#15) from terry-wallet-login into terry-staging
Reviewed-on: #15
2026-06-05 16:32:43 +00:00
TerryM
ae84e73736 fix: keep popular card hover ring inset
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m5s
2026-06-06 00:30:18 +08:00
TerryM
bd48fded30 fix: add favorites to public navigation
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m10s
2026-06-06 00:25:12 +08:00
TerryM
fd1a3f4b3e fix: favorites click opens isolated single-post view
When `linkToResource` is set, PopularRankRow now navigates to /resource/<id>?single=1 and PostRedirect propagates the `single=1` flag to the /browse?post=... target. MessageStream already supports singlePostMode (no filter bar, no sentinel, only the target post in the list), so favorites cards open the post in isolation instead of dropping the user into the surrounding stream.
2026-06-06 00:23:46 +08:00
TerryM
37e6e4901f fix: route favorites cards through /resource so they survive language switch
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m18s
Favorites are stored regardless of language but the card click was navigating to /browse?post=<id>&single=1 in the current UI language. When the user switched languages (e.g. zh→en) and tapped a zh-only favorite, the /browse stream couldn't find the post in its English view and showed "Couldn't find this post in the current view".

Make Favorites navigate via /resource/<id> instead. PostRedirect already tries the current UI language first, then falls back to the post's source language and shows a toast. Renamed PopularRankRow's seldom-used `singlePostLink` to `linkToResource` to make the intent obvious; Favorites passes the new prop.
2026-06-06 00:04:19 +08:00
TerryM
e80330b13c fix: stop language picker shrinking in flex header
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m5s
After dropping the fixed width, the language pill still got truncated because its flex parent could shrink it below content size. Add `shrink-0` to the wrapper and switch the trigger button from `w-full` to `w-auto` with `whitespace-nowrap`, so the button always sizes to fit the longest label like "Bahasa Indonesia".
2026-06-05 21:39:05 +08:00
TerryM
b38b28f175 fix: show full language name in the picker
The desktop language pill had a fixed width (md:w-36 lg:w-40) that truncated long labels like "Bahasa Indonesia". Drop the fixed width so the button sizes to content, remove the truncate on the label, and let the dropdown menu match parent width with a sensible min-width. Same `truncate` was hiding the full label inside the mobile drawer dropdown — bumped its width to fit too.
2026-06-05 21:31:43 +08:00
TerryM
ec8ef5b774 fix: hide URL preview in in-app download guide
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m8s
Drop the visible URL box from the modal — only the Copy link button remains. Copy still writes the absolute file download URL to the clipboard so the user can paste it into Chrome/Safari to trigger the download.
2026-06-05 21:17:34 +08:00
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
ee3f2c43eb Revert "fix: download button on cards opens the post page"
This reverts commit 75ccfd78ed.
2026-06-05 21:09:42 +08:00
TerryM
75ccfd78ed fix: download button on cards opens the post page
On compact cards the user cannot see which file is attached, especially for multi-attachment posts. Make the small download button on PopularRankRow, RecommendedCard, and LatestUpdateCard navigate to the post detail page instead of triggering an immediate download, so the user lands in the full post and picks the exact attachment to download.
2026-06-05 19:36:54 +08:00
TerryM
69bef7ee6e fix: hide download button on favorites cards
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m8s
Add `showDownload` prop to PopularRankRow (default true to keep Home popular cards unchanged) and pass `showDownload={false}` from the favorites list.
2026-06-05 19:31:27 +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
abfd92b16a fix: avoid unnecessary favorites reloads
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m20s
2026-06-05 18:56:11 +08:00
TerryM
9f5367ae12 fix: show only selected post from favorites 2026-06-05 18:52:25 +08:00
TerryM
2d003c6fef fix: unify home download button sizing 2026-06-05 18:47:04 +08:00
TerryM
908f89ac24 fix: clarify multi-document downloads 2026-06-05 18:45:32 +08:00
TerryM
aae7faf9dd fix: adjust mobile popular card layout 2026-06-05 18:39:32 +08:00
TerryM
4e459aa4be fix: hide rank badges on favorites 2026-06-05 18:25:17 +08:00
TerryM
5d550e0342 fix: show download per document attachment 2026-06-05 18:20:27 +08:00
TerryM
a9ec46e008 fix: refresh favorites after unfavorite 2026-06-05 18:16:33 +08:00
TerryM
486c09dd39 fix: simplify mobile favorite button state 2026-06-05 18:14:48 +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
e73e25077e Merge branch 'main' into terry-wallet-login
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 34s
2026-06-05 01:08:47 +08:00
TerryM
36ab5be3c2 feat(categories): hide the 综合 (general) category from the UI
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 33s
Both the categories page grid and the home categories carousel now
filter out the 'general' slug before sorting. The full backend list is
still kept in state so posts that resolve their label via the
categories lookup don't lose their name. Backend will follow up by
dropping the slug from /api/categories; this client-side filter then
becomes a defensive no-op.
2026-06-05 01:07:40 +08:00
TerryM
062f630798 fix: dedupe post redirect language fallback
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 30s
2026-06-04 18:07:51 +08:00
TerryM
1fcf2ea46d fix: fall back to original language on post redirect 2026-06-04 17:50:03 +08:00
TerryM
ec98ff5a03 fix: align favorites page with post adapter
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 28s
2026-06-04 17:46:09 +08:00
TerryM
4f6cbbc314 fix: simplify favorites display
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 38s
2026-06-04 17:25:55 +08:00
TerryM
6471559b3b fix: stabilize favorites page loading 2026-06-04 17:15:14 +08:00
TerryM
efaf92c4e4 fix: limit visible toasts 2026-06-04 17:10:11 +08:00
TerryM
01eab88c0f feat: connect wallet favorites to backend 2026-06-04 17:06:29 +08:00
TerryM
fd19ed438e fix: hide imtoken on desktop wallet login
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 30s
2026-06-04 15:29:22 +08:00
TerryM
53dc35e7dc fix: restore mobile wallet login feedback
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 37s
2026-06-04 15:19:50 +08:00
TerryM
863a448ec9 Merge branch 'main' into terry-wallet-login
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 30s
# Conflicts:
#	src/App.tsx
2026-06-04 12:04:22 +08:00
TerryM
1b52a6d93d feat(routing): shorten language URL prefixes to ISO codes with legacy redirects
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 31s
Rename the localized URL prefixes from full English names to short
ISO-style codes:
  /chinese    -> /cn
  /japanese   -> /ja
  /korean     -> /ko
  /vietnamese -> /vi
  /indonesian -> /id
  /malay      -> /ms

Add legacyLanguageRedirects mapping and a LegacyLangRedirect component
in App.tsx so links shared on WeChat (and elsewhere) that still use the
long-form paths keep landing on the right page. The redirect preserves
the sub-path, query string, and hash, e.g.
  /malay/browse?post=42#x -> /ms/browse?post=42#x

Also refresh doc-comment examples in i18n.tsx, FigmaBanner.tsx,
PublicLayout.tsx, and useLocalizedPath.ts so future readers see the new
prefixes.
2026-06-04 12:01:38 +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
0a86619b6c feat: guide desktop wallet connection 2026-06-04 11:32:59 +08:00
TerryM
ae64f96bbe fix: translate wallet no account error
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 32s
2026-06-04 11:14:52 +08:00
TerryM
65dee3a37e feat: simplify wallet login options
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 29s
2026-06-04 10:52:41 +08:00
TerryM
fb904d3a55 fix: restore staging imtoken login behavior
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 37s
2026-06-04 10:27:31 +08:00
TerryM
355c920c80 chore: remove wallet code comments 2026-06-04 09:55:19 +08:00
TerryM
f8369b6361 fix: auto login inside imtoken browser 2026-06-04 09:46:24 +08:00
TerryM
53eab4a066 fix: restore imtoken direct login path 2026-06-04 09:39:14 +08:00
TerryM
93790cb885 fix: remove wallet verification popup 2026-06-04 09:36:20 +08:00
TerryM
a1b318016f fix: detect imtoken injected provider by browser 2026-06-04 09:31:07 +08:00