-
Notifications
You must be signed in to change notification settings - Fork 11
Release 20260103 修复 Chrome 100+兼容性、修复下载 modal 弹两次问题、修复相同CDK转移提示 #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 移除 scrollbar-gutter 改用 overflow-y: scroll 防抖动 - 移除 text-balance 类(需 Chrome 114+) - 为 mask-image 添加 -webkit- 前缀(需 Chrome 120+)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - 我在这里留下了一些整体反馈:
- 在
DownloadModalWrapper中,URL 清理使用了硬编码的/${locale}/projects?...路径;如果这个 wrapper 将来在其他路由中复用,会导致用户被意外导航回 projects 页面。因此建议不要硬编码,而是从当前路径派生(例如使用usePathname/window.location.pathname)。 - 在 CDK 转账页面中,
fromCdkHasSameError/toCdkHasSameError这两个标志位以及重新校验逻辑已经变得有些复杂;可以考虑添加一个小的辅助函数,把两侧的「相同 CDK」错误处理封装起来,这样可以减少重复代码,也让状态流转更容易理解。
给 AI 智能体的提示词
Please address the comments from this code review:
## Overall Comments
- In `DownloadModalWrapper`, the URL cleanup uses a hardcoded `/${locale}/projects?...` path; if this wrapper is ever reused on other routes it will unexpectedly navigate users back to the projects page, so consider deriving the current pathname (e.g. from `usePathname`/`window.location.pathname`) instead of hardcoding.
- In the CDK transfer page, the extra `fromCdkHasSameError` / `toCdkHasSameError` flags and revalidation logic have become a bit intricate; adding a small helper to encapsulate the "same CDK" error handling for both sides would reduce duplication and make the state transitions easier to reason about.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码评审。
Original comment in English
Hey - I've left some high level feedback:
- In
DownloadModalWrapper, the URL cleanup uses a hardcoded/${locale}/projects?...path; if this wrapper is ever reused on other routes it will unexpectedly navigate users back to the projects page, so consider deriving the current pathname (e.g. fromusePathname/window.location.pathname) instead of hardcoding. - In the CDK transfer page, the extra
fromCdkHasSameError/toCdkHasSameErrorflags and revalidation logic have become a bit intricate; adding a small helper to encapsulate the "same CDK" error handling for both sides would reduce duplication and make the state transitions easier to reason about.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `DownloadModalWrapper`, the URL cleanup uses a hardcoded `/${locale}/projects?...` path; if this wrapper is ever reused on other routes it will unexpectedly navigate users back to the projects page, so consider deriving the current pathname (e.g. from `usePathname`/`window.location.pathname`) instead of hardcoding.
- In the CDK transfer page, the extra `fromCdkHasSameError` / `toCdkHasSameError` flags and revalidation logic have become a bit intricate; adding a small helper to encapsulate the "same CDK" error handling for both sides would reduce duplication and make the state transitions easier to reason about.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses Chrome 100+ compatibility issues and fixes two key bugs related to download modal behavior and CDK transfer validation. The changes primarily focus on replacing CSS properties that have deprecated syntax with modern equivalents and refactoring the download modal logic to prevent duplicate triggering.
- Replaces Tailwind's
ring-*utilities withborder-*equivalents and updates opacity syntax frombg-opacity-*to slash notation (bg-black/25) for better browser compatibility - Extracts download modal logic from
ProjectCardViewinto a newDownloadModalWrappercomponent with a ref-based guard to prevent duplicate downloads - Adds dynamic re-validation logic for CDK transfer when the "same CDK" error is cleared by changing either input field
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/components/home/PlanCard.tsx |
Replaces ring-* classes with border-* classes for Chrome 100+ compatibility |
src/components/checkout/WaitForPayModal.tsx |
Updates backdrop opacity syntax from bg-opacity-25 to bg-black/25 |
src/components/checkout/QRCodePayModal.tsx |
Updates backdrop opacity syntax from bg-opacity-25 to bg-black/25 |
src/components/checkout/InAppBrowserWarningModal.tsx |
Updates backdrop opacity syntax and reorders CSS classes (top/right position) |
src/components/checkout/HtmlFormPayModal.tsx |
Updates backdrop opacity syntax from bg-opacity-25 to bg-black/25 |
src/components/ProjectCardView.tsx |
Removes download modal logic and related imports (moved to new component) |
src/components/OrderInfoModal.tsx |
Updates backdrop opacity syntax from bg-opacity-25 to bg-black/25 |
src/components/MultiStepLoader.tsx |
Extracts inline mask-image to a CSS utility class with webkit prefix |
src/components/LoadingState.tsx |
Removes text-balance and text-pretty classes for compatibility |
src/components/DownloadModalWrapper.tsx |
New component that encapsulates download modal with useRef guard to prevent duplicate triggers |
src/app/globals.css |
Adds webkit-prefixed mask-image utility class and changes scrollbar handling strategy |
src/app/[locale]/transfer/page.tsx |
Adds state tracking and re-validation logic to clear "same CDK" errors when inputs change |
src/app/[locale]/projects/page.tsx |
Imports and renders new DownloadModalWrapper component; removes text-balance and text-pretty classes |
src/app/[locale]/get-start/page.tsx |
Removes text-balance and text-pretty classes for compatibility |
src/app/[locale]/get-key/page.tsx |
Replaces focus:ring-1 with focus:shadow-[0_0_0_1px_#4f46e5] for Chrome 100+ |
src/app/[locale]/dashboard/LoginForm.tsx |
Removes text-balance class for compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- 使用 window.location.pathname 替代硬编码路径,提升组件复用性 - 将 <a> 改为 <button> 以支持键盘导航 - 移除未使用的 locale 变量
由 Sourcery 提供的摘要
将共享下载流程重构为独立的客户端封装组件,调整布局和视觉样式以获得更好的跨浏览器表现,并改进 CDK 传输校验的处理逻辑。
Bug 修复:
增强改进:
DownloadModalWrapper中,并在项目页面中使用。Original summary in English
Summary by Sourcery
Refactor the shared download flow into a dedicated client wrapper component, adjust layout and visual styles for better cross-browser behavior, and improve CDK transfer validation handling.
Bug Fixes:
Enhancements: