Commit Graph

162 Commits

Author SHA1 Message Date
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
53614189ce refactor(stream): simplify FilterChips by dropping the 1.5s scroll watcher
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 38s
The defensive rAF + scroll loop and its touching guard were added to
fight an iOS sticky-relayout quirk, but the module-level lastScrollLeft
plus the useLayoutEffect mount restore already cover the common case.
The watch loop also interfered with a fresh slide gesture immediately
after a filter tap. Strip it out together with the surrounding inline
comments so the component is the minimum needed: gold active state on
click and a remount-surviving scroll position.
2026-06-03 14:32:47 +08:00
TerryM
f2f2572cd2 feat(stream): surface source filename on official-assets cards
Image, album, and video bubbles in the official-assets category now
render the attachment filename as a bottom-left overlay so editors can
identify the source asset at a glance. Shared AttachmentFilenameLabel
component mirrors the AttachmentDownloadPill style, uses
filenameWithExtension so MIME-only attachments still get a sensible
label, and is pointer-events-none so it never blocks the bubble's tap
target.
2026-06-03 14:30:34 +08:00
TerryM
f7c0c0387e fix(stream): preserve FilterChips horizontal scroll across remount
PublicLayout wraps the routed page in <AnimatePresence> keyed by
pathname+search, so changing ?type=… fully unmounts the page and creates
a fresh FilterChips. A useRef-based save/restore therefore reset on
every filter switch. Persist the scrollLeft in a module-level value
that survives the unmount, restore synchronously on mount, and keep an
~1.5s post-mount watch window for the iOS Safari sticky relayout that
asynchronously snaps scrollLeft back to 0. Also gate the inactive-chip
hover color behind [@media(hover:hover)] so iOS sticky-hover no longer
leaves a faint gold tint on the last-tapped filter.
2026-06-03 14:30:27 +08:00
TerryM
724bfb8f24 fix(home): match Figma media pills for latest cards
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 37s
- Align latest-update media size pills to the Figma spec: 72x24 pill, black background, 24px gray icon cell, 10px label, and the exact small Figma cloud-download SVG.
- For non-document latest cards, remove the duplicate footer download action so media cards only show per-media size/download pills plus the bookmark action, matching the Figma non-document card design.
- Keep card heights flexible so content determines the final card height instead of locking to design mock heights.
2026-06-03 08:33:29 +08:00
TerryM
be638e32c9 feat(home): align desktop cards with Figma actions
- Update desktop header actions to match Figma: remove the standalone desktop favorites button and style the wallet connect pill with the wallet icon while allowing localized labels to expand.
- Replace favorite action with the Figma bookmark SVG and hover state; replace download cloud with the provided Figma SVG.
- Align official recommendation cards with the Figma card structure, colors, and bottom action row.
- Rework popular rows to the Figma desktop rhythm with 90px rows, wide thumbnails, rank area, and right-side action buttons.
- Add a dedicated desktop LatestUpdateCard for Figma-style latest-update masonry cards with flexible text-driven heights instead of fixed card heights.
2026-06-03 08:18:05 +08:00
TerryM
4f0d8925a4 style(popular): drop static border on rank row to match figma spec 2026-06-03 08:13:55 +08:00
TerryM
7e4be0a590 style(home): set recommended card background to #1D1E23 per figma spec 2026-06-03 08:11:48 +08:00
TerryM
a2f6c4fc35 style(home): align popular rank row and recommended card with figma
- PopularRankList: switch row to 90px Figma layout (246x90 cover, gap 24/12, pill px-3 py-1, meta color #9FA0A8, object-cover image)
- RecommendedCard: unify card and cover background to #272632
2026-06-03 08:08:28 +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
0898744deb Merge remote-tracking branch 'origin/main' into terry-wallet-login 2026-06-02 12:08:45 +08:00
TerryM
edba16bbd2 feat(stream): hold deep-link scroll until first content reveals
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 28s
Banner / Home-card deep-links were starting the smooth scroll the
moment the target post entered the DOM, before the in-view Reveal
animations on the top bubbles had time to fade in. Users perceived the
page as 'scrolling past nothing' because most bubbles were still at
opacity 0 when the viewport moved.

Track the moment first non-skeleton content appears for the current
target via firstContentAtRef, then hold the smooth-scroll start until
~300ms after that — long enough for the initial Reveal staggers to
play. Elapsed time is subtracted so cached arrivals don't pay the full
wait twice, and the ref resets per target so each navigation re-times.

Verified in the browser: with cold cache, content arrives ~480ms after
click, smooth scroll starts ~800ms (300ms settle), reaches deep target
by ~1.3s. With warm cache same pattern; users now see content before
motion begins.
2026-06-02 11:48:05 +08:00
TerryM
562843e4b2 feat(stream): reset scroll to top on ?post deep-link arrivals
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 28s
Banner / Home-card clicks landing on /browse?post=X now always start the
smooth-scroll positioning from the top of the stream, instead of from
whatever scrollY the user happened to leave the page at. Runs in
useLayoutEffect before paint so the user never briefly sees the previous
position before the jump, giving a clearly visible scroll journey to the
target post every time.

Verified in the browser: before banner click scrollY=2000, immediately
after =0, then smooth-scrolled to ~25k as pagination loaded the target
post deeper in the stream.
2026-06-02 11:42:10 +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
7ed9f8c8bf perf(banner): smoother deep-link from banner to /browse post
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 27s
- MessageStream: drop the mount-time scroll lock and the 80ms-delayed
  custom rAF; engage the lock only while the smooth animation runs and
  use native scrollTo({behavior:'smooth'}) so the page never feels frozen
  during pagination and the easing is buttery.
- PublicLayout: fire the default /browse prefetch immediately on mount
  (banner / Home tile destination) so a fast tap hits a warm cache;
  popular / latest stay deferred to idle.
- FigmaBanner: prefetch the all-scope stream on mount and on pointerdown
  as safety nets, and ignore empty / '#' / javascript: link URLs so a
  contentless banner renders as a non-interactive image.
- usePostStream: dedupe in-flight prefetches by key so concurrent
  callers (layout + banner) collapse into a single network request.
2026-06-02 11:30:47 +08:00
TerryM
fbb9d21f24 fix: cap banners shown to 10 with a single-row dot indicator
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 28s
The banners API can return hundreds of records; show at most 10 so the carousel
and its dot indicator stay on one row within the phone width, regardless of how
many exist on the backend.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 11:16:49 +08:00
TerryM
e752de67e1 fix(banner): preserve active language when navigating to post links
Banner linkUrls come back from the API as unprefixed paths
(e.g. /browse?post=123). Navigating to them directly dropped non-English
viewers into the English version of the post. Localize both the rendered
href and the SPA navigate target via stripLangPrefix + localizePath.
2026-06-02 11:12:26 +08:00
TerryM
d3e562663d fix: cap banner dot indicator at 10 to avoid mobile overflow
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 40s
With many banners the pagination dots overflowed the phone width. Show at most
10 dots in a window that follows the active slide; each dot still maps to its
real slide index.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 11:01:15 +08:00
TerryM
92210cf0a2 fix(lightbox): extend save hint display to 2.5s 2026-06-02 10:52:08 +08:00
TerryM
6c0c3b89a9 fix(lightbox): anchor save hint below rendered image
Measure the image's rendered bottom edge with refs + ResizeObserver and
position the long-press save hint relative to it instead of pinning to
screen center or stage bottom. Enlarges the toast for mobile legibility
and clamps the offset so tall portrait images don't push it offscreen.
2026-06-02 10:51:17 +08:00
TerryM
8acb3a281b fix: opt out of browser auto-translation
The app ships its own 7-language i18n and serves localized content, but mobile
browsers (Google Translate) were auto-translating the Chinese UI into broken
English (brand, nav, language dropdown). Add translate="no" + the Google
notranslate meta, and keep the attribute set on language changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 10:47:36 +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
4900256423 feat: add favorites to latest rows 2026-06-02 00:41:06 +08:00
TerryM
337e8f7e67 feat: add favorites state and buttons 2026-06-02 00:36:11 +08:00
TerryM
5a5acfcbc2 fix: show save guide on mobile only
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 27s
2026-06-01 23:13:25 +08:00
TerryM
e096d59fa6 feat: add media save guide 2026-06-01 23:00:28 +08:00
TerryM
7b48f9780c fix: use backend video preview urls
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 37s
2026-06-01 17:52:33 +08:00
TerryM
a968f47640 feat: support mobile video previews 2026-06-01 16:35:40 +08:00
TerryM
337d19e626 feat(i18n): split locale dicts into src/locales/ and add full Korean translation
- Extract zhDict/enDict from i18n.tsx into src/locales/{zh-CN,en}.ts
- Add full Korean dictionary (src/locales/ko.ts) covering all 115 UI keys
- Update formatBytes test/impl boundary for 1000-based units
2026-06-01 15:49:15 +08:00
TerryM
c32ae539f6 fix: use decimal (1000-based) units in formatBytes to match S3/curl display 2026-06-01 15:24:41 +08:00
TerryM
fa78568c94 feat: add localized home routes 2026-06-01 15:09:58 +08:00
TerryM
186ba362f3 fix: align banner width with 3-column latest section 2026-05-31 18:40:27 +08:00
TerryM
06fe117ebc feat: render desktop latest section as 3-column masonry
- Matches Figma design (file uHDZkVHjAp7BXDKQKB0PM4, node 4367-11405).
- Mobile keeps the existing 5-post single column unchanged.
- Desktop (md+) renders all 12 latest posts in a CSS-columns masonry
  with break-inside-avoid so each card's height stays content-driven.
- Adds an optional 'fluid' prop to MessageBubble that drops the
  standalone-feed max-widths so bubbles fill the masonry column. The
  /browse stream keeps the default non-fluid widths.
2026-05-31 18:35:57 +08:00
TerryM
c7e0562d9a feat: desktop banner peek with framer-motion blur
Match Figma node 4366-11092 desktop banner design:
- Slides shrink to 78%/72%/60% width on md/lg/xl with snap-center,
  first/last get matching left/right margin so the edges still center.
- Each slide is wrapped in a framer-motion m.div that animates filter,
  opacity, and scale between active and idle states.
- goTo and scroll/drag handlers use the slide's real offsetWidth so
  centering math holds at every breakpoint; mobile (full-width, snap-start
  visual) is unchanged.
2026-05-31 18:22:03 +08:00
TerryM
c71ebba807 fix: simplify desktop search panel
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 25s
2026-05-31 03:21:23 +08:00
TerryM
345ccb0a25 fix: preview search results 2026-05-31 03:10:56 +08:00
TerryM
6b3211f26f style: format homepage files
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 34s
2026-05-31 02:56:34 +08:00
TerryM
39c593c454 fix: add desktop search dropdown 2026-05-31 02:55:04 +08:00
TerryM
cf6bd7339e fix: unify homepage card background with the browse page
Match the official-recommendation and popular cards to the message bubble
surface color (#272632) used on the browse/all page and the latest section,
so homepage content cards and the browse page share one background. Also
align the popular card border with the official card (#27292E).

Categories tiles are intentionally left unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 02:48:18 +08:00
TerryM
46b7ee861e fix: expire frontend caches 2026-05-31 02:44:44 +08:00
TerryM
5b93e8dc77 fix: match banner and popular list width to the latest cards
Size the banner and the popular rank list to the same responsive widths as
the latest section's message bubbles (680/900/1120), so the banner, latest
cards and popular cards line up at one consistent content width on desktop.

Desktop-scoped; mobile stays full-width.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 02:39:54 +08:00
TerryM
e35573083a fix: align homepage section titles and unify download button color
- Wrap the Categories and Popular sections in the same responsive
  max-width container (820/1080/1180) used by Official and Latest, so all
  four section titles line up vertically on desktop.
- Official carousel arrows: hide the arrow at the edge already reached, and
  snap one card per click (reveal the next/previous card fully, keeping a
  small peek) instead of a fixed-pixel scroll.
- Show the pagination dots on desktop too (was mobile-only).
- RecommendedCard download button icon: text-ark-gold -> text-white to match
  the file bubble / popular / video download buttons.

Desktop-scoped; mobile layout unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 02:32:15 +08:00
TerryM
320e09cc87 fix: desktop homepage responsive polish and nav tweaks
- Banner: scale down and center on desktop (md:max-w-[680px] lg:max-w-[800px])
  so it no longer fills the whole screen.
- Align section widths to one responsive container (820/1080/1180): wrap the
  Official row and match Popular to Latest, fixing left-edge/width mismatches.
- RecommendedCard: stop the carousel card from shrinking back to 246.4px at xl.
- Popular download button now matches the file bubble's filled round
  DownloadCloud button for visual consistency.
- Header nav vertical padding py-1 -> py-0.5; swap Favorites before Popular
  across desktop nav and mobile menu to match the bottom tab order.
- Official carousel: hide the left arrow at the start and the right arrow at
  the end instead of always showing both.

All changes are md/lg/xl-scoped; mobile layout is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 02:04:26 +08:00
TerryM
9ac072e8d8 fix: jump to top on page change before post deep-link alignment
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 26s
Entering /browse via a popular-section card carried ?post=, which made
ScrollToTop skip the reset entirely. The window stayed at the previous
page's bottom scroll, so the deep-link animation visibly scrolled UP from
the bottom to the target post.

Now any pathname change jumps to the top first (even with ?post=), letting
the destination align to the post by scrolling down from the top. Hash
anchors and same-page ?post= changes are still left alone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 23:47:26 +08:00
TerryM
5179a8c068 Fix popular rank dates 2026-05-30 23:33:23 +08:00
TerryM
7ed4cbbeba fix: disable video controls text selection 2026-05-30 22:19:20 +08:00
TerryM
cc58ee8aac fix: smooth mobile footer tab switching 2026-05-30 21:48:14 +08:00
TerryM
d531ba40f3 fix: tighten mobile bottom nav spacing 2026-05-30 21:30:08 +08:00
TerryM
5277943196 fix: anchor mobile bottom nav 2026-05-30 21:27:48 +08:00
TerryM
5ce52943e9 feat: add image save hint 2026-05-30 18:44:15 +08:00