Feat: 添加应用锁屏功能#1609
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5be97aa5e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| notifyRendererReady: boolean; | ||
| renderChildren: boolean; | ||
| }): boolean { | ||
| return input.notifyRendererReady && input.renderChildren; |
There was a problem hiding this comment.
Keep startup deep links queued while locked
When Netcatty is launched from an ssh:// link with App Lock enabled, renderChildren stays false on the startup lock screen, so this suppresses rendererReady until the user unlocks. deliverSshDeepLink waits on sendWhenRendererReady with a 15s timeout after the URL has already been shifted from the pending queue, so taking longer than that to enter the password drops the deep link instead of connecting after unlock. Consider keeping the deep link queued/buffered while locked or separating renderer readiness from app-content mounting.
Useful? React with 👍 / 👎.
f1f1586 to
90db33c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17b6130014
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return !( | ||
| input.locked && | ||
| input.lockReason === 'startup' && | ||
| !input.hasRenderedChildren |
There was a problem hiding this comment.
Defer deep links until background locks are cleared
When a new renderer opens while the shared runtime is already locked for background or idle (for example, Netcatty was hidden to tray and then an ssh:// link is opened), this predicate still renders the app children because it only suppresses startup locks. That lets the renderer report ready and register App.tsx's onSshDeepLink handler, which immediately calls handleConnectToHost when main delivers the URL, so a saved-credential connection can start behind the lock screen before the user unlocks. Consider gating first-render/readiness for all locked reasons, or queueing external actions until unlock.
Useful? React with 👍 / 👎.
变更内容
新增 Netcatty 应用锁屏能力:应用可以在主界面渲染前锁定,也可以从顶部标签栏手动锁定,并支持空闲超时、隐藏到后台、重新打开等场景下的锁定/恢复。
本 PR 目前覆盖的是完整 App Lock 链路:
AppLockGate启动 gate,避免启动锁定时主界面先渲染到锁屏背后。systemPreferences使用 Touch ID。给 Reviewer 的说明
这个 PR 的 diff 比“添加锁屏”听起来大,因为它不是单个 UI Overlay,而是跨 renderer gate、Electron 生命周期、持久化设置、IPC、安全认证、Windows native helper 打包和回归测试的一整套功能。
当前 PR 统计:
package.json/package-lock.json约 +505 行。Windows Hello/helper 打包相关内容包含在这个 PR 里,是因为 UI 已经暴露了系统解锁入口,而 Windows 需要 native helper 才能完成该路径。如果希望降低 review 面积,可以把本 PR 收敛为“密码锁屏核心”,再把系统解锁/Windows Hello 拆成后续 PR。
行为细节
安全与锁死风险处理
验证
合并最新
upstream/main后已在本地验证:git diff --name-only --diff-filter=U:无未解决冲突。git diff --cached --check:提交 merge 前通过。npm run lint:通过,0 errors,2 个已有 warnings。npm run generate:capability-tools+ generated JSON diff check:无 drift。npm test:4007 tests,4004 passed,0 failed,3 skipped。npm run build:通过。冲突解决后已推送当前 head commit,并重新触发 CI。
关联 Issue
关联 #672
关联 #955