fix(web): show env keys checkbox in add project dialog#1086
fix(web): show env keys checkbox in add project dialog#1086lraphael wants to merge 2 commits intocoleam00:devfrom
Conversation
The "Allow env keys" checkbox was only visible after a failed add attempt due to env leak detection. Move it into the add form so users can opt in before clicking Add, avoiding the error roundtrip.
📝 WalkthroughWalkthroughThe "Add Project" UI in SettingsPage is refactored: the inline single-row form is replaced with a stacked container that always includes an "Allow env keys (I understand the risk)" checkbox controlled by Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/web/src/routes/SettingsPage.tsx`:
- Around line 423-433: The checkbox for toggling env keys (bound to allowEnvKeys
and setAllowEnvKeys) was added inline in the form but the old conditional
error-state checkbox that also renders on env-leak errors remained, causing
duplicate controls; remove the duplicated JSX error-state checkbox block that
renders when an env-leak/error condition is present (the conditional label/input
that also uses allowEnvKeys/onChange) so only the new in-form checkbox remains,
and ensure nothing else conditionally renders another control bound to
allowEnvKeys.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 86a073b3-29dd-4d92-85ad-80923300f41f
📒 Files selected for processing (1)
packages/web/src/routes/SettingsPage.tsx
The old error-state checkbox is no longer needed since the checkbox is now always visible in the add project form. Also removes the unused isEnvLeakError helper function.
|
Closing — the env-keys consent checkbox and the entire consent UI were removed in #1169 (merged into dev). Repos now register without scanning or consent. The |
Problem
When adding a project that contains sensitive keys in
.env(e.g.ANTHROPIC_API_KEY), the add fails with a 422 error. The "Allow env keys" checkbox was supposed to appear in the error message after the failed attempt, but it was not visible — leaving users with no way to opt in through the UI. The only workaround was settingallow_target_repo_keys: truein~/.archon/config.yaml.Summary
isEnvLeakErrorhelperTest plan