Open
Conversation
There was a problem hiding this comment.
Pull request overview
该 PR 旨在提升移动端启动脚本的可诊断性,并将侧边栏“收藏项目”从仅本地存储升级为后端用户偏好持久化,从而支持刷新保留与跨设备同步。
Changes:
- PowerShell 启动脚本增加对 3001 端口监听检测,并在失败时输出最近的 stderr 日志
- 新增 user_preferences 表及其 DB 读写封装,并提供偏好读写 API
- 前端侧边栏接入偏好读写接口,将收藏项目同步到后端
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| upstream-overrides/claudecodeui-1.25.2/src/utils/api.js | 为 /api/user/preferences/:key 增加 get/set API 封装 |
| upstream-overrides/claudecodeui-1.25.2/src/components/sidebar/utils/utils.ts | 新增收藏项目偏好 key 常量 |
| upstream-overrides/claudecodeui-1.25.2/src/components/sidebar/hooks/useSidebarController.ts | 启动时拉取收藏偏好并在收藏变更时写回后端 |
| upstream-overrides/claudecodeui-1.25.2/server/routes/user.js | 新增用户路由:git-config、onboarding、preferences |
| upstream-overrides/claudecodeui-1.25.2/server/database/init.sql | 增加 user_preferences 表定义 |
| upstream-overrides/claudecodeui-1.25.2/server/database/db.js | migrations 创建 user_preferences 表 + userPreferencesDb 读写封装 |
| scripts/start-mobile-codex-stack.ps1 | 增加 3001 端口启动检测并在失败时输出 stderr tail |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+28
to
+31
| router.get('/git-config', authenticateToken, async (req, res) => { | ||
| try { | ||
| const userId = req.user.id; | ||
| let gitConfig = userDb.getGitConfig(userId); |
Comment on lines
+173
to
+175
| const next = new Set(payload.value.filter((item: unknown) => typeof item === 'string')); | ||
| setStarredProjects(next); | ||
| persistStarredProjects(next); |
Comment on lines
+16
to
+19
| $listener = Get-NetTCPConnection -State Listen -LocalPort 3001 -ErrorAction SilentlyContinue | ||
| if ($listener) { | ||
| $appReady = $true | ||
| break |
Comment on lines
+352
to
+354
| void api.user.setPreference(STARRED_PROJECTS_PREFERENCE_KEY, [...next]).catch((error) => { | ||
| console.error('Error saving starred projects preference:', error); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
1. 修复移动端启动检测
之前启动脚本在拉起后端后没有检查
3001是否真正启动成功,后端启动失败时,前端只会表现为“网络异常”,定位原因比较困难。这次改动:
3001端口检查2. 收藏项目持久化
之前收藏项目只保存在本地状态中,刷新后可能重置,也无法跨设备同步。
这次改动:
验证
3001/health正常8080/health正常3001和8080均正常拉起