Commit Graph

379 Commits

Author SHA1 Message Date
tinkle-community 9927ede8fd Merge pull request #491 from Yihen-Liu/main
Updates dependencies and ignores files
2025-11-05 16:04:30 +08:00
tinkle-community 16334ca5c5 Merge pull request #505 from 0xEmberZz/fix/web-ui-display-issues
fix: resolve Web UI display issues (#365)
2025-11-05 15:59:52 +08:00
Ember 3ac5a694df refactor: extract repeated star formatting logic
- Extract formattedStars calculation to avoid duplication
- Keep tabular-nums span for consistent number width during animation
- Address code review feedback from @xqliu
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-05 13:58:34 +08:00
Ember c61f57e49e fix: resolve Web UI display issues (#365)
## Fixes
### 1. Typewriter Component - Missing First Character
- Fix character loss issue where first character of each line was missing
- Add proper state reset logic before starting typing animation
- Extract character before setState to avoid closure issues
- Add setTimeout(0) to ensure state is updated before typing starts
- Change dependency from `lines` to `sanitizedLines` for correct updates
- Use `??` instead of `||` for safer null handling
### 2. Chinese Translation - Leading Spaces
- Remove leading spaces from startupMessages1/2/3 in Chinese translations
- Ensures proper display of startup messages in terminal simulation
### 3. Dynamic GitHub Stats with Animation
- Add useGitHubStats hook to fetch real-time GitHub repository data
- Add useCounterAnimation hook with easeOutExpo easing for smooth number animation
- Display dynamic star count with smooth counter animation (2s duration)
- Display dynamic days count (static, no animation)
- Support bilingual display (EN/ZH) with proper formatting
## Changes
- web/src/components/Typewriter.tsx: Fix first character loss bug
- web/src/i18n/translations.ts: Remove leading spaces in Chinese messages
- web/src/components/landing/HeroSection.tsx: Add dynamic GitHub stats
- web/src/hooks/useGitHubStats.ts: New hook for GitHub API integration
- web/src/hooks/useCounterAnimation.ts: New hook for number animations
Fixes #365
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-05 13:32:13 +08:00
Ethan fb1c093b68 Updates dependencies and ignores files
Updates dependencies by replacing ioutil with io.
Adds .tool-versions and web/yarn.lock to .gitignore.
2025-11-05 11:29:23 +08:00
SkywalkerJi 272e830707 fix the main branch history issue from November 3rd.
Merge pull request #395 from NoFxAiOS/beta
fix:fix the main branch history issue from November 3rd.
2025-11-04 13:00:05 +09:00
Icyoung 2affa0ae62 Merge pull request #361 from Icyoung/beta
Beta bugfix
2025-11-04 02:14:54 +08:00
icy 4c74465075 Add NOFX watermarks to charts and fix empty state internationalization
- Add NOFX watermark to ComparisonChart (competition page)
- Add NOFX watermark to EquityChart (dashboard page)
- Fix empty state handling and internationalization in CompetitionPage
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 02:08:38 +08:00
icy da1ac71828 Fix ComparisonChart data display issue
The chart was not showing data because the API response format changed.
Fixed the calculation of PnL percentage by computing it from total_pnl
and balance values (initial_balance = balance - total_pnl).
Now the AI competition chart should properly display performance comparison data.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 01:54:21 +08:00
Icyoung ea374d2311 Merge pull request #359 from Icyoung/beta
Beta Merge dev、Bug fix
2025-11-04 01:50:34 +08:00
icy c28ca79d7a Merge branch 'dev' into beta 2025-11-04 01:45:21 +08:00
icy 3a38c1bf56 Merge branch 'dev' of https://github.com/tinkle-community/nofx into dev 2025-11-04 01:45:15 +08:00
icy c264775809 Remove all test dependencies and configurations
- Removed test script from package.json
- Removed testing dependencies (@testing-library/react, vitest, jsdom)
- Deleted test directory and vitest.config.ts
- Updated package-lock.json to reflect changes
- Build still works perfectly without test dependencies
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 01:44:40 +08:00
icy c941c078ca Remove unused test files
Removed App.test.tsx and AITradersPage.test.tsx that were causing TypeScript build issues and are not currently in use.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 01:43:02 +08:00
Luna Martinez e07dc1d2fa Merge pull request #323 from zhouyongyou/fix/go-vet-warnings
fix: resolve go vet warnings for non-constant format strings
2025-11-03 12:42:46 -05:00
icy 6d1efcf54a Fix TypeScript build error
Removed unused 'Zap' import from App.tsx that was causing build failure.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 01:42:25 +08:00
Luna Martinez 18ca6fd213 Merge pull request #329 from zhouyongyou/chore/peer-dependency-markers
chore(web): add peer dependency markers to package-lock.json
2025-11-03 12:39:24 -05:00
icy 8e76be5a29 Resolve merge conflicts with dev branch
Resolved conflicts in:
- api/server.go: Preserved beta_mode config and user permission checks
- manager/trader_manager.go: Kept optimized concurrent competition data with caching
Maintained all performance optimizations while merging new features from dev.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 01:36:54 +08:00
icy 5378e3469e Merge branch 'dev' of https://github.com/tinkle-community/nofx into dev
# Conflicts:
#	api/server.go
2025-11-04 01:34:14 +08:00
icy c912efc882 Fix: Add proper top padding to prevent HeaderBar overlap on all main app pages
Match main app layout with proven working /competition route layout:
- Use px-6 py-6 pt-24 padding (same as /competition route)
- Ensures HeaderBar doesn't overlap content on /traders and /dashboard pages
- Provides consistent 6rem (96px) top clearance for fixed positioned HeaderBar
- Removes responsive padding variants that differed from competition page
This fixes header overlap issues across all main application routes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 01:29:39 +08:00
hzb1115 62ebd58a1f style(backend): go fmt code 2025-11-03 17:22:11 +00:00
Luna Martinez b0ad7e774e Merge pull request #356 from xqliu/revert-pr-229-ut-infrastructure
Revert PR #229: Remove UT infrastructure
2025-11-03 12:13:16 -05:00
icy 5bc14b7006 Fix: Unify all pages to use HeaderBar component consistently
Replace the inline header implementation in main app with HeaderBar component to match landing page:
- Remove duplicate inline header code (168 lines)
- Use HeaderBar component for all main app pages like landing page does
- Ensure consistent header design across all routes (/competition, /traders, /dashboard)
- Maintain proper onPageChange navigation handling
- Keep all header functionality (user info, admin mode, language toggle, logout)
This fixes the header inconsistency where different pages used different header implementations.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 01:04:16 +08:00
Liu Xiang Qian 2eb5801e3d Revert "Merge pull request #229 from xqliu/test/add-ut-infrastructure"
This reverts commit 683e77b92f7608c31a7c25c91bb938c4d657f6e4, reversing
changes made to 791cecd2ffff0ebc3ea88c04fb91ddbe0c001422.
2025-11-04 00:58:12 +08:00
Icyoung d1a21b829d Merge pull request #355 from Icyoung/beta
Beta Competition kline count change to 5
2025-11-04 00:23:40 +08:00
icy 06b7f8b9cb Merge branch 'beta' of github.com:Icyoung/nofx into beta 2025-11-04 00:18:34 +08:00
icy 945625049b Merge branch 'dev' into beta 2025-11-04 00:17:50 +08:00
icy a5198b9a5b Limit performance comparison chart to top 5 traders
Frontend changes to ensure equity-history-batch API only requests data for top 5 performers:
- Modify CompetitionPage to pass only top 5 traders to ComparisonChart component
- Update API comments to reflect the change from top 10 to top 5
- Optimize chart performance by reducing data volume and API calls
This ensures the performance comparison chart shows only the most relevant traders while improving load times.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-04 00:16:14 +08:00
Icyoung 69dc7ddac8 Merge pull request #353 from Icyoung/beta
Beta Fix Competition、Rank api cache、Dev merge
2025-11-03 23:57:43 +08:00
icy d6998ac8fa Merge branch 'dev' into beta 2025-11-03 23:46:59 +08:00
icy 3f35f6a870 Merge branch 'dev' of https://github.com/tinkle-community/nofx into dev 2025-11-03 23:46:54 +08:00
icy 82fcb690fe Optimize /api/competition endpoint performance with concurrent data fetching and caching
## Performance Improvements:
- **Concurrent Processing**: Replace serial GetAccountInfo() calls with parallel goroutines
- **Timeout Control**: Add 3-second timeout per trader to prevent blocking
- **30-second Cache**: Implement competition data cache to reduce API calls
- **Error Handling**: Graceful degradation when API calls fail or timeout
## API Changes:
- Reduce top traders from 10 to 5 for better chart performance
- Update /api/equity-history-batch to use top 5 traders by default
- Add detailed logging for cache hits and performance monitoring
## Expected Performance Gains:
- First request: ~85% faster (from 25s to 3s for 50 traders)
- Cached requests: ~99.96% faster (from 25s to 10ms)
- Better user experience with consistent response times
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-03 23:45:09 +08:00
SkywalkerJi 430e23f7b5 Merge pull request #229 from xqliu/test/add-ut-infrastructure
test: Add minimal UT infrastructure and fix Issue #227
2025-11-04 00:28:34 +09:00
Icyoung 7e98b72f47 Merge pull request #349 from Icyoung/beta
Beta Competition fix
2025-11-03 23:28:11 +08:00
Liu Xiang Qian 31deb60e85 fix: Remove unused variables in AITradersPage.test.tsx to fix TypeScript compilation
Fixed TypeScript compilation errors by removing unused imports and variables:
- Removed unused 'screen' import from test-utils
- Removed unused 'fetcher' parameter from SWR mock
- Removed unused 'mockTrader' variable
- Removed unused 'TraderInfo' type import
All tests still pass (5/5) and frontend now compiles successfully.
2025-11-03 23:20:55 +08:00
icy a3ecbdf950 Merge branch 'dev' into beta 2025-11-03 23:19:52 +08:00
icy 9da70069b0 Merge branch 'tinkle-nofx/dev' with conflict resolution
- Resolve UI layout conflicts in App.tsx
- Keep modern Binance-style header with authentication logic
- Maintain responsive design and user interface improvements
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-03 23:19:25 +08:00
icy 41b57ce834 Prevent my-traders API calls when user is not logged in
- Add authentication checks to SWR calls in App.tsx and AITradersPage.tsx
- Only call api.getTraders when user and token are available
- Modify loadConfigs to skip authenticated API calls when not logged in
- Load only public supported models/exchanges for unauthenticated users
- Update useEffect dependencies to include user and token
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-03 23:14:10 +08:00
icy 804bb4c302 Fix equity-history-batch API to support POST JSON requests
- Change route from GET to POST for equity-history-batch endpoint
- Update handleEquityHistoryBatch to parse JSON body from POST requests
- Maintain backward compatibility with GET query parameters
- Ensure public access without authentication as required
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-03 23:13:53 +08:00
Icyoung 20975c83ef Merge pull request #345 from Icyoung/beta
Beta Dev Merge、Competition fix api
2025-11-03 22:54:55 +08:00
icy e42031cb23 Add internationalization for AI scan interval configuration
- Add aiScanInterval and scanIntervalRecommend translation keys to translations.ts
- Update TraderConfigModal to use internationalized text instead of hardcoded Chinese
- Support language switching for scan interval labels and recommendations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-03 22:40:50 +08:00
Icyoung 2d39ae1670 Merge pull request #336 from 0xEmberZz/fix-mobile-display-v2
UI : Fix mobile display
2025-11-03 22:40:17 +08:00
icy 18562e2b1a Merge dev branch with conflict resolution
- Resolve TypeScript interface formatting conflict in CommunitySection.tsx
- Include updates from dev branch
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-03 22:31:01 +08:00
icy 75d8d995f7 Merge branch 'dev' of https://github.com/tinkle-community/nofx into dev 2025-11-03 22:29:01 +08:00
SkywalkerJi 1d6adf9523 Merge pull request #338 from xqliu/feat/add-scan-interval-config-v2
feat: 添加 AI 扫描决策间隔配置支持
2025-11-03 23:11:27 +09:00
SkywalkerJi 69e5285a48 Merge pull request #337 from xqliu/fix/trader-edit-model-validation
fix: 修复编辑 Trader 时 AI 模型验证失败的问题
2025-11-03 23:11:08 +09:00
icy a8b3dc7a49 Optimize frontend to use batch API for equity history requests
- Add batch API methods (getEquityHistoryBatch, getTopTraders, getPublicTraderConfig) to api.ts
- Update ComparisonChart to use batch endpoint instead of individual calls
- Reduce network requests from 10 to 1 for performance comparison page
- Maintain backward compatibility with existing data structure
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-03 22:04:34 +08:00
Liu Xiang Qian 8b81a68561 revert: 移除 SystemPromptTemplate 相关修改
将 SystemPromptTemplate 功能从扫描间隔 PR 中分离出来,
保持 PR 单一职责。
SystemPromptTemplate 功能将在单独的 PR 中处理。
2025-11-03 22:02:25 +08:00
Liu Xiang Qian 16bf34d56e feat: 添加 AI 扫描决策间隔配置支持
## 功能描述
在创建和编辑 Trader 时,支持配置 AI 扫描决策间隔(scan_interval_minutes),允许用户自定义 AI 决策的频率。
## 修改内容
### 后端修改 (api/server.go)
1. **CreateTraderRequest** 添加 `ScanIntervalMinutes` 字段
2. **UpdateTraderRequest** 添加 `ScanIntervalMinutes` 字段和 `SystemPromptTemplate` 字段
3. **handleCreateTrader** 处理扫描间隔默认值(默认 3 分钟)
4. **handleUpdateTrader** 支持更新扫描间隔
5. **handleGetTraderConfig** 返回中添加 `scan_interval_minutes` 字段
### 前端修改
#### web/src/types.ts
- `CreateTraderRequest` 添加 `scan_interval_minutes?` 可选字段
- `TraderConfigData` 添加 `scan_interval_minutes` 必填字段
#### web/src/components/TraderConfigModal.tsx
- 本地 `TraderConfigData` 接口添加 `scan_interval_minutes`
- 初始状态设置默认值为 3 分钟
- 添加 UI 输入框(范围 1-60 分钟)
- Label 优化为 "AI 扫描决策间隔 (分钟)"
#### web/src/components/AITradersPage.tsx
- `handleSaveEditTrader` 的更新请求中添加 `scan_interval_minutes`
#### web/src/components/landing/CommunitySection.tsx
- 修复 TypeScript 编译错误:定义 `CardProps` 接口
- 修正 `TestimonialCard` 组件的 prop 名称(author → authorName)
## 功能特性
-  支持 1-60 分钟的自定义间隔
-  默认值为 3 分钟
-  UI 提示建议范围:3-10 分钟
-  创建和编辑时均支持配置
-  后端验证和处理默认值
## 测试步骤
1. 创建新 Trader,设置自定义扫描间隔(如 10 分钟)
2. 验证 Trader 创建成功
3. 编辑现有 Trader,修改扫描间隔
4. 验证修改保存成功
5. 确认 AI 决策按照新的间隔执行
2025-11-03 21:55:26 +08:00
Liu Xiang Qian c5628293a3 fix: 修复编辑 Trader 时 AI 模型验证失败的问题
## 问题描述
编辑 Trader 配置时,保存提示"AI模型配置不存在或未启用"错误。
## 根本原因
- 数据库存储的模型 ID 是完整格式(如 `admin_deepseek`)
- API 返回时将其转换为 provider 格式(`deepseek`)
- 前端 enabledModels 列表中是完整 ID
- 导致前端用 `deepseek` 查找 `admin_deepseek` 时失败
## 修复方案
移除 handleGetTraderConfig 中的模型 ID 转换逻辑,
返回完整的模型 ID,保持与前端模型列表格式一致。
Fixes #335
2025-11-03 21:52:44 +08:00