feat(intel): master toggle for intel-aware preview chrome#78
Conversation
Adds an "Intel" panel to the Settings tab with controls for the new
v3.2.0 keys, so users can tune them from the UI instead of editing
settings.json:
- intel.track_character_locations (checkbox)
Toggles the per-character Local-log tracker. Tooltip explains it
drives smart fan-out and chip system labels. Restart-required.
- intel.threat_jumps_threshold (spinbox, 0-5)
How many jumps from an alert system a character can be and still
see a threat tint. 0 = exact-match only. Tooltip explains the
falloff.
- replay_strip_enabled (read-only summary)
Shows how many characters have the per-character toggle enabled
and points users to the right-click menu where it lives. Surfacing
the feature here is the discoverability fix; the actual toggle
stays per-frame.
Wires the panel into SettingsTab's panel stack and category tree
between Hotkeys and Appearance.
7 new tests (6 IntelPanel state/wiring + 1 updated existing
test_setup_ui_creates_all_panels for the new mock). Suite: 2397 passed,
5 skipped.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Some users won't want the v3.2.0 threat tints — they may not use chat-log intel, may find the chrome distracting, or may prefer plain previews. Adds a master toggle (intel.preview_chrome_enabled, default true) that suppresses ALL threat chrome on previews and chips while leaving the parser, audio alerts, tray notifications, system labels, and replay strip untouched. Implementation: - New setting intel.preview_chrome_enabled (default true) added to SettingsManager.DEFAULT_SETTINGS, alongside formalized defaults for the other v3.2.0 keys (track_character_locations, threat_jumps_threshold). - MainWindowV21._on_intel_alert reads the setting (defensive getattr for bypassed-init test sites) and skips the fan-out to WindowManager.apply_threat_state and StatusDock.set_threat_state when off. Other AlertTypes (audio, tray) keep firing. - MainWindowV21._clear_threat_chrome flushes both surfaces with CLEAR so a toggle-off takes effect immediately rather than waiting for the 30s decay timer. - MainWindowV21._apply_setting routes the toggle-off case through it. - IntelPanel adds the checkbox at the top of the panel with a tooltip spelling out exactly what the toggle does and does NOT affect. 19 new tests covering on/off fan-out, critical-tray independence, default-on for missing settings, _clear_threat_chrome surface coverage, _apply_setting routing, and IntelPanel checkbox state/signal. Suite: 2411 passed, 5 skipped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Code Review
This pull request introduces a master toggle for 'Intel-Aware Preview Chrome,' allowing users to suppress visual threat indicators like tints and badges while keeping other alert types active. The changes include a new setting in the SettingsManager, a UI checkbox in the SettingsTab, and logic in MainWindowV21 to gate visual updates and immediately clear active tints when the feature is disabled. Comprehensive unit tests were added to verify the toggle's behavior and the clearing mechanism. Feedback suggests refactoring the setting retrieval into a helper property for cleaner code and using the toggled signal for the checkbox to follow PySide6 idioms.
| sm = getattr(self, "settings_manager", None) | ||
| chrome_enabled = sm.get("intel.preview_chrome_enabled", True) if sm is not None else True |
There was a problem hiding this comment.
The logic for retrieving the intel.preview_chrome_enabled setting is repeated and slightly verbose. Consider adding a private helper property to encapsulate this check, which would also make gating other visual effects (like the border flash) cleaner.
@property
def _intel_chrome_enabled(self) -> bool:
sm = getattr(self, "settings_manager", None)
if sm is None:
return True
return sm.get("intel.preview_chrome_enabled", True)| self.chrome_enabled_check.stateChanged.connect( | ||
| lambda: self.setting_changed.emit( | ||
| "intel.preview_chrome_enabled", | ||
| self.chrome_enabled_check.isChecked(), | ||
| ) | ||
| ) |
There was a problem hiding this comment.
For boolean settings controlled by a QCheckBox, it is more idiomatic in PySide6 to use the toggled(bool) signal instead of stateChanged(int). This avoids the need to manually call isChecked() inside the lambda and provides a cleaner boolean interface.
self.chrome_enabled_check.toggled.connect(
lambda checked: self.setting_changed.emit(
"intel.preview_chrome_enabled",
checked,
)
)
Summary
Some users won't want the v3.2.0 threat tints — may not use chat-log intel, may find chrome distracting, or may prefer plain previews. Adds a master toggle (`intel.preview_chrome_enabled`, default true) that suppresses all threat chrome on previews and chips while leaving everything else running.
What the toggle controls
Implementation
Test plan
🤖 Generated with Claude Code