fix(themes): stop SafetyFloor from duplicating the assistant button on the default theme#516
Conversation
…des the top bar The SafetyFloor escape-hatch button rendered unconditionally, so on the default theme (which already has the top-bar assistant button) a second assistant button appeared top-right. Render it only when the active theme hides the top bar (structure.topBar.variant === "hidden"), where the standard button would otherwise be lost — preserving the requires: ["assistant"] safety contract without duplicating the control. Adds a regression test for the default-theme case (button absent).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughSafetyFloor transitions from always-rendered to conditionally rendered. The component now consults the active theme via ChangesSafetyFloor Conditional Rendering
🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Problem
After the Theme Manager landed (#513), the default theme shows two taOS assistant buttons — the normal one top-left (in the TopBar) and a second one top-right. The second is the
SafetyFloorescape-hatch button, which was rendering unconditionally.Fix
SafetyFlooris meant to be a fallback that guarantees assistant access only when a theme hides the standard chrome. It now renders only when the active theme hides the top bar (structure.topBar?.variant === "hidden"), where the normal top-bar button would otherwise be lost.structure: {}) → SafetyFloor renders nothing → single button top-left. ✅requires: ["assistant"]safety contract. ✅Tests
Extended
safety-regression.test.tsx:Both pass;
tsc --noEmitandnpm run buildclean.Found during live smoke-testing on the Pi after updating to master.
Summary by CodeRabbit
Bug Fixes
Tests