fix: read safe mode level from live toolbar state#362
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis change refactors safe mode level checks throughout the codebase to read from the coordinator's toolbar state instead of the immutable connection object, enabling real-time safe mode changes made in the UI to take effect immediately during query execution. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
Summary
Fixes #357
All 13 safe mode enforcement points read
connection.safeModeLevel— butconnectionislet(immutable) onMainContentCoordinator, frozen at connection time. The toolbar UI binds totoolbarState.safeModeLevelwhich IS updated when the user changes the picker, but the enforcement points never see the change.This PR makes
toolbarState.safeModeLevelthe single source of truth for the live session:safeModeLevelcomputed property onMainContentCoordinatorthat delegates totoolbarState.safeModeLevelconnection.safeModeLevelreads in coordinator extensions with the new propertyMainEditorContentViewandMainContentView+BindingsAppState.shared.safeModeLevelvia.onChangeso sidebar context menus also reflect live changesTest plan
Summary by CodeRabbit