Commit Graph

352 Commits

Author SHA1 Message Date
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
a564fddfcb chore: remove unused public assets 2026-05-31 02:36:46 +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
14aca7bc8d Merge terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 37s
2026-05-30 23:38:47 +08:00
TerryM
5179a8c068 Fix popular rank dates 2026-05-30 23:33:23 +08:00
TerryM
4c01e4fa52 fix: unify mobile homepage section spacing to 10px
Mobile sections had no vertical rhythm (space-y only at md+) and
inconsistent header-to-content gaps. Add uniform 10px spacing between
sections and header-to-content so each section header sits symmetric.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 23:28:06 +08:00
TerryM
cff857362d Merge terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 27s
2026-05-30 23:00:16 +08:00
TerryM
ada117f4f4 fix: remove duplicate mobile page headings 2026-05-30 22:59:50 +08:00
TerryM
1ab8319465 Merge terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 27s
2026-05-30 22:55:09 +08:00
TerryM
3f251710d0 fix: polish mobile menu titles 2026-05-30 22:52:46 +08:00
TerryM
7ed4cbbeba fix: disable video controls text selection 2026-05-30 22:19:20 +08:00
92de7a57f4 Merge pull request 'terry-staging' (#13) from terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 35s
Reviewed-on: #13
2026-05-30 14:05:28 +00:00
ad4eeeb87a Merge branch 'main' into terry-staging 2026-05-30 14:05:09 +00: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
08c474e86b Merge pull request 'terry-staging' (#12) from terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 36s
Reviewed-on: #12
2026-05-30 10:45:30 +00:00
TerryM
5ce52943e9 feat: add image save hint 2026-05-30 18:44:15 +08:00
TerryM
0e877d4959 i18n: add longPressImageSave string used by the image lightbox
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 18:14:58 +08:00
TerryM
942db88f58 fix(ui): disable text selection on header, filter chips, and bottom nav
Add `select-none` to the sticky header, the type filter chips row, and the
mobile bottom nav so their labels and icons can't be highlighted/selected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 18:14:58 +08:00
TerryM
5f7c4eea62 fix: show recommended card thumbnails 2026-05-30 18:08:41 +08:00
TerryM
b2e4a4e710 fix: bound post deeplink scrolling 2026-05-30 18:08:39 +08:00
TerryM
41299b5b65 feat(deeplink): jump from banner/rank list to the exact post in All Materials
- FigmaBanner: route same-app linkUrl through SPA navigation so the stream's
  scroll-to-post runs without a full reload; defer pointer capture until a real
  drag starts, fixing plain clicks being swallowed by setPointerCapture
- PopularRankList: rank rows navigate straight to /browse?sort=popular&post=<id>
- MessageStream: ?post= deep links jump directly to the target instead of
  resetting to the top and animating through the stream
- ScrollToTop: skip the top-reset for ?post= navigations so the target page
  handles its own alignment

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 17:54:16 +08:00
TerryM
0733ea8b18 feat(category-icon): 分类图标支持 PNG 资源,学院类目改用 PNG
categorySvgUrlForSlug → categoryAssetUrlForSlug,映射值改为带子目录
的相对路径(svg/ 或 png/),新增 academy-materials / academy-video
的 PNG 图标并兼容拼写别名 acedemy-video。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 17:34:18 +08:00
TerryM
07f040a549 fix(video): 全屏关闭后内嵌进度条跳变而非从0扫动
程序化 seek 同步全屏播放进度时,新增 snapProgress 抑制进度条
的宽度过渡动画,使其直接落到观看位置,恢复播放时再启用过渡。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 16:54:03 +08:00
TerryM
eb0eabe21f Merge remote-tracking branch 'origin/main' into terry-staging 2026-05-30 16:04:04 +08:00
TerryM
40d64f1293 fix: 链接预览强调色按域名兜底,腾讯会议不再用黑色
部分站点(如 meeting.tencent.com)返回 themeColor=#000000,在深色气泡上看不见。
按域名覆盖为品牌金色,其余仍优先用 themeColor。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 15:43:30 +08:00
TerryM
9bef178bc8 feat: 大图查看器支持 iOS 长按"存储到照片"
去掉全尺寸图上的 select-none 并显式设 -webkit-touch-callout:default,使 iOS
Safari 长按图片能弹出原生「存储到照片」菜单(保存的是 current.url 全图)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 15:43:30 +08:00
TerryM
cc9f0a5730 fix(stream): preserve filename extension in narrow bubbles
Previously the file bubble wrapped JS middle-ellipsis in CSS truncate,
so narrow containers silently clipped the tail+extension, leaving
e.g. "25cb264a-e06…." instead of "25cb264a-e06…811a.jpg".

Split the displayed name into a shrinking head (with CSS truncate)
and a non-shrinking tail (last 4 base chars + extension). The browser
now decides how much head to clip while the suffix is always visible.
2026-05-30 15:42:13 +08:00
TerryM
1d74f29c2a copy(search): shorten mobile search placeholder 2026-05-30 13:55:52 +08:00
21e078fd89 Merge pull request 'terry-staging' (#11) from terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 35s
Reviewed-on: #11
2026-05-29 19:29:58 +00:00
TerryM
1557d29af7 docs(posts): clarify backend title field requirements
Clarify that compact browsing surfaces should receive short post title fields
from the backend even if some frontend pages do not display them yet. Separate
the product requirement from current frontend implementation status so backend
can implement the API contract first and frontend can opt in per surface later.
2026-05-30 03:28:33 +08:00
TerryM
a8fd540ef5 fix(stream): smooth scroll to linked post cards
Route resource card clicks to /browse?post=<id> instead of relying on hash
anchors, then manually calculate the sticky filter offset when scrolling to
the target bubble. Start from the top and smooth-scroll to the card for a
clear transition, with delayed auto realignments after media above the target
settles.
2026-05-30 03:11:03 +08:00
TerryM
6798e90708 feat(posts): support short titles for resource cards
Add optional post-level and localized title fields, and use a new
postTitleText helper for Resource.title so card/list surfaces prefer short
backend-provided titles instead of full body text. When title is missing,
fallback to the first non-empty body line, then filename, then post id.

Document the backend handoff in docs/posts-title-api.md alongside the other
backend task docs.
2026-05-30 03:11:03 +08:00
TerryM
2b9ab9eb2c fix: 搜索弹窗开启时点 burger 能正常打开菜单
关闭搜索弹窗会触发滚动恢复(window.scrollTo)发出 scroll 事件,被菜单的
closeOnScroll 立即捕获、把刚打开的菜单关掉。菜单打开后 250ms 内忽略滚动关闭,
跳过这次恢复滚动;之后用户真实滚动仍正常收起菜单。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 03:04:09 +08:00
TerryM
4c441244c8 style: 搜索提示行与输入框内容像素级对齐
输入框 border 改为 ring-inset(不占布局),使输入框内容与下方提示行(ⓘ+文字)
都位于「容器左缘+12px」同一基准,图标列严丝合缝对齐,不再依赖魔法数值。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 03:00:44 +08:00
TerryM
f1e5e17fce docs: 新增搜索与标签接口说明(给后端)
说明 /api/posts/search 期望的模糊匹配规则(跨标题/分类/标签/简介/类型/正文、
大小写不敏感、相关度排序)与参数,以及新增 /api/tags 返回全量标签+计数以替代
前端从最新80条现算的不完整标签来源。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 02:51:20 +08:00
TerryM
ea38503f37 ui(thumbnails): force preview images to fixed ratio
Use object-fill for compact preview thumbnails so rank-list covers and
file previews fill their fixed boxes without cropping or black bars. This
keeps the list layout stable while matching the desired compressed-ratio
thumbnail treatment.
2026-05-30 02:51:09 +08:00
TerryM
609c119277 fix: 搜索面板标签可再次点击取消(toggle)
再次点击已选中的标签时清空选中/查询/结果,而不是永久停留在该标签。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 02:50:19 +08:00
TerryM
78d055bb99 style: 热门榜封面与文件档预览缩略图改 object-contain 完整显示
热门榜单封面、文件档预览缩略图由 object-cover 改为 object-contain(文件预览
加底色),完整显示不裁剪。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 02:47:41 +08:00
TerryM
ce5505ea23 perf: 预热扩展至最新页,串行错峰避免卡顿
预热列表新增「最新」(/browse?sort=latest)。三个预取改为串行执行:每个在空闲
(requestIdleCallback)时触发、间隔 400ms,避免并发请求拖卡低端手机。仅 JSON。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 02:46:26 +08:00
TerryM
2e50b301a3 perf: 空闲预热全部资料/热门资料,点击前已缓存
usePostStream 导出 prefetchPostStream(已缓存/mock 则跳过)。PublicLayout 在
requestIdleCallback 空闲时后台预取「全部资料」「热门资料」首页数据并写入缓存,
用户点击进入时直接读缓存秒显,不再进页面才开始加载。预取仅 JSON,不拉图片。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 02:44:53 +08:00
TerryM
4a20d80f68 feat: 顶栏显示当前页名,去掉独立标题行;Logo回首页/页名回顶部
- 新增 PageTitleContext:页面上报标题,顶栏 brand 位显示当前页名(全部资料/
  热门资料/最新/官方/分类名/搜索/我的收藏),未上报则回退品牌名
- AssetStreamPage、Favorites 上报标题;移除资料流内单独的标题行,省出空间
- 顶栏拆分点击:Logo→首页(首页则回顶部);页名文字→回到当前页顶部

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 02:37:30 +08:00
TerryM
ed6e0023b8 ui(lightbox): hide nav arrow at the gallery ends
Clamp goPrev / goNext instead of wrapping the index, and hide the
left chevron on the first image and the right chevron on the last
one. Arrow keys, swipe gestures, and the on-screen buttons all
behave like a linear gallery now, so users get a clear cue that
they have reached the end instead of unexpectedly looping back.
2026-05-30 02:27:20 +08:00
TerryM
b848ce5db3 fix: 2图相册按真实比例+缩放贴合,竖图不再被裁
- albumLayout: 2 图不再 clamp 比例,格子按图片真实比例,避免下限 0.55 把竖图
  当矮图导致裁顶;3+ 张马赛克仍 clamp 保持整齐
- AlbumBubble: 2 图改用 object-contain,整图缩放贴合框内,永不裁剪;高度上限
  不变,不占用过多空间

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 02:26:43 +08:00
TerryM
27f9dbbc45 fix(album): keep true aspect ratios for two-image layouts
Split clampRatio into a sanity-check helper (safeRatio: reject
zero / NaN / negatives) and the actual aspect clamp. Two-image
albums now keep each image's real ratio so the cells match the
images exactly with no object-cover cropping. Three-plus image
layouts still clamp ratios to a 0.55-2 band so a single extreme
image cannot warp the mosaic.
2026-05-30 02:25:01 +08:00
TerryM
8646b51b6c feat(video): cross-platform inline player + polished overlay controls
- MessageInlineVideo (new): custom-controlled inline video that disables
  the iOS Safari / Chromium native overlays entirely and reimplements
  the essentials: tap-to-play, centered play affordance while paused,
  bottom bar with play/pause + current time + drag-to-scrub progress
  bar + remaining time + fullscreen. Pointer events with pointer
  capture cover both mouse and touch scrubbing, including dragging
  past the bar's bounds. The element listens to 'seeked' as well as
  'timeupdate' so external currentTime writes paint the bar even when
  the video is paused, and the goFullscreen callback synchronously
  syncs React state on close so the inline progress reflects the user's
  fullscreen playhead with no perceptible delay.
- VideoBubble: replace the inline <video controls> with
  MessageInlineVideo and thread postId through openVideo so the
  fullscreen overlay can attach the download pill to the right post.
- VideoPlayer overlay: replace its <video controls> with
  MessageInlineVideo size='lg', removing the iOS native arrows / PiP /
  mute / overflow controls. The overlay supplies its own large
  download pill and a beefier close button.
- AttachmentDownloadPill: new 'size' prop ('sm' default 30 px, 'lg'
  44 px with 22 px icon and text-[14px]) for overlay surfaces where
  the affordance can breathe and should feel touch-friendly.
- ImageLightbox: drop the inline LightboxDownloadButton and use the
  shared AttachmentDownloadPill size='lg' instead, with a matching
  larger close button. Unused imports cleaned up.
2026-05-30 02:25:01 +08:00