9772ba88ae
fix(auth): 僵尸 JWT session 兜底 —— /api/me 返回 NOT_FOUND/UNAUTHORIZED 时自动登出
...
Build and Deploy / build-and-deploy (push) Successful in 3m54s
NextAuth 用 JWT 策略,cookie 签名不会因 DB user 被删而失效,
导致 dev 清数据后浏览器仍显示"已登录"但拉不到任何数据(假登录)。
useSyncMe 现在识别 /api/me 的 401/NOT_FOUND/UNAUTHORIZED 三种信号,
命中后调用 signOut({ redirect: false }) + reset(),把 UI 切回未登录态。
生产环境不会清 user,主要受益是 dev/staging 重置数据后无需手动清浏览器 cookie。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 17:05:50 +08:00
8b99c2f091
feat: 跨设备同步 + Logo v3 + 导航合并 + 窄屏适配 (v0.3.4)
...
Build and Deploy / build-and-deploy (push) Successful in 4m44s
- useSyncMe: 登录后拉 /api/me 用 votedArtists 覆盖本地 store,登出清本地
- Providers: SyncMeBridge 接入 SessionProvider
- Logo v3 替换登录页/弹窗/Footer 的旧 <Logo> 组件
- Footer 删除 logo,简化为版权行
- Navigation 删除 mobile 第二行 NavLinks,合并到第一行
- NavLinks 统一布局,响应式 gap+字号(gap-5 sm:gap-8 / text-[13px] sm:text-sm)
- HeroVoteProgress 窄屏(< md)隐藏 12 格点,只留文字
- scripts/screenshot-narrow.mjs 验证脚本(可配宽高)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 14:56:42 +08:00
5c009f38cd
fix(vote): 投票后立即 refresh ranking,不等 30s 轮询
...
Build and Deploy / build-and-deploy (push) Successful in 4m48s
- useVoteAction 加 onVoteSuccess 回调,服务端 200 立即触发
- page.tsx + ranking/page.tsx 传 live.refresh
- 顺手把 fire-and-forget 改成 await + 失败回滚 + /api/me 跨设备对齐
- store 新增 rollbackVote + hydrateFromServer 两个 action
体感:本地 30s → 700ms,生产 30s → 150ms
bump to v0.3.3
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 14:25:40 +08:00
10878ddb3f
feat(vote): 重构投票模型为终身 12 票 + 每艺人 1 票
...
Build and Deploy / build-and-deploy (push) Has been cancelled
前端:
- store 改为 votedArtists[] + zustand persist
- VoteModal 删除 1/3/5/ALL 选择器,改三态(待投/已投/满额)
- 卡片/排行/详情页加 hasVoted 状态 + ✓ 角标
- Hero 右上角 Countdown 替换为 HeroVoteProgress(12 格点亮进度)
- /me 改为终身额度叙事(QuotaCard / StatsGrid / MyFanSupport)
后端:
- votes 表加 @@unique([userId, artistId])(已 apply 到生产 RDS)
- /api/vote 重写:12 票上限 + P2002 ALREADY_VOTED + P2003 NOT_FOUND 兜底
- /api/me 新增 votedArtists[] + voteQuota,移除 dailyQuota
- 新增 ERR.ALREADY_VOTED 错误码
测试:
- DB 层 5/5 + E2E 18/18 通过(scripts/e2e-vote-flow.sh)
- 修复 P2003 FK 违反未识别的 bug
详情见 docs/todo/voting-refactor-完成报告.md 与 voting-refactor-backend-完成报告.md
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 20:14:57 +08:00
ed222d1c5f
feat(ui): scroll-aware nav glass + floating back button + hero polish
...
Build and Deploy / build-and-deploy (push) Successful in 5m17s
- Navigation: fixed + transparent over Hero (home) / at page top (other routes);
fades to glass-on-scroll. Glass uses surface tone matching site cards.
- Filter bar sticky glass synced to nav recipe (no seam between layers).
- HeroBanner: full-viewport video, center title removed, bottom dim overlay
removed, eyebrow/countdown repositioned below the nav.
- ArtistDetail: removed portrait shadow; added FloatingBackButton that uses
router.back() with internal-history fallback to /.
- Floating buttons (back + vote) translateY upward to avoid footer rather
than disappearing, via useFooterPush.
- Home: useScrollRestore preserves scroll position on return from detail
pages; temporarily disables scroll-snap during restore.
- PerformanceVideo: max-w capped by 85svh*16/9 so small viewports never crop.
- ArtistFilters: hide horizontal scrollbar thumb in tag container.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 12:25:54 +08:00
71a2672ff6
fix(data,ranking,ui): real dynamic ranking + data sync hardening
...
数据准确性
- 票数初始为 0,不再用 Math.sqrt 公式造假票
- 排序 tiebreaker 统一为 votes desc + no asc,确保稳定
- store.rank() 与 sortArtists() 行为对齐
Top12 / 出道位
- Top12Bar 仅收纳真正有票的人(votes > 0),0 票时显示"出道位尚未产生"空态
- ArtistCard / RankingRow / SearchModal / MyFanSupport / RankCard 的 inTop12 高亮全部加 votes > 0 守卫
- ArtistFilters 新增"实时排名 / 编号顺序"分段切换 + 首页 sortKey 状态
领奖台 (Top3Podium)
- 1 人有票即可显示领奖台(此前要求 >= 3 人才显示)
- 缺位的 #2/#3 用"虚位以待"占位卡片填充,与正式卡片同 3:4 比例对齐
- 全员 0 票时三张全部显示虚位以待
- 卡片间距拉大到 gap-8 sm:gap-12
排行榜页 (/ranking)
- API 票数与本地乐观投票取 max() 合并,避免 API 落后覆盖本地新票
- 合并后重新排序与赋 rank
- 仅 >= 12 人有票才显示出道线分隔与复活位标记
- 复活位 gapToDebut 计算修正
跨日额度
- selectRemaining 按 quotaDate 判断是否跨日,跨日自动回满额(此前会卡在昨日剩余值)
搜索 (SearchModal)
- 改为订阅 store 拿活的票数,投票后立即反映
- 默认"热门 Top12"只在真正有票时显示,否则降级为"推荐艺人 · 编号顺序"
- 票数显示统一走 formatVotes(0 票不再显示 0.0w)
人物详情
- 36 人真实数据接入,移除全部静态数据(slogan/birthday/cv/themeColor)
- 接入人物小传 docx 数据(年龄/身高/性格/口头禅/技能/赛道/座右铭/长简介)
- 视频区与版心同宽 + 首帧自动作为封面 + 整区点击播放/暂停 + 可拖拽进度条
- 表演图片改为三张氛围图竖向 3:4,左对齐
- 移除分享按钮,投票按钮全宽
个人页 (/me)
- 移除等级/邀请好友/签到/编辑资料等静态数据
- 退出登录按钮在移动端 icon-only 显示(此前 sm:hidden 导致移动端无法登出)
- 我的应援 list 基于真实 myVotesByArtist 派生,凯之类的投票真正同步过去
导航
- 余票徽章未登录态显示 0/0,已登录显示 N/10
- 登录/注册按钮样式与登录后头像胶囊保持一致(紫色实心)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 13:56:42 +08:00
d5ed43acbd
feat(ui): design overhaul, global login modal, design spec
...
- nav: center links (首页/排行榜/我的), right-side AuthMenu + RemainingVotesBadge; image logo with responsive sizing
- auth: replace /login route with global LoginModal triggered anywhere; "我的" intercepts unauth users with post-login redirect
- home: full-screen Hero, redesigned Top12 (12 pill cards, top-3 glow), scroll-snap mandatory between Hero/Top12/candidates
- home: candidates section with sticky filter that gains frosted-glass bg when stuck (matches nav)
- filter: simplified tags (全部/舞蹈/声乐/rap/全能型); ArtistCard uniform purple vote button
- ranking/me: remove Top12Bar; me header stacks 编辑资料/退出登录 vertically
- typography: font-logo set to Orbitron; ✦ glyph in CYBER ✦ STAR preserved
- layout: max-w-[1500px] unified across pages
- docs: add design-spec.md + design-spec.html with full visual spec (lucide SVG, zero emoji policy)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 18:59:30 +08:00
bd5a361a18
feat(vote): remove all voting limits (no daily quota, no per-artist cap, unlimited votes)
2026-05-12 14:15:50 +08:00
9fe9fa914f
fix(ux): center modals with overlay; live vote with toast; deterministic mock data; cascade layer fix
2026-05-12 14:09:31 +08:00
854a162109
feat(live): real-time ranking polling hook + LiveBadge, ranking page falls back to mock when API unavailable
2026-05-12 10:06:16 +08:00