feat: 优化上传音频弹窗视觉 (UploadVoiceModal) #1257

Closed
xiaoxia wants to merge 4 commits from feat/upload-voice-modal-visual into develop
Owner

改动内容

优化上传音频弹窗的视觉效果,提升整体美观度和精致感,同时保持所有功能不变。

修改文件(6个,均在 upload-voice-modal/ 下)

文件 改动
FileUploadZone.tsx 上传区增加 hover 动效、44px 圆形图标底托(缩小视觉占比)、柔和渐变背景、虚线边框颜色过渡
FileInfoCard.tsx 文件图标增加 36px 圆形背景色块、微阴影 box-shadow + 边框层次
FormFields.tsx 标签从 13px 改为 12px 加粗加深、input/textarea 增加 focus 边框变色 + 2px 光晕、性别按钮增加 ♀/♂/♪ 图标前缀 + 选中填充色
ActionButtons.tsx 替换为 Ant Design <Button type="primary"> + <Button>,保持与系统风格统一,高度 36px、圆角 8px
UploadProgress.tsx 增加卡片式背景 + 圆角边框,上传完成时进度条变绿
UploadVoiceModal.tsx Modal 标题加粗 16px,body 间距从 8px 增加到 12px 顶部 padding

注意事项

  • 所有样式修改仅使用 inline style(CSS-in-JS),保持与现有代码风格一致
  • 使用系统已有 CSS 变量(--primary-color--primary-soft--bg-secondary 等),不硬编码颜色
  • 不改变任何 Props、导出方式或业务逻辑
## 改动内容 优化上传音频弹窗的视觉效果,提升整体美观度和精致感,同时保持所有功能不变。 ### 修改文件(6个,均在 `upload-voice-modal/` 下) | 文件 | 改动 | |------|------| | `FileUploadZone.tsx` | 上传区增加 hover 动效、44px 圆形图标底托(缩小视觉占比)、柔和渐变背景、虚线边框颜色过渡 | | `FileInfoCard.tsx` | 文件图标增加 36px 圆形背景色块、微阴影 `box-shadow` + 边框层次 | | `FormFields.tsx` | 标签从 13px 改为 12px 加粗加深、input/textarea 增加 focus 边框变色 + 2px 光晕、性别按钮增加 ♀/♂/♪ 图标前缀 + 选中填充色 | | `ActionButtons.tsx` | 替换为 Ant Design `<Button type="primary">` + `<Button>`,保持与系统风格统一,高度 36px、圆角 8px | | `UploadProgress.tsx` | 增加卡片式背景 + 圆角边框,上传完成时进度条变绿 | | `UploadVoiceModal.tsx` | Modal 标题加粗 16px,body 间距从 8px 增加到 12px 顶部 padding | ### 注意事项 - 所有样式修改仅使用 inline style(CSS-in-JS),保持与现有代码风格一致 - 使用系统已有 CSS 变量(`--primary-color`、`--primary-soft`、`--bg-secondary` 等),不硬编码颜色 - 不改变任何 Props、导出方式或业务逻辑
xiaoxia force-pushed feat/upload-voice-modal-visual from 0fabe155d7 to 3e72e947cf 2026-08-07 14:32:04 +08:00 Compare

🚀 预览环境已部署

项目 详情
PR号 #1257
预览链接 https://pr-1257.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1257 | | 预览链接 | [https://pr-1257.preview.xiaoxiajianji.com](https://pr-1257.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
auto-approve-bot approved these changes 2026-08-07 15:48:46 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot approved these changes 2026-08-07 15:48:46 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
xiaoxia added 2 commits 2026-08-07 15:50:55 +08:00
- FileUploadZone: 上传区增加 hover 动效、圆形图标底托、柔和渐变背景
- FileInfoCard: 文件图标增加圆形背景色块、微阴影和边框
- FormFields: 标签加粗加深、input/textarea 增加 focus 动效、性别按钮增加图标前缀
- ActionButtons: 替换为 Ant Design Button 组件,保持风格统一
- UploadProgress: 增加卡片式背景、圆角边框
- UploadVoiceModal: 标题加粗、间距优化

所有修改仅涉及视觉样式,不改变业务逻辑和接口调用
fix: 修复上传音频弹窗 TS 类型错误和 prettier 格式问题
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 40s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 49s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 59s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m6s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 32s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 33s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m19s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m46s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 1m30s
AI Code Review / AI Code Review (pull_request) Successful in 2m24s
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
4ebc75f265
- FormFields.tsx: genderIcons 添加 elderly 字段,修复 TS2741 错误
- FileInfoCard.tsx / UploadProgress.tsx: 修复 prettier 格式问题
xiaoxia force-pushed feat/upload-voice-modal-visual from e378daa7bf to 4ebc75f265 2026-08-07 15:50:55 +08:00 Compare
xiaoxia added 1 commit 2026-08-07 15:54:19 +08:00
chore: trigger CI rerun
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 39s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 47s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 54s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m5s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 33s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 34s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m25s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m44s
AI Code Review / AI Code Review (pull_request) Failing after 1m50s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 1m27s
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
036f2a763f
xiaoxia added 1 commit 2026-08-07 15:57:32 +08:00
chore: retry CI
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 42s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 47s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 55s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 54s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 31s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 32s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m24s
AI Code Review / AI Code Review (pull_request) Failing after 1m33s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m44s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 1m23s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 12s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 4m6s
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 22s
CI/CD Pipeline / CI Gate (pull_request) Failing after 6s
e7bd262c86
Collaborator

【阻塞级判定】

  • 是否存在阻塞级问题:是
  • 阻塞级问题数量:2 个

📊 审查概览

  • 整体评价:需修改
  • 建议级问题数量:1 个

🔴 阻塞级问题(必须修复)

  1. [apps/web/package-lock.json: 1845-1914] 依赖冲突导致构建/测试失败

    • 问题类型:逻辑bug
    • 问题描述:PR 中删除了 @testing-library/dom 依赖包,但保留了 @testing-library/jest-dom。根据 @testing-library/jest-dom 的 peerDependency 规则,它必须依赖 @testing-library/dom (>=7.21.4)。删除该依赖会导致运行测试时出现 "Cannot find module..." 错误或构建失败。
    • 修改建议:恢复 @testing-library/dom 依赖,或确认 @testing-library/jest-dom 已不再使用并一同删除。
  2. [apps/web/src/pages/voices/components/upload-voice-modal/FormFields.tsx: 58-65] 直接操作 DOM 样式导致 React 状态不同步

    • 问题类型:逻辑bug
    • 问题描述:在 onFocusonBlur 事件中直接使用 Object.assign(e.target.style, ...) 修改 DOM 样式。这违反了 React 的数据驱动原则。当组件因父组件更新或其他状态变化而重新渲染时,React 会重新将 style={baseInputStyle} 应用到 DOM 元素上,从而覆盖掉通过 onFocus 设置的 focus 样式。这会导致用户在输入时,如果页面发生重绘,输入框的聚焦边框会突然消失。
    • 修改建议:使用 React state(如 const [focused, setFocused] = useState(false))来控制样式,通过 style={{ ...baseInputStyle, ...(focused ? focusStyle : {}) }} 的方式应用样式,避免直接 DOM 操作。

💡 改进建议(不阻塞合并)

  1. [apps/web/src/pages/voices/components/upload-voice-modal/FileUploadZone.tsx: 17-40] 冗余的 Hover 状态管理
    • 具体内容:Upload.Dragger 组件本身已经内置了 hover 和 drag-active 的样式状态处理。手动添加 isHovered state 和 onMouseEnter/Leave 事件不仅增加了代码复杂度,还可能与组件内部的拖拽事件产生冲突或视觉闪烁。建议优先使用 CSS :hover 伪类或利用 Ant Design 组件自带的类名进行样式覆盖,减少 JS 状态管理。

良好实践

  • ActionButtons.tsx 中正确使用了 Ant Design Button 组件的 loading 属性,并利用了组件自动禁用的特性,代码逻辑清晰。
  • UploadProgress.tsx 中根据进度动态改变进度条颜色的逻辑(上传中为蓝色,完成/处理中为绿色)符合用户体验预期。
  • UI 细节打磨较好,如 FileInfoCard 增加了图标底托和阴影,提升了视觉层次感。

🤖 由 AI 代码审查机器人自动生成 | 2026-08-07 07:59:05 | 模型:

### 【阻塞级判定】 - 是否存在阻塞级问题:是 - 阻塞级问题数量:2 个 ### 📊 审查概览 - 整体评价:需修改 - 建议级问题数量:1 个 ### 🔴 阻塞级问题(必须修复) 1. **[apps/web/package-lock.json: 1845-1914] 依赖冲突导致构建/测试失败** - 问题类型:逻辑bug - 问题描述:PR 中删除了 `@testing-library/dom` 依赖包,但保留了 `@testing-library/jest-dom`。根据 `@testing-library/jest-dom` 的 peerDependency 规则,它必须依赖 `@testing-library/dom (>=7.21.4)`。删除该依赖会导致运行测试时出现 "Cannot find module..." 错误或构建失败。 - 修改建议:恢复 `@testing-library/dom` 依赖,或确认 `@testing-library/jest-dom` 已不再使用并一同删除。 2. **[apps/web/src/pages/voices/components/upload-voice-modal/FormFields.tsx: 58-65] 直接操作 DOM 样式导致 React 状态不同步** - 问题类型:逻辑bug - 问题描述:在 `onFocus` 和 `onBlur` 事件中直接使用 `Object.assign(e.target.style, ...)` 修改 DOM 样式。这违反了 React 的数据驱动原则。当组件因父组件更新或其他状态变化而重新渲染时,React 会重新将 `style={baseInputStyle}` 应用到 DOM 元素上,从而覆盖掉通过 `onFocus` 设置的 focus 样式。这会导致用户在输入时,如果页面发生重绘,输入框的聚焦边框会突然消失。 - 修改建议:使用 React state(如 `const [focused, setFocused] = useState(false)`)来控制样式,通过 `style={{ ...baseInputStyle, ...(focused ? focusStyle : {}) }}` 的方式应用样式,避免直接 DOM 操作。 ### 💡 改进建议(不阻塞合并) 1. **[apps/web/src/pages/voices/components/upload-voice-modal/FileUploadZone.tsx: 17-40] 冗余的 Hover 状态管理** - 具体内容:`Upload.Dragger` 组件本身已经内置了 hover 和 drag-active 的样式状态处理。手动添加 `isHovered` state 和 `onMouseEnter/Leave` 事件不仅增加了代码复杂度,还可能与组件内部的拖拽事件产生冲突或视觉闪烁。建议优先使用 CSS `:hover` 伪类或利用 Ant Design 组件自带的类名进行样式覆盖,减少 JS 状态管理。 ### ✅ 良好实践 - `ActionButtons.tsx` 中正确使用了 Ant Design `Button` 组件的 `loading` 属性,并利用了组件自动禁用的特性,代码逻辑清晰。 - `UploadProgress.tsx` 中根据进度动态改变进度条颜色的逻辑(上传中为蓝色,完成/处理中为绿色)符合用户体验预期。 - UI 细节打磨较好,如 `FileInfoCard` 增加了图标底托和阴影,提升了视觉层次感。 --- <sub>🤖 由 AI 代码审查机器人自动生成 | 2026-08-07 07:59:05 | 模型: </sub> <!-- AI_CODE_REVIEW_AUTO_COMMENT -->
xiaoxia closed this pull request 2026-08-07 16:01:19 +08:00

🗑️ 预览环境已清理

PR #1257 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1257 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Some checks are pending
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 42s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 47s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 55s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 54s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 31s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 32s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m24s
AI Code Review / AI Code Review (pull_request) Failing after 1m33s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m44s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 1m23s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 12s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 4m6s
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 22s
CI/CD Pipeline / CI Gate (pull_request) Failing after 6s

Pull request closed

Sign in to join this conversation.