feat(minapps): add proper region/language tags for all mini apps#12636
feat(minapps): add proper region/language tags for all mini apps#12636GeorgeDong32 wants to merge 16 commits intomainfrom
Conversation
7e41373 to
6ff80a3
Compare
1097d14 to
30b76e3
Compare
|
Note This issue/comment/review was translated by Claude. 📝 Code Review ReportThanks to @GeorgeDong32 for the contribution! This is a valuable feature. After review, I found the following issues: 🔴 Issues that need fixing1. Custom mini apps lack
|
| Item | Status | Description |
|---|---|---|
| Pinned mini app filtering logic | ✅ | pinnedApps correctly excludes region filtering, matching PR description |
| Type definitions | ✅ | MinAppType correctly defines the supportedRegions field |
| Region filtering logic | ✅ | CN users see all, Global users only see apps marked 'Global' |
| IP detection service | ✅ | Has timeout control, defaults to 'CN' on error (conservative strategy) |
| IPC channel | ✅ | App_GetIpCountry correctly added |
| Data flow design | ✅ | Redux stores all, Hook filters on read, merges on write |
🟡 Optional improvements
- Add logging: According to project guidelines, it's recommended to use
loggerServiceto log key operations (such as region detection completion)
📋 Testing suggestions
- Test whether custom mini apps are visible in Global environment
- Test whether pinned mini apps still display after switching regions
- Test the fallback behavior when IP detection fails
Overall assessment: The code architecture design is reasonable, the main issue is handling edge cases for custom mini apps. Can be merged after fixing.
/label ~"needs-fix"
Original Content
📝 Code Review Report
感谢 @GeorgeDong32 的贡献!这是一个很有价值的功能。经过审查,我发现以下问题:
🔴 需要修复的问题
1. 自定义小程序缺少 处理
文件:
自定义小程序加载时未保留 字段,导致它们会被视为 CN-only(根据 逻辑),Global 用户将无法看到自定义小程序。
建议修复:
✅ 正确实现的部分
| 项目 | 状态 | 说明 |
|---|---|---|
| 固定小程序过滤逻辑 | ✅ | 正确排除了地区过滤,符合 PR 描述 |
| 类型定义 | ✅ | 正确定义了 字段 |
| 地区过滤逻辑 | ✅ | CN 用户看到全部,Global 用户只 see 'Global' 标记的应用 |
| IP 检测服务 | ✅ | 有超时控制,错误时默认返回 'CN'(保守策略) |
| IPC 通道 | ✅ | 正确添加 |
| 数据流设计 | ✅ | Redux 存储全部,Hook 在读取时过滤,写入时合并 |
🟡 可选改进
- 添加日志记录: 根据项目规范,建议使用 记录关键操作(如地区检测完成)
📋 测试建议
- 测试自定义小程序在 Global 环境下是否可见
- 测试固定小程序在切换地区后是否仍然显示
- 测试 IP 检测失败时的回退行为
总体评价: 代码架构设计合理,主要问题是自定义小程序的边界情况处理。修复后即可合并。
/label ~"needs-fix"
|
Done |
🔍 Code Review: Mini App Region/Language Tags📋 SummaryThis PR adds proper region-based filtering for mini apps, replacing the previous locale-based approach. It introduces IP-based region detection and ensures pinned apps remain visible regardless of region settings. ✅ What's Good1. Clean Architecture
2. User Experience Improvements
3. Internationalization
4. Type Safety
|
| Aspect | Score | Notes |
|---|---|---|
| Architecture | 9/10 | Clean separation of concerns |
| Type Safety | 9/10 | Good TypeScript coverage |
| Testing | N/A | No tests added (consider adding) |
| Documentation | 7/10 | Good inline comments, some in Chinese |
| i18n | 10/10 | Comprehensive translations |
🚀 Recommendation: Approve with minor suggestions
The implementation is solid and addresses the user experience issues described in the PR. The region-based approach is more practical than the previous locale-based filtering.
Before merge, consider:
- Documenting the ipinfo.io token usage/limitations
- Verifying the
locales→supportedRegionsmigration doesn't break existing user configs
Reviewed with ❤️ by Claude Code
803beed to
f499c46
Compare
|
Done |
972a777 to
1330bb2
Compare
Ensure pinned mini-apps remain rendered even when region or locale filtering would otherwise hide them. Compute shouldShow as a union of visibility and pinned state, and use it to guard rendering, so pinned items stay accessible and pinned UI state is preserved (opened/active indicators) regardless of filters.
Co-authored-by: Phantom <eurfelux@gmail.com>
Co-authored-by: Phantom <eurfelux@gmail.com>
…sers - Add migration 194 to initialize minAppRegion setting to auto - Add defensive default value in RegionSelector component Fixes: Region selector showing placeholder instead of default value
1330bb2 to
b41c3f9
Compare
|
@0xfullex review needed |

What this PR does
为所有小程序添加了正确的地区(supportedRegions)和语言(locales)标签,并优化了过滤逻辑。
Before this PR
After this PR
Why we need it
Special notes for your reviewer
主要修改文件:
Release note
feat(minapps): 已添加所有小程序地区/语言标签,固定小程序不再受地区过滤影响