浅念
cd8a3696e2
fix(embed): scroll freeze — pointer pause leaked when release happened outside window
...
Root cause: pointerup/pointercancel bound only on the viewport element; press on a photo then release outside the 195x280 window (or gesture interruption) never cleared the 'pointer' pause reason -> auto-scroll stopped permanently until page refresh.
- pointerdown now setPointerCapture (release guaranteed to return)
- window-level pointerup/pointercancel + blur fallbacks clear the reason
- rAF frame wrapped in try/catch so a single bad frame can no longer break the animation chain
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 16:57:04 +08:00
浅念
ae17776be6
feat(app): session restore on startup — no forced re-login after app restart
...
用户反馈:关闭 App 重开每次都要登录。根因:会话已持久化(安全存储,
服务端 TTL 30 天),但启动固定落在登录页——无人消费已存会话。
- _StartupGate(home):watch sessionAccount——在场直进 HomePage,离场
LoginPage;状态驱动(401/登出清会话后 gate 自动重建,不依赖导航时序)
- onUnauthorized 保留 push 兜底(home 路由被显式导航替换后的 401 场景)
- 测试适配(boot 401 两项重写通过;397/397 全绿)
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 16:48:27 +08:00
浅念
da6f1b282e
feat(embed): in-host photo detail modal + title overlay — e2e adapted (no popup, close button, some() heart attribution with ambient bubbles)
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 16:36:51 +08:00
浅念
985829fee8
fix(app): poster title truly left-aligned — Column crossAxisAlignment start (QR re-centered)
...
Text 的 textAlign 被 Column 默认 center 吞掉(文本行收缩包裹时对齐不生效);
文字区 Column 改 CrossAxisAlignment.start,二维码+扫码说明显式 Center 回居中。
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 16:30:14 +08:00
浅念
8834b1bbb9
feat(embed): album title overlay + in-host photo detail modal (replaces new-tab open)
...
- viewer: EmbedStream shows album title overlay top-left (ellipsis, avoids collapse zone); photo click posts open-photo {url} to host instead of window.open (direct-open still new tab)
- loader v2: open-photo message (origin+source whitelisted, URL must match widget origin) opens host overlay modal with embedded viewer deep-link iframe, close button/Esc/scrim dismiss, single instance, cleaned on destroy
- tests: click case asserts modal iframe deep link + no popup + close button dismiss; viewer 244 + loader 36 green
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 16:20:10 +08:00
浅念
5a207b395e
feat(app,viewer): WeChat card share + 'Share to...' label + site og tags
...
- 按钮文字「分享到微信/其他应用」→「分享到...」(用户需求)
- 微信卡片分享(fluwx 6):WECHAT_APPID 经 --dart-define 注入;已配置且
装微信 → WXWebpage 卡片(标题=相册名、描述=日期·地点、缩略图=封面压缩
240px PNG ≤32KB、点击进观众链接);未配置/未装 → 回退系统分享面板
- viewer index.html 加站点级 og 标签(微信/QQ 抓取链接预览用;每相册动态
og 需服务端注入,登记后续增强)
- 397/397 全绿、analyze 0
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 16:05:53 +08:00
浅念
2babd364ba
feat(viewer): hide like feature — action bar like slot, photo like badges, hot sort tab, others' like bubbles (user request 2026-09-23)
...
- PhotoFeed: cell like badge not rendered
- AlbumHeader: sort tabs row removed (hot depends on likes; latest-only has no toggle value)
- PhotoActionBar: like slot v-if=false (share/download remain, auto re-center)
- ActivityPage: LikeBubbles hidden
- specs updated to hidden assertions; 244 green
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 14:29:22 +08:00
浅念
85146be7ef
fix(viewer): restore lightbox close button styles orphaned by menu removal (transparent bg, white X icon, hover/focus)
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 13:48:03 +08:00
浅念
bdad433dae
fix(viewer): remove lightbox top-bar settings menu (user request) — close button + counter only; Esc closes directly
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 13:39:53 +08:00
浅念
903962a46b
feat(embed-slots): soft-delete slots — admin entry, ov shutdown via enabled=false snapshot
...
- 契约 deleteEmbedSlot(DELETE /admin/embed-slots/{id} → 204 幂等;admin 专属)
- cn schema:embed_slots.deletedAt(迁移 20260923120000,本地已应用)
- softDelete:乐观锁 claim + outbox slot.updated(payload enabled 强制 false
——ov 副本无墓碑,enabled=false 快照即公开端 404 下线;priority=high)+ audit
- 列表/加载/更新过滤 deletedAt → 同码 404
- Admin 列表操作「删除」(确认:已接入网站将停止展示、不可恢复)
- API 56/56、admin 87/87 + build 全绿
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 13:37:39 +08:00
浅念
f667842e9c
style(embed): ambient hearts denser and lower (user feedback — spawn 160-320ms, band 140-244px)
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 11:38:55 +08:00
浅念
d11ca16d1d
feat(embed): ambient heart bubbles — always floating in the right band (user request 2026-09-23)
...
- ReactionLayer ambient prop: self-scheduled spawn every 400-800ms (jitter), band 56-232px avoiding the 44px action zone, stops on hidden page/unmount, shares MAX_ACTIVE=8 with real bursts
- EmbedStream mounts layer with ambient = reactions && !reducedMotion — persistent decoration independent of real likes (no burst frames, no count inflation; §5.2 anti-fake semantics unaffected)
- viewer 244 green
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 11:30:53 +08:00
浅念
9761eea591
fix(embed): collapsed handle positioned correctly on first creation (v2 parity with v1 applyWrapperBox call)
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 11:24:47 +08:00
浅念
c2143e1f94
feat(app): album banner picker in edit form — show current banner, pick & upload on save
...
- api_client:uploadAlbumAssetFromFile 泛化(cover 为薄壳)+ fetchAlbumAssetUrl
(GET /albums/{id}/assets → 指定 kind 全局行 URL)
- 编辑页 Details:封面下方新增「宣传图」3:1 选择器——编辑模式异步加载现有
banner 预览(失败静默);保存成功后上传(同封面:失败不阻塞表单结果)
- 未保存变更判断纳入 banner;l10n zh/en
- 测试适配:编辑用例 pumpForm 后清空 banner 现状预检请求(397/397 全绿)
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 11:07:54 +08:00
浅念
3d45350711
feat(viewer): share sheet with QR code + link + copy (replaces inline toast, App-style)
...
- ShareSheet.vue: bottom sheet (mobile) / centered card (desktop) — QR canvas (qrcode dep), selectable deep link, copy with on-button feedback (2.5s), optional navigator.share button, Esc/scrim/close dismiss, focus on open
- AlbumHeader + PhotoLightbox: share buttons open the sheet (album URL / photo deep link); page-level copied strips removed
- tests rewritten for sheet behavior — viewer 244 green
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 11:04:11 +08:00
浅念
63b3e539fd
docs: register asset status acceptance — admin branding tab shows current banner/cover/logo
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 10:56:14 +08:00
浅念
2618ad3163
feat(assets): album asset status — show current banner/cover/logo in admin branding tab
...
- 契约 listAlbumAssetStatus(GET /albums/{albumId}/assets):每 (kind,locale)
最新 effective 行 + 现签 URL;权限同详情(可见即读);deleted → 404
- 服务端 AssetsService.status(createdAt,id DESC 组内取首;presignGet 现签)
- Admin 品牌资产页签改造:进入即加载现状——三种 kind 卡片(预览图/未设置
空态/设置时间),banner 分全局/zh/en 槽位;上传成功自动刷新(替换语义)
- API 56/56、admin 87/87 + build 全绿
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 10:51:53 +08:00
浅念
d678c8d38d
style(viewer): banner-wrap drops fixed aspect-ratio and placeholder bg (user edit)
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 10:42:03 +08:00
浅念
fd35c712a5
fix(viewer): remove topbar settings menu, keep locale switcher only (user request)
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 10:38:23 +08:00
浅念
aa78855657
fix(viewer): remove tap-more like hint from photo action bar (user request)
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-23 09:31:26 +08:00
浅念
8c4906c2f2
feat(embed,ui04): E07 acceptance — matrix completion, hostile-CSS hardening, measurements and record closure
...
- E07 e2e (7 cases): 4-viewport fixed size, narrow shrink + dual-slot 12px stack, single/static + empty state + two-photo loop copies, broken-thumb drop, reducedMotion stop with manual arrows, forged postMessage rejected, hostile CSS (!important box-sizing/border) with inline-important countermeasures + duplicate script dedup
- loader v2: geometry-critical properties upgraded to inline !important (beats host stylesheet !important)
- pre-existing fixes: likes.spec view-count assertion vs concurrent session's AlbumHeader unicode icons (toContainText); embed-v2 host port moved to 3998 (3999 collides with embed-crossorigin under parallel full runs); prettier formatting of two concurrent-session files (formatting-only)
- evidence: matrix EMB-A01..A16 closed in acceptance record (mechanism-level items honestly marked), measurements (loader v2 9885B/gzip 3959B, first-load 1 GET + 1 WS, DOM<=16), refreshed screenshots/recordings, master plan UI-04 note
- regression: root lint/typecheck/test 12 packages green; embed suites 43/43; admin embed-slots 5/5; journey pre-existing env failure reproduced at clean HEAD (registered)
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 18:56:38 +08:00
浅念
3bba8d1dc5
feat(admin,viewer,ui04): E06 management preview and v2 integration — real-component preview page, form mode fields, README
...
- viewer /embed-preview route: real EmbedStream with sample photography (picsum seeds), zero requests/WS (preview mode), postMessage config + simulated bursts through the real validation pipeline
- EmbedStream: preview prop (disables real WS subscription per §8.2 isolation) + exposed simulateBurst
- admin form: displayMode radio (new default), fixed 195x280 readonly, speed slider, reactions switch; v1 layout fields hidden in v2 (not silently effective)
- admin preview: v2 branch embeds the real preview iframe, white v2 handle, simulate-like tool button with sample-data note
- README-embed: v2 section (integration, hard sizing/docking, interactions/limits, artifact/version caching)
- tests: admin vitest 83 (+1 v2 placement), admin e2e 5 (v1 pinned carousel regression + full v2 chain incl. preview WYSIWYG heart and ov settings projection), viewer 244, v2 e2e 16
Note: part of the admin-side E06 changes (form/preview/utils/locales, mid-state of e2e spec) was swept into parallel commit eebf3b3 by a concurrent session's git add; this commit carries the final state of the remaining files and completes the set.
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 18:20:50 +08:00
浅念
91c85e196a
feat(viewer,ui04): E05 realtime hearts + effect-demo alignment (initial offset, heart params, decode gate, bidirectional manual scroll)
...
- reactions.ts pure fns: delta->hearts sampling, burstId dedupe (TTL/capacity), pending-visible cache (5s/50), 250ms emission throttle with merge
- useEmbedReactions: read-only RealtimeClient subscription on album.publicToken (no viewer-page side effects, A15), rebind teardown, 10s grace disconnect, no fake bubbles on WS failure
- ReactionLayer: demo-frozen heart effect (12/16/20 sizes, two colors, 110px rise, 1.6s ease-out, 300ms stagger, max 8, drop-shadow) in unscoped block (created elements lack scoped hash)
- demo alignment: initial offset 32px, decode+500ms startup gate, 1:1 drag, arrows +-40, focus-tip, bidirectional manual scroll (manualScroll), loader handle 100x44 exact styles, <=599px offset default 12
- tests: +8 reactions unit (244 viewer), e2e E05: real cross-context like -> heart on correct photo (EMB-A09), zero likes/visits submission (EMB-A15), 16s hearts recording
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 17:38:02 +08:00
浅念
f193e4f085
fix(viewer): remove extra closing brace in AlbumHeader CSS
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 13:59:14 +08:00
浅念
b353a3de06
fix(viewer): replace text arrow share icon with SVG share glyph
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 13:55:37 +08:00
浅念
900ff2a74d
feat(viewer): refine visual details to match design reference
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 13:49:15 +08:00
浅念
3912279889
feat(viewer,ui04): E04 interactions — pause reason set, click lock/drag cancel, manual scrub, keyboard semantics, destroy
...
- pauseReasons Set (hover/focus/pointer/offscreen/hidden/manual + userPaused via Space, no auto-resume); 500ms transient resume with re-evaluation
- pointerdown target lock; >8px drag suppresses click and scrubs via nudgeOffset (window-clamped); removed photos clear pending target
- keyboard: Space pause toggle, Escape collapse, ArrowUp/Down scrub; input fields untouched
- aria-live status announcements (zh/en); viewport touch-action none
- e2e: hover freeze/resume, popup deep link hit, drag cancel, keyboard, slot disable destroy
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 13:28:13 +08:00
浅念
998565e439
feat(viewer,ui04): E03 continuous scroll engine — pure state machine, rAF orchestration, boundary continuity
...
- stream.ts: advanceStream (per-frame, dt cap 50ms), loop generation keys, window math (DOM<=16, queue<=30, 480px buffer), anchorRebuild (photo-position preserving), removePhoto, single-photo static
- useVerticalPhotoStream: rAF integration, direct transform writes (no per-frame Vue reactivity), low-frequency item sync, ResizeObserver re-anchor, stepForTest hook
- EmbedStream wired to engine; cycle copies aria-hidden; img error -> controlled drop
- tests: 14 unit cases (236 viewer total), e2e: 32px/2s speed, boundary continuity <2.5px, DOM<=16 over 20s, 32s recording with loop boundaries
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 13:19:21 +08:00
浅念
1d1979f540
feat(viewer,ui04): E02 static fidelity — real photo fixtures, measured shell/photo/collapse specs, edge fade
...
- fixtures: 8 picsum-seeded real photos (mixed ratios); seedPhoto thumbBytes/browseBytes injection
- e2e E02 block: wrapper shell (195x280/radius/border/#10161E), photo strip (193w, ratio-height, 3px gap), collapse (44/44 hit, 24 visual, sole button), desktop+mobile screenshots
- EmbedStream: top/bottom 12px dark fade (0.12, §2.3 optional item)
- fix(admin): pre-existing eslint globals gap for ElNotification (template drift, blocks lint gate)
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 13:01:34 +08:00
浅念
66d1eb3e9f
feat(embed,ui04): E01 v2 contract skeleton — displayMode/scrollSpeed/reactionsEnabled, v2 loader entry and fixed 195x280 shell
...
- contracts: EmbedSlotSettings optional v2 fields (carousel default) + SlotSettingsPayload; gen + redocly green
- api: DTO validation + normalization full-set (cn manage + ov public projection share normalizeStoredSettings)
- embed-loader: params v2 parse/merge/url family, loader-v2.js fixed shell (border/radius/#10161E/safe-area, resize ignored, stack gap 12), dual-artifact build+sync; v1 source frozen
- viewer: EmbedPage v=2 branch, EmbedStream (viewport/track/real anchors/collapse/empty), stream.ts pure fns, i18n zh/en
- admin: types + utils (create default vertical-stream, clampScrollSpeed, v1/v2 snippet selection)
- tests: loader 36 (+9 v2), viewer 222, admin 82, api unit 51, v1 embed e2e 20, v2 E01 gate 2 (195x280 desktop+mobile cross-origin, no footer)
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-22 12:50:28 +08:00
浅念
2a489aa16a
docs: UI-02 acceptance record and visual verification
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-21 23:10:58 +08:00
浅念
160e7e5f1a
feat(viewer): UI-02 heart particles, interaction notices, share and download
...
Task 5 (V05 §5.4/§6): decorative heart particles on the lightbox stage
(local like clicks + others' WS bursts for the current photo), compact
cross-photo interaction notices above the action bar (click to locate),
navigator.share-first share orchestration with clipboard fallback for
album and photo deep links (lang param), and download failures attributed
to the photo that triggered them. Self-echo dedup stays in the realtime
router (own batches never produce particles/notices); particles cap at
12 with visibility/unmount cleanup and are suppressed under reduced
motion; notices cap at 3 with ~4s auto-dismiss and throttled SR summary.
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-21 22:20:19 +08:00
浅念
89f45896b7
feat(viewer): UI-02 dark immersive photo viewer with thumbnail strip
...
V04 (方案 §5):PhotoLightbox 模板重构为深色沉浸布局——顶栏(关闭/位置
计数/⋯ 减少动画菜单)+ 舞台(contain 大图 + 边缘 ‹› + 粒子/互动占位层)+
缩略图条 + 底部操作栏;业务逻辑(序列导航/缩放手势/签名刷新/下载/点赞)
原样保留。
- 新增 viewer/position.ts:§5.2 位置计数真实回退(solo→照片预览;无
total 未到末页→已加载 N 张;全部加载→i/n;不伪造总数)
- 新增 ThumbnailStrip:当前 ±3 窗口(≤7 项)、主色 2px 描边、thumb 变体、
滚入可见(遵守减少动画)、点击选择不新增历史
- 新增 PhotoActionBar:Like(coral 心形+计数+连续点赞提示)/Share/
Download 均分大触控;下载关闭整项移除;原图二级菜单(▾ + 长按)
- 模态可用性:body 滚动锁、焦点进入/困住/归还触发元素、Esc 先收菜单、
菜单内左右键不抢占、dvh + 安全区、chrome 区手势/滚轮隔离
- 分享 V04 最小实现(复制当前深链,support/clipboard 从 AlbumHeader
提取共用);navigator.share 编排属 Task 5
- zh-CN/en 新词条;vitest 新增 23 例(位置回退/缩略图/操作栏/焦点/滚锁)
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-21 21:58:09 +08:00
浅念
3d89fcdb99
feat(viewer): UI-02 responsive waterfall with like badges
...
Task 3 (V03 瀑布流重排, 方案 §4.3):
- responsiveColumns 断点:<600px 双列 gap4 / 600-959px 三列 gap6 / ≥960px 四列
gap8;PhotoFeed 经既有 ResizeObserver 容器测量整体重排
- 照片卡片去卡片化:图片边到边 + 4px 圆角,无白色厚包裹/无常驻文件名;
右下角点赞角标(半透明暗底渐变、白心 16px、12px tabular-nums 计数),
@click.stop 独立交互不冒泡开大图;计数经 Intl 分组
- 新照片提示改白色 pill(viewer.newPhotos,接口仅 hasNew 不伪造数量);
refreshFromHint 不再强制回顶(用户浏览位置保持)
- 首屏骨架按 skeletonSources 竖/横/方比例走真实瀑布流放置(非均匀网格);
宽高缺失/NaN/Infinity 回退 4:3 安全比例(无 NaN/无限高度)
- 保留懒加载 IO、游标分页、photoId 稳定键、翻页失败底部重试与已到底文案
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-21 21:34:56 +08:00
浅念
9c3915b387
feat(viewer): UI-02 visual foundation, top bar and album info
...
V01+V02 (Task 2 of the UI-02 viewer redesign plan):
- viewer-tokens.css: UI-02 §3.1 design tokens scoped to .viewer-shell
(never :root), so embed routes consume none of them
- App.vue: normal routes get a sticky white top bar (PhotoLive brand +
compact locale switcher + lightweight "..." menu holding the
reduce-motion toggle); global 16px content padding removed so banner
and photos run edge-to-edge; embed shell branch untouched
- LocaleSwitcher: compact "EN/中文 + caret" trigger with a proper menu
(current language checked), 44px touch target, Escape/outside close
- AlbumHeader (new): banner (2.4:1 mobile, 320px desktop cap,
object-fit contain, collapses on missing/failed), 2-line expandable
title + share button (clipboard copy with selectable-text fallback),
3-line expandable pre-line description, meta row (Intl-formatted
view count with em-dash fallback for unknown, album-timezone dates
with full range on title, venue), Latest/Popular 44px tabs and
category pills from the API with horizontal scroll + overflow fade
- ActivityPage: delegates the info area to AlbumHeader; sequence
reset/sort-lock/category-by-id semantics unchanged; desktop content
capped at 1120px
- i18n: viewer.* strings (brand/share/views/readMore/latest/popular/
allCategories/noPhotos/newPhotos/reduceMotion/settings) in zh-CN+en
- tests: viewer-shell (token source + normal/embed isolation) and
album-header (8 cases) specs; activity/i18n specs updated for the
menu switcher and the em-dash unknown view count; e2e selectors
refreshed
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-21 21:22:36 +08:00
浅念
ddf26a177f
feat(embed,viewer): UI-01 complete carousel, loader config and accessibility
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-21 18:55:15 +08:00
浅念
7385785504
feat(i18n): T15 full-stack language audit with coverage assertions
...
- viewer/admin 错误码→文案映射按契约 ErrorCodes 枚举全集登记(机器守护
spec 遍历枚举断言无缺漏 + 映射键在 zh/en 词条均存在 + locale 键集
递归相等);mobile 镜像补齐 DOWNLOAD_DISABLED(P4a 增补漏登)
- 漏译修复:viewer.photoRemoved en 侧缺失(审计测试捕获);
DOWNLOAD_DISABLED 观众侧专属文案 + useDownload 专属提示接线;
admin apiMsg 增 RATE_LIMITED/ALBUM_NOT_PUBLIC/DOWNLOAD_DISABLED/
SYNC_AUTH_FAILED 四码词条
- 运行时抽查:admin 主旅程 en 版 e2e(登录→相册管理全英文 + 偏好
持久);embed iframe lang=en 渲染与深链跟随 e2e(zh 侧既有用例覆盖)
- contracts 新增 ./errors 浏览器安全子路径(errors.ts 纯 TS);
admin 增 @photo/contracts devDep(仅测试消费)
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-20 23:44:27 +08:00
浅念
8f2c21d25a
feat(viewer): embed carousel iframe with visibility pause
...
P4b Task 4:宿主 loader 以 iframe 载入的轮播页(/embed/:slotToken,裸布局)。
- src/embed/feed.ts:纯函数集——A22 旧响应裁决(dispatch seq + configVersion
双闸:过期/回看丢弃、等值差分合并、升值全量重置)、照片队列差分(新照片
追加队尾、缺席淘汰、thumb 签名刷新)、interval/高度夹取、轮询退避;
- src/embed/useEmbedFeed.ts:取数编排(If-None-Match → 304 零处理)、轮询
(查询 interval 覆盖 → EMBED_POLL_INTERVAL_MS,连续 5 失败 ×5 退避,成功
归零;404/410 静默 collapse 隐藏自身)、A23 不可见暂停(document 隐藏 +
IntersectionObserver 滚出视口 + 本地收起;恢复立即校准)、轮播 intervalMs
切换;__embedPollMs e2e 注入点;
- src/embed/postMessage.ts:上行 resize/collapse(referrer origin 收敛,缺失
退 '*'——载荷无敏感数据,宿主侧 loader source+origin 双校验)、下行 expand
(event.source === window.parent 白名单);
- EmbedPage.vue:交叉淡入淡出(仅 thumb 小图省流量)、点击 window.open 单图
深链(noopener)、计数圆点、「照片即将上线」空态卡、×收起;lang 查询
(auto→相册 defaultLocale)驱动嵌入词条子集;
- api client:fetchPublicEmbedSlot(304/ETag 分支,不走 apiRequest);
- e2e:宿主夹具页 public/__test__/embed-host.html(仅测试资产)+ embed.spec 7
用例(轮换/新标签深链/收起记忆/窄屏 sm/轮询增量/换绑重置/空态/幽灵槽);
helpers 增展示位 admin API 种子 + flushOutbox;
- vitest 18 用例(裁决矩阵/队列差分/夹取/退避/304/可见性状态机)。
配套修正:api CORS exposedHeaders ETag(跨源浏览器可读,304 语义成立);
contracts 新增浏览器安全子路径 ./constants(根出口 re-export internal-sync
的 node:crypto 会打进浏览器包);eslint ignore embed-loader 产物拷贝
(Task 3 起 viewer lint 红,先修)。
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-20 23:02:07 +08:00
浅念
ddb4c8175f
feat(embed): versioned loader with postMessage whitelist
...
packages/embed-loader:手写零依赖加载器(esbuild bundle+minify→dist/v1/loader.js,
IIFE target es2018 4.7KB)。自发现 EMBED_ORIGIN(currentScript 兜底扫描)、
data-slot 必填缺失静默 no-op、__photoliveEmbedV1 标记去重+同槽去重、
窄屏 <480px 强制 sm+默认收起、postMessage 双向白名单(source+origin 严格
校验,resize 夹取 60-640)、sessionStorage 收起记忆、零全局零 console
全静默。sync 脚本携 sha256 校验拷贝至 viewer publicDir(两份产物入库);
src/params.js 为 loader/单测共用参数源(11 vitest 用例)。
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-20 22:31:40 +08:00
浅念
2bb6f291d3
feat(ov,viewer): two-tier download with wechat guidance
...
P4a Task 4(T12 收口):ov 域公开照片下载端点 + viewer 下载 UI。
- interactions 增 downloads:GET /public/albums/{token}/photos/{photoId}
/download?variant=browse|original。两级开关(A18):browse 需
downloadEnabled;original 需叠加 originalDownloadEnabled(级联,browse 关
则两者均 403 DOWNLOAD_DISABLED)。水印相册 browse 现签 watermark pattern
key(browse-key 解析抽取 shared/ov-browse-key 与 public-ov 复用);原图
现签 originalObjectKey(SIGNED_URL_TTL)。来源 IP 固定窗限速
(DOWNLOAD_WINDOW_REQUESTS/DOWNLOAD_WINDOW_SECONDS,env 可调);零浏览
计数写入(排除规则)。STORAGE_PORT_OV 经新 StorageOvModule 与 public-ov
共享同一实例。
- 契约微调登记:PublicAlbum 增 readOnly 必返 downloadEnabled/
originalDownloadEnabled(cn+ov 同形返回;public e2e 精确键断言同步)。
- viewer:lightbox 下载入口随开关渲染(无/单按钮/分体菜单两选项)、过期
凭证静默重取一次、微信内置浏览器(MicroMessenger UA)出保存图片指引
浮层(复制深链 + 反馈)替代直接下载;i18n zh/en 词条。
- tests:api e2e +7(开关矩阵 + URL/字节级断言、水印键一致、隐藏 404、
限速 429、零计数行);viewer vitest +9(UA/矩阵/菜单/重取/失败/指引/
复制);viewer Playwright +3(入口矩阵、微信 UA 浮层、真实端点 200 +
签名 URL 模式)。
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-20 18:32:34 +08:00
浅念
cdead49838
feat(viewer): likes, bubbles, visit reporting and hot sorting
...
Task 10 viewer 互动化:
- 点赞:useLikes 批次状态机(500ms 防抖 / 5 次满额即冲 / 失败同 batchId
退避重试 3 次后回滚丢弃),乐观计数 + 服务端 total 权威校准
(countVersion 单调),大图与格子双入口;
- WS 实时:RealtimeClient 纯状态机(半频心跳、指数退避重连、三败降级、
重连成功 resync 第 1 页重取),消息路由器做 likes.burst 自身过滤
(originBatchIds 求交)、隐藏页暂停与减少动画下仅校准不出气泡;
photo.hidden/deleted 即时移出序列并回退邻居大图;降级后 8s 轮询接管;
- 浏览上报:visitorId 跨标签 BroadcastChannel first-writer-wins 协调,
可见时上报、requestId 持久幂等、网络失败指数重试;
- 排序:最新/热门 chips(热门走 ov 冷快照),大图打开期间禁用切换;
顶栏「减少动画」偏好开关;
- 契约包新增 ./realtime 子路径出口(浏览器面不可引桶出口——其连带
internal-sync 的 node:crypto 会被 Vite 外置化致整页崩溃);
- e2e 注入钩子 __viewerWsUrl/__viewerWsRetryBaseMs/__viewerRealtimePollMs/
__viewerBubbleMs 与 .activity[data-connection] 连接态锚。
vitest:viewer 105(新增 36:likes 批次 8、visitor 协调 5、上报门控 4、
路由 8、WS 状态机 7、排序 4);Playwright:viewer 21(新增 likes.spec 7、
journey 补互动腿断言)。
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-18 19:52:27 +08:00
浅念
0fcf18cc5c
feat(ov): public read api on replicas with hot sorting
...
P2 Task 6(ov 公开读 API + viewer 切换):
- ov 装配 PublicOvModule(仅 app-ov.module):/public/albums/{token}、
/photos、/photos/{id} 三端点同契约读 ov 副本——translations/categories
自 JSON 列解析(防御性过滤),banner 经 ov 侧 STORAGE_PORT_OV 预签名
(同本地 MinIO;只读属约定,真实 OSS 只读凭证 P5),viewCount 取
album_stats 权威累计(无行默认 0;计数端点 Task 8 接线)
- 排序:latest=发布时间 keyset(shared/cursor.ts 同 cn);hot=likeTotal
desc + photoId desc 决胜,顺序按 `${albumId}|${category}` 短期快照
(内存 TTL 默认 30s,HOT_SORT_TTL_MS 惰性读取)——计数逐请求现读、
顺序冻结窗口内一致,偏移游标(base64url 整数)在快照内严格稳定;
非法 sort 400 VALIDATION_FAILED(cn 不感知该参数)
- 契约:viewCount 放宽为 integer|null(cn null、ov 权威值);
listPublicPhotos 增 sort 枚举(latest|hot,缺省 latest);
PhotoPublishedPayload 增 categoryId——补上 Tasks 3/4 管线缺口
(payloads/publish.service/sync-inbox 投影 + 关联测试随改)
- e2e(services/api/test/public-ov.e2e-spec.ts,7 用例):双入口同进程
起 cn+ov,cn API 种子→真实发送管线投递;断言相册/列表/单图与 cn
深等(仅签名 URL 剔除)、banner 真字节、参数矩阵 400/404、hot 排序
TTL 内快照(计数新/顺序旧)+TTL 过期翻转+偏移翻页、隐藏/下线/紧急
停用逐态撤下
- viewer 切 ov:API 基址 VITE_API_BASE(缺省 http://127.0.0.1:8081 ,
空串=同源网关;Vite 只读 apps/viewer/.env*,根 .env 对前端无效),
移除 /v1 dev 代理(CORS_ORIGINS 增 127.0.0.1:5175 直连两形);
playwright webServer 增 dev:ov;e2e 夹具 flushSync(albumId)=cn
bootstrap 快照 + deliverPendingOnce(sender 新导出)经真实管线投影
种子,deleteSeededPhoto 改软删让墓碑可同步;14 个 Playwright 全绿
(journey 管理/staffB 腿仍走 cn 8080)
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-18 17:05:56 +08:00
浅念
40f8f37ca4
test(e2e): p1b cross-frontend playwright journey
...
- viewer playwright.config: third webServer boots admin dev (5176,
reuseExisting) so one config serves both frontends
- journey.spec.ts: admin UI (login, zh+en album, real-jpeg banner via
file chooser, category, staffB invite by account search, logout) ->
staffB API uploads x3 (init/presign-PUT/complete) -> worker
PublishService.processPhoto x3 -> public list verify -> viewer UI
(banner bytes, zh->en switch, waterfall 3, chip filter 1, lightbox
zoom/close, deep link) -> admin hide -> viewer 2 + hidden deep-link
404 notice -> empty album state
- cleanup: journey album domain rows + staffB account via Prisma
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-18 12:54:18 +08:00
浅念
90fe64f637
feat(viewer): photo viewer with zoom, navigation and deep link
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-18 11:04:05 +08:00
浅念
d0b79dd0c9
feat(viewer): waterfall feed with lazy load, filter and new-photo hint
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-18 10:23:27 +08:00
浅念
adc45b1563
feat(viewer): album page with locale fallback and timezone display
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-18 09:52:22 +08:00
浅念
04b5641901
chore(viewer): move dev ports to 5175/5176 (user decision; avoids cms project conflict on 5173)
...
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-18 09:18:27 +08:00
浅念
f9cb72ed06
feat(viewer): vite vue3 scaffold with routing and i18n
...
- apps/viewer (@photo/viewer): Vite 5 + Vue 3.4 + TS 最小骨架(无 Pinia/UI 库)
- router: /a/:token 活动页 + /a/:token/p/:photoId 单图深链(复用活动页组件)
- i18n: vue-i18n 9,zh-CN/en 词条,localStorage(viewer.locale) 持久 +
navigator.language 检测兜底 zh-CN;顶栏语言切换组件;文案全量走 i18n
- api client: 类型化 fetch 封装(契约生成类型直连),错误信封 → ApiError,
错误码 → i18n key 映射表(src/api/errors.ts)
- scripts: dev/build/preview/test(vitest 10 例)/test:e2e(Playwright 冒烟,
webServer 自拉 dev)/lint/vue-tsc 全部接入 turbo
- root: +@playwright/test、+eslint-plugin-vue(flat config 收敛到 apps/**/*.vue)、
pnpm.onlyBuiltDependencies 放行 esbuild
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-18 09:12:45 +08:00