Skip to content

feat: add first-run onboarding flow#2

Open
shuguangnet wants to merge 2 commits into
bencode:mainfrom
shuguangnet:feat/onboarding-first-run
Open

feat: add first-run onboarding flow#2
shuguangnet wants to merge 2 commits into
bencode:mainfrom
shuguangnet:feat/onboarding-first-run

Conversation

@shuguangnet
Copy link
Copy Markdown

Add a guided first-run setup so users can configure a local knowledge repository and API settings before entering the reader.

qqsyun and others added 2 commits May 15, 2026 22:59
Add a guided first-run setup so users can configure a local knowledge repository and API settings before entering the reader.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the empty home page with a repository overview that summarizes files, folders, content types, and suggested reading entry points.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bencode
Copy link
Copy Markdown
Owner

bencode commented May 19, 2026

感谢 PR!先说结论:首次启动体验差这个问题确实需要解决,方向是对的。下面是我建议在合并前调整的几点。

建议拆 PR

这个 PR 实际包含两件独立的事:onboarding 流程 + 用 Knowledge Map 替换空首页。建议拆开,让 onboarding 先合,Knowledge Map 单独 PR 单独评估必要性(它和首次启动体验不是同一个问题)。

Onboarding 实现需要优化的 4 点

这几个不是代码风格问题,是会破坏现有用户配置的实质问题:

1. api_keyauth_token 不能合并config_routes.py 新代码)

"api_key": api_key or auth_token,  # 会丢失 auth_token 语义

现状 workspace.py:49build_sdk_env 是把 ANTHROPIC_API_KEYANTHROPIC_AUTH_TOKEN 作为两个独立 env 处理的。合并会让使用 auth_token(代理场景)的用户配置失效。建议在 config 里也分开存。

2. 不应清空已有的多 repo 配置

/api/config/onboarding/completeworkspace_config.repos.clear() 后只 append 一个新 repo。但项目本身支持多 repo(INCREA_REPO: 分隔)。如果一个老用户配了多个 repo 后被引导走 onboarding,会丢失其他 repo。建议改为 append 而非 replace,或在已有 repo 时跳过这一步。

3. needs_onboarding 逻辑会误触发

"needs_onboarding": not is_onboarding_complete() or not valid_repos,

用户完成 onboarding 后,如果某天把 repo 目录挪了路径(valid_repos 为空),会被重新拉回完整引导流程。这种场景下更合适的是引导他修 repo 路径,而不是整个重做一遍。建议把"首次引导"和"repo 失效兜底"拆成两种状态。

4. Commit message

CLAUDE.md 里写了 commit 不带 Co-Authored-By: Claude,麻烦改下。

其他小建议(不 blocking)

  • onboarding.tsx (262 行) / knowledge-map.tsx (365 行) 超过项目 200 行约定,可考虑拆子组件
  • onboarding 的 repo path / API key 输入和现有 api-settings-form.tsxrepo-panel.tsx 有重叠,能复用就复用
  • 完成后用 window.location.reload() 强刷整页可以换成让 layout 重新 fetch
  • _check_pdf_support 检测 fitz import — fitz 是 requirements.txt 硬依赖,实际不会失败,这个诊断可以省

期待下个版本,加油!

shuguangnet added a commit to shuguangnet/increa-reader that referenced this pull request May 19, 2026
bencode#1: 创建 packages/ui/src/lib/platform.ts
- 统一平台检测: isTauri/isPWA/isMobile/isDesktop/isWeb
- API 基础 URL 管理 (Web 相对路径 vs Tauri localhost)
- Tauri 原生功能桥接: 文件夹选择、服务器启停、窗口控制
- 平台能力探测: supportsFS/supportsTray/supportsNotifications 等
- 零依赖: Tauri SDK 按需动态 import,Web 模式完全隔离

bencode#2: 完善 Tauri 桌面端构建配置
- 更新 package.json 添加构建脚本和依赖
- 创建 desktop/src/main.tsx 桌面入口点
- 重构 tauri.ts 为 platform.ts 的 re-export
- 添加 vite.config.ts (复用 UI 代码)
- 添加 tsconfig.json (路径别名 @ -> ui/src)
- 更新 tauri.conf.json (构建命令、CSP、图标)
- 生成占位图标文件
- 更新 build.sh 构建脚本
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants