Commit Graph

199 Commits

Author SHA1 Message Date
TerryM
a4884a689d perf: 图片渐进加载,缩短首屏等待
- 流内单图改用缩略图(原图仅在灯箱按需加载),体积大幅减小
- BubbleImage 加 decoding=async + 加载完淡入(ark-img-fade),图片逐张出现
- 视频海报/文件预览/推荐卡/热门榜补 decoding=async、lazy
原图无缩略图时自动回退,无回归。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 01:54:28 +08:00
TerryM
29dc71d2dd feat(link-preview): frontend interface for Telegram-style URL preview
Adds the front-end side of the link-preview feature so the back-end
team has a fixed contract to implement against.

- docs/link-preview.md: full spec for the `/api/link-preview` proxy
  and the preferred inline-on-Post integration. Covers caching, SSRF
  guards, metadata-extraction precedence, provider quirks, and the
  front-end rendering rules. Scope is the first URL only.
- types/post.ts: new `LinkPreview` type and optional `linkPreview`
  field on `Post`.
- LinkPreviewCard: clickable card with a themeColor accent bar,
  siteName / title / description (line-clamped), and an optional
  1.91:1 thumbnail. Whole card is an `<a target="_blank">` to the
  canonical URL.
- MessageBubble: render the card between the bubble body and the
  timestamp, with padding that matches visual vs. text-only bubbles.
- mockPosts: example `linkPreview` payloads on p-005 and p-010 so
  the visual works when running with VITE_USE_MOCK_POSTS=true,
  and so the back-end has concrete reference values.
2026-05-30 01:40:00 +08:00
TerryM
09d887dd52 feat: 筛选条支持鼠标滚轮横向滚动
桌面鼠标无横向滚轮且滚动条隐藏,溢出时末尾筛选项不可达。加非被动 wheel
监听,溢出时将 deltaY 转为横向 scrollLeft;未溢出则不接管,不影响页面滚动。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 01:39:06 +08:00
TerryM
8425809f98 fix: 全部资料页底部导航固定在屏幕底部
/browse 的 main 分支缺少 flex-1,内容少时主区不撑开,底部导航跟着内容
跳到屏幕中间。补上 flex-1,主区填满剩余高度,sticky 底部导航始终贴底。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 01:34:16 +08:00
TerryM
8610ac521e fix: 筛选标签选中态手机端改为金色
之前手机端选中标签是白色(text-white),仅桌面金色;统一为 text-ark-gold,
与品牌色一致。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 01:32:06 +08:00
TerryM
61f3c41567 feat: 资料流标题+筛选吸顶,滚动时保持可见
把「全部资料」标题与筛选标签合并为一个吸顶块,钉在全局顶栏下方
(top-[64px]/md:top-[70px]),向下滚动时标题和筛选都不再消失,仅内容流滚动。
移除 FilterChips 原先吸到 top-0(藏到顶栏背后)的行为。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 01:31:10 +08:00
TerryM
e9245875a3 feat(stream): floating page title pill when heading scrolls out
Add a Telegram-style sticky title to AssetStreamPage: an
IntersectionObserver watches a sentinel placed just under the main
heading and, once the heading scrolls past the sticky global header,
a floating pill slides in showing the current page title so users
always have a context anchor.
2026-05-30 01:27:02 +08:00
TerryM
fd46359fd9 ui: re-introduce adaptive download pill sizing for album tiles
- AttachmentDownloadPill: bring back the optional adaptive sizing
  branch (default off). When the host sets containerType: inline-size,
  the pill scales 22-30px with the tile width using a steeper
  18cqw curve, so two-image tiles already reach 30px while tiny
  thumbs in mixed layouts stay at 22px.
- AlbumBubble: opt every tile into adaptive sizing and add the query
  container so the cqw units resolve against each tile's width.
- Single-image and video bubbles continue to render the pill at a
  fixed 30px (no host opt-in needed).
2026-05-30 01:27:02 +08:00
TerryM
4e5093cae0 ui: drop the 'download complete' success toast
Successful downloads no longer pop a 'downloadOk' toast across all
the download sites (PopularRankList, RecommendedCard, FileDocBubble,
ImageLightbox). The browser's native download UI already confirms
the action, and the toast was redundant noise. Failure toasts and
the spinner state remain so users still see errors.
2026-05-30 01:21:35 +08:00
TerryM
92e6ce9dd8 feat(video): explicit fullscreen button, simplify download pill sizing
- VideoBubble: add a Maximize2 fullscreen button at the top-right of
  the inline player (mirrors the download pill on the left), so the
  user explicitly opts into fullscreen instead of any tile click being
  promoted to one. Removed the outer onClick that opened fullscreen
  on any tap.
- AttachmentDownloadPill: drop the adaptive (cqw-based) sizing branch
  and the corresponding 'adaptive' prop. The pill is now a uniform
  30px tall in every host (album tile, single image, video tile),
  matching the design without needing query containers on parents.
- AlbumBubble: remove the now-unused 'adaptive' prop and the
  containerType: inline-size hook that supported it.
2026-05-30 01:21:35 +08:00
TerryM
6b42981419 fix(video): keep scroll position and stop pause from going fullscreen
- VideoBubble: stopPropagation on the inline <video> element so
  clicks on the native controls (play/pause/seek) don't bubble up
  to the outer tile, which previously promoted any control click
  into a fullscreen overlay.
- VideoPlayer: replace overflow:hidden body lock with the iOS-safe
  position-fixed + scroll-restore pattern. Closing the fullscreen
  player now returns the page to the exact scroll offset it had,
  instead of snapping back to the top on iOS Safari.
2026-05-30 01:09:19 +08:00
TerryM
f7230de12b ui(mobile): block pinch-zoom and iOS input auto-zoom
- index.html: tighten the viewport meta with maximum-scale=1,
  user-scalable=no, viewport-fit=cover so pinch-zoom is disabled
  on browsers that honor the hint (Android Chrome).
- SearchPanel: bump the mobile search input from text-sm (14px) to
  text-base (16px). iOS Safari auto-zooms inputs whose font-size is
  below 16px on focus, which widened the viewport and let the user
  pan horizontally; 16px stops that behavior at the source.
2026-05-30 01:05:25 +08:00
TerryM
ac208dfe25 style: stronger contrast on image lightbox nav buttons
Bump the previous/next chevron buttons from translucent white tint
to a solid-ish black with a subtle ring + shadow, so the controls
stay legible on light or busy image backgrounds.
2026-05-30 01:02:18 +08:00
TerryM
cb14cb166a ui: prevent layout shift when mobile search overlay opens
- SearchPanel: focus input with { preventScroll: true } so the browser
  doesn't auto-scroll the underlying page when the overlay mounts.
- SearchPanel: add overscroll-contain on the scroll container so
  reaching the panel's edges does not chain into the body on Android.
- PublicLayout: lock background scroll while the mobile search overlay
  is open using the iOS-compatible position-fixed + restore pattern,
  so the page underneath cannot move at all.
2026-05-30 01:02:18 +08:00
TerryM
d19f2f9efa feat: 移除「关于本站」按钮与功能
- PublicLayout: 删除桌面导航/下拉菜单/页脚三处入口及空页脚,移除 about 导航类型与判断
- App: 移除 /about 路由及 AboutPage 引入
- 删除 pages/About 页面
- DocumentMeta: 移除 /about 的 meta 处理与 about 描述文案(中/英)
- i18n: 移除 aboutTitle / aboutIntro / footerAbout(中/英)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 00:59:06 +08:00
TerryM
15bcb6bdf0 feat: 相册下载胶囊自适应尺寸(随图块大小缩放)
- AttachmentDownloadPill 新增 adaptive 模式:用容器查询单位 cqw + clamp,
  尺寸随所在容器宽度缩放(图标框 22~30px、图标 13~18px、文字 10~12px)
- 相册图块设 container-type: inline-size 作为查询容器,小缩略图上的下载按钮
  自动缩小;单图/视频默认固定尺寸不受影响

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 00:52:23 +08:00
TerryM
d7e2e56cde ui: home carousel height lock + bubble polish
- Home: lock category carousel height to the tallest page so the
  Official Recommendations section below does not jump up when
  swiping to a page with fewer categories.
- CollapsibleText: raise default threshold to 25 lines and tighten
  the spacing between the expand-all button and the timestamp
  (drop the fixed h-8 and use mt-1 instead of mt-1.5).
- formatTime: always render dates as yyyy/m/d HH:mm regardless of
  locale, matching the requested timestamp format.
2026-05-30 00:43:54 +08:00
TerryM
c0068e957e feat: 文档预览图改方形放大,下载胶囊整体放大
- FileDocBubble 预览缩略图 52px 圆形 → 64px 方形圆角(rounded-lg),行高自适应
- AttachmentDownloadPill 放大:图标框 24→30px、图标 14→18px、文字 11→12px

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 00:43:27 +08:00
6249b14096 Merge pull request 'terry-media-adaptive-trial' (#10) from terry-media-adaptive-trial into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 25s
Reviewed-on: #10
2026-05-29 16:21:39 +00:00
TerryM
ad885f578c Merge origin/main into terry-media-adaptive-trial
Combine collapsible long-text (main) with adaptive image frame
(this branch). Resolved conflict in ImageWithTextBubble.tsx by
keeping both SingleImageFrame and CollapsibleText imports.
2026-05-30 00:17:10 +08:00
TerryM
b370bf756c ci: free disk space on self-hosted runner before each job
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 33s
Add a pre-checkout cleanup step that removes stale act caches,
old setup-node/npm cache entries, dangling docker resources, and
leftover /tmp files older than 2h. Prevents recurring ENOSPC
failures on the EC2 self-hosted runner.

Note: the very first run after this change may still fail if the
runner disk was already at 100% beforehand; one-time manual cleanup
on the host is required to bootstrap.
2026-05-30 00:10:39 +08:00
TerryM
f3c51725fb Merge terry-staging into main: 消息气泡长文字可展开/收起
Some checks failed
Deploy to Frontend Servers / deploy (push) Failing after 6s
2026-05-30 00:03:54 +08:00
TerryM
64a41359b4 style: 展开/收起按钮去掉背景胶囊样式,仅保留文字+chevron 2026-05-29 23:58:14 +08:00
TerryM
b283ba74da feat: 消息气泡长文字支持「展开全部/收起全部」折叠
- 新增 CollapsibleText 组件:超过 8 行文字自动折叠,按行高对齐裁切,底部柔和渐隐遮罩暗示有更多内容
- 折叠按钮左对齐,胶囊样式 + chevron 图标,hover 浅背景高亮,点击 chevron 旋转 180°
- 应用到全部 5 种气泡:Text/ImageWithText/Album/Video/FileDoc
- 动画统一使用 motion 包的 EASE_OUT 缓动,尊重 reducedMotion=user
- i18n 七种语言新增 showMore/showLess 文案
2026-05-29 23:49:59 +08:00
TerryM
471d29bec9 fix: 相册改用绝对定位百分比布局,彻底消除底部黑边
CSS grid + aspect-ratio 下 fr 行在部分浏览器不撑满,留出 bg-black。
改为 Telegram 同款:算法输出每块 {left,top,width,height} 百分比坐标,
图块绝对定位铺满容器。顺带修复竖主图在左时右侧堆叠图高度算错未填满列。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 22:56:20 +08:00
TerryM
789920d2b9 fix: 修复相册底部黑边(grid 用 aspect-ratio 时 fr 行不撑满)
aspect-ratio 单独作用在 grid 上时,容器高度对 fr 行属"非确定高度",
fr 退化为 max-content,行被压成内容高度,容器底部露出 bg-black。
改为:aspect-ratio + maxHeight 放外层 wrapper,内层 grid 用 absolute
inset-0 撑满,获得确定高度,fr 行正常拉伸,黑边消除。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 22:37:16 +08:00
TerryM
0035457c6d feat: 媒体流图片自适应显示(单图/2图/Telegram式相册)
- 单图气泡按真实比例显示:横图限高260px、过高裁上下;竖图完整铺满宽度不裁、无黑边
- 2张同类相册:都竖图左右并排、都横图上下堆叠,按比例不裁
- 3+张相册:Telegram式马赛克拼贴(竖主图占左+其余堆右 / 横主图占顶+其余排底)
- 图片比例优先用后端width/height,缺失时从加载后的naturalWidth/Height读取
- 新增 constants/media.ts 统一尺寸规范;albumLayout 纯算法附单测

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 22:16:55 +08:00
TerryM
a7792c117d fix: 资料流提早显现内容,避免空白缺口被误认为到底
Reveal 加 300px 前置 viewport margin,内容在进入视口前淡入;
无限滚动预加载触发线 200px → 1000px,下一页提前请求。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 19:04:31 +08:00
TerryM
b66c35be11 Merge terry-staging into main: format fix (PublicLayout)
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 21s
2026-05-29 18:19:58 +08:00
TerryM
33a466841c style: prettier 格式化 PublicLayout 以修复 format:check
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 18:19:08 +08:00
b4f9b5b304 Merge pull request 'terry-staging' (#9) from terry-staging into main
Some checks failed
Deploy to Frontend Servers / deploy (push) Failing after 12s
Reviewed-on: #9
2026-05-29 10:17:12 +00:00
3e68bb4334 Merge branch 'main' into terry-staging 2026-05-29 10:17:00 +00:00
TerryM
042635528a feat: 灯箱支持下载、底部缩略图居中、关闭后保留滚动位置
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 18:11:30 +08:00
TerryM
e04dd7dc2a fix: 修复相册缩略图无法显示(dev 代理 + 前端兜底)
- vite: /uploads 代理指向源站根而非 /apnew 前缀,relative thumbnailUrl
  (/uploads/thumb…) 在 dev 下不再落到 SPA index.html
- BubbleImage: 新增 fallbackSrc 候选链,缩略图加载失败时自动回退到绝对
  thumbUrl/url,全部失败才显示占位符
- AlbumBubble / ImageLightbox: 缩略图传入绝对地址作为兜底

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 17:59:33 +08:00
TerryM
4a097bad9d feat: 热门榜单移除预览按钮,仅保留下载
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 17:58:30 +08:00
TerryM
1f8772f645 feat: 相册点击直接进大图查看器,移除「选择图片」列表
- AlbumBubble: 点 +N 直接打开全屏查看器(从该图开始),删除中间的选择列表弹窗
- ImageLightbox: 底部加可滑动缩略图条(当前高亮+自动滚动定位),顶栏加下载按钮
- 下载按钮保证此前藏在 +N 列表里的图片仍可下载

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 17:50:53 +08:00
TerryM
b22ecc22ad feat: 首页「最新更新」桌面端统一为手机端竖向气泡流(responsive)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 17:49:58 +08:00
TerryM
db5da8a841 feat: 优先使用 thumbUrl 作为 PDF 封面大图 2026-05-29 17:42:37 +08:00
TerryM
54bdbbc0e9 feat: 点击 logo 在首页时 scroll to top 2026-05-29 17:27:54 +08:00
3fa0a3ccc2 Merge pull request 'terry-staging' (#8) from terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 22s
Reviewed-on: #8
2026-05-29 08:40:53 +00:00
TerryM
7eb2aa8b5b feat: 区块标题改回「热门资料」/ Popular assets
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 15:42:16 +08:00
TerryM
512fa53c2b feat: 首页热门区改为「社群常用资料」榜单(封面+名次,零数字)
- 新增 PopularRankList:前3名奖牌🥇🥈🥉 + 4·5灰序号,封面缩略图,
  类型·分类·更新时间,预览/下载按钮;与「最新更新」「官方推荐」版式区分
- 无封面时按资料类型渲染渐变+图标兜底(纯CSS),封面加载失败亦回退
- 分类名复用 cleanCategoryDisplayName,与全站一致(去掉括号后缀)
- i18n popularSection 改为 社群常用资料 / Community Favorites
- 新增后端接口契约文档 docs/specs/2026-05-29-popular-resources-section.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 14:53:52 +08:00
TerryM
cfae09a7d3 fix: make window the vertical scroller so back-to-top works
body had height:100% + overflow-x:hidden, which forces computed
overflow-y to `auto` — turning body into its own scroll box at viewport
height. window.scrollY then never moved, so the back-to-top button never
appeared and window.scrollTo was a no-op.

Apply overflow-x:hidden to <html> only; it propagates to the viewport
(still clipping horizontal overflow) while leaving the window as the
vertical scroller.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:30:44 +08:00
TerryM
4f6b4a498f fix: scope back-to-top to browse, speed up reveal, reset scroll on sort change
- BackToTop now only mounts on the /browse feed (covers all / latest /
  popular / search) instead of every route.
- Reveal animation duration cut 0.4s -> 0.25s so scrolled-in content
  appears faster.
- ScrollToTop also watches `search`, so switching between sort views on
  the same /browse path (e.g. 全部资料 <-> 热门资料) returns to the top.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:22:40 +08:00
TerryM
559c4f19c8 feat: image error placeholder + scroll-to-top on navigation
Image bubbles previously used the raw filename as alt text, so a failed
asset load exposed the file name in the broken-image box. Add a reusable
BubbleImage that renders an empty alt and falls back to a neutral
placeholder (ImageOff icon) on error; use it in the album, image, and
image-with-text bubbles, and drop the filename from their aria-labels.

Also add a global ScrollToTop that resets the window on route change so
desktop navigation matches mobile (e.g. clicking a category card no
longer lands at the bottom of the new page). Hash navigations are skipped
so #post-<id> deep-link scrolling still works.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:09:09 +08:00
TerryM
4464e6fdc5 fix: fall back to file icon when document thumbnail fails to load
Render the 52x52 preview with an empty alt and an onError handler, so a
broken thumbnail no longer shows the browser's broken-image box (which
leaked the raw filename) — it falls back to the file-type icon instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:08:16 +08:00
TerryM
b252fa113d feat: make entire recommended card clickable to jump to post bubble
Wrap the card in a stretched link overlay so clicking anywhere (not
just the title) navigates to /resource/:id and scrolls to the matching
bubble. Keep the download button above the overlay so it stays
clickable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:08:16 +08:00
87683293da Merge pull request 'style: apply prettier formatting to fix format:check' (#7) from terry-staging into main
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 21s
Reviewed-on: #7
2026-05-29 04:49:48 +00:00
TerryM
f73131dc03 style: apply prettier formatting to fix format:check
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 12:49:22 +08:00
bcd7395e77 Merge pull request 'feat: show attachment preview thumbnail in document bubble' (#6) from terry-staging into main
Some checks failed
Deploy to Frontend Servers / deploy (push) Failing after 11s
Reviewed-on: #6
2026-05-29 04:46:20 +00:00