Fix: mark Forms as coming soon and disable toggle#164
Conversation
📝 WalkthroughWalkthroughThe Forms settings description text now includes a "(Coming Soon)" note. The associated switch component was changed from dynamically reflecting a workspace policy setting to a hardcoded, disabled, unchecked state, with the previous implementation commented out. ChangesForms settings switch disabled
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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
🧹 Nitpick comments (1)
components/settings/general/form.tsx (1)
29-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove commented-out code.
The previous
SwitchComponenetusage should be deleted rather than left as commented-out dead code. It clutters the file and can cause confusion in future maintenance.♻️ Remove commented-out block
- {/*<SwitchComponenet - checked={workspace.settings?.policiesEnabled} - label="" - classoverride="mt-0" - />*/} <SwitchComponenet checked={false} disabled label="" classoverride="mt-0" />🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/settings/general/form.tsx` around lines 29 - 33, Remove the commented-out SwitchComponenet block from the general form component instead of leaving dead code in place. Update the JSX in the form rendering area of the general settings form so only active code remains, and keep the cleanup focused around the existing settings form markup where SwitchComponenet was previously used.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/settings/general/form.tsx`:
- Around line 34-39: The disabled state is being dropped in `SwitchComponenet`,
so the underlying `Switch` still renders as interactive even when callers pass
`disabled`. Update `components/switch.tsx` inside `SwitchComponenet` to forward
the `disabled` prop directly to the rendered `Switch`, alongside the existing
`checked`, `onChange`, and styling props, so the control reflects its disabled
state consistently.
---
Nitpick comments:
In `@components/settings/general/form.tsx`:
- Around line 29-33: Remove the commented-out SwitchComponenet block from the
general form component instead of leaving dead code in place. Update the JSX in
the form rendering area of the general settings form so only active code
remains, and keep the cleanup focused around the existing settings form markup
where SwitchComponenet was previously used.
🪄 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: f4a6d196-6cd8-4e82-a71c-9448ae813911
📒 Files selected for processing (1)
components/settings/general/form.tsx
| <SwitchComponenet | ||
| checked={false} | ||
| disabled | ||
| label="" | ||
| classoverride="mt-0" | ||
| /> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
disabled prop is silently ignored by SwitchComponenet.
The SwitchComponenet in components/switch.tsx destructures disabled but never forwards it to the underlying <Switch>. As a result, the switch still appears interactive (pointer cursor, hover/focus styles) despite the intent to disable it. While the missing onChange prevents state mutation, the UX is misleading — users will think the toggle is clickable.
The fix belongs in components/switch.tsx:
🔧 Forward `disabled` to the underlying `Switch`
const SwitchComponenet: FC<Props> = ({ disabled, onChange, label, checked }: Props) => {
return (
<div className="flex flex-row">
<Switch
checked={checked}
+ disabled={disabled}
className={`${checked ? 'bg-primary' : 'bg-zinc-200'
} relative inline-flex h-6 w-11 items-center rounded-full shadow-inner mb-2`}
onChange={onChange}
>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@components/settings/general/form.tsx` around lines 34 - 39, The disabled
state is being dropped in `SwitchComponenet`, so the underlying `Switch` still
renders as interactive even when callers pass `disabled`. Update
`components/switch.tsx` inside `SwitchComponenet` to forward the `disabled` prop
directly to the rendered `Switch`, alongside the existing `checked`, `onChange`,
and styling props, so the control reflects its disabled state consistently.
The Forms FF was added in #154 and it seems was not disabled
Summary by CodeRabbit