mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
video filter alerts
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -78,7 +78,7 @@
|
|||||||
<script defer src="https://analytics.otter.land/script.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land"></script>
|
<script defer src="https://analytics.otter.land/script.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land"></script>
|
||||||
<script defer src="https://analytics.otter.land/recorder.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land" data-sample-rate="0.15" data-mask-level="moderate" data-max-duration="300000"></script>
|
<script defer src="https://analytics.otter.land/recorder.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land" data-sample-rate="0.15" data-mask-level="moderate" data-max-duration="300000"></script>
|
||||||
<title>Roomba Rover</title>
|
<title>Roomba Rover</title>
|
||||||
<script type="module" crossorigin src="/assets/index-B0U7t0up.js"></script>
|
<script type="module" crossorigin src="/assets/index-CTOqrTOu.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CdgtactY.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CdgtactY.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -105,11 +105,12 @@ export default function KeyboardInputManager() {
|
|||||||
const hornActive = useControlSelector((control) => Boolean(control.state.horn?.active));
|
const hornActive = useControlSelector((control) => Boolean(control.state.horn?.active));
|
||||||
const homeAssistant = useSessionSelector((state) => state.session?.homeAssistant || null);
|
const homeAssistant = useSessionSelector((state) => state.session?.homeAssistant || null);
|
||||||
const dockAssist = useManualDockAssist();
|
const dockAssist = useManualDockAssist();
|
||||||
const { homeAssistantSetState } = useSessionActions();
|
const { homeAssistantSetState, pushAlert } = useSessionActions();
|
||||||
const { focusChat } = useChatActions();
|
const { focusChat } = useChatActions();
|
||||||
const { isChatFocused } = useChatFocus();
|
const { isChatFocused } = useChatFocus();
|
||||||
const { value: inputSettings } = useSettingsNamespace('inputs', INPUT_SETTINGS_DEFAULTS);
|
const { value: inputSettings } = useSettingsNamespace('inputs', INPUT_SETTINGS_DEFAULTS);
|
||||||
const { save: saveVideoSettings } = useSettingsNamespace('video', VIDEO_SETTINGS_DEFAULTS);
|
const { value: videoSettings, save: saveVideoSettings } = useSettingsNamespace('video', VIDEO_SETTINGS_DEFAULTS);
|
||||||
|
const videoColorFilter = normalizeVideoFilter(videoSettings?.colorFilter);
|
||||||
const keymap = useMemo(() => normalizeKeymapEntries(rawKeymap), [rawKeymap]);
|
const keymap = useMemo(() => normalizeKeymapEntries(rawKeymap), [rawKeymap]);
|
||||||
const actionTokens = useMemo(() => {
|
const actionTokens = useMemo(() => {
|
||||||
const tokens = new Set();
|
const tokens = new Set();
|
||||||
@@ -325,10 +326,23 @@ export default function KeyboardInputManager() {
|
|||||||
// Update through the same settings namespace as the Page settings dropdown so the keyboard
|
// Update through the same settings namespace as the Page settings dropdown so the keyboard
|
||||||
// shortcut and menu never maintain separate copies of the selected filter.
|
// shortcut and menu never maintain separate copies of the selected filter.
|
||||||
const latest = latestRef.current;
|
const latest = latestRef.current;
|
||||||
latest?.saveVideoSettings((current) => ({
|
if (!latest) return;
|
||||||
|
const nextFilter = nextVideoFilter(latest.videoColorFilter);
|
||||||
|
latest.saveVideoSettings((current) => ({
|
||||||
...(current ?? {}),
|
...(current ?? {}),
|
||||||
colorFilter: nextVideoFilter(current?.colorFilter),
|
colorFilter: nextFilter,
|
||||||
}));
|
}));
|
||||||
|
latest.pushAlert({
|
||||||
|
// Reuse one alert lane for filter changes so fast key-repeat-like cycling refreshes the
|
||||||
|
// indicator instead of covering the interface with a stack of filter toasts.
|
||||||
|
id: 'video-filter-active',
|
||||||
|
title: 'Video filter',
|
||||||
|
// The message intentionally uses the raw filter key; no label mapping is needed because
|
||||||
|
// these are the same keys persisted in the setting and cycled by the shortcut.
|
||||||
|
message: `Rover video filter: ${nextFilter}`,
|
||||||
|
color: '#38bdf8',
|
||||||
|
lifetimeMs: 1600,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
@@ -345,6 +359,7 @@ export default function KeyboardInputManager() {
|
|||||||
keyboardSpeeds,
|
keyboardSpeeds,
|
||||||
keymap,
|
keymap,
|
||||||
nudgeServo,
|
nudgeServo,
|
||||||
|
pushAlert,
|
||||||
registerInputState,
|
registerInputState,
|
||||||
roverId,
|
roverId,
|
||||||
runMacro,
|
runMacro,
|
||||||
@@ -362,6 +377,7 @@ export default function KeyboardInputManager() {
|
|||||||
stopAllMotion,
|
stopAllMotion,
|
||||||
stopHorn,
|
stopHorn,
|
||||||
toggleNightVision,
|
toggleNightVision,
|
||||||
|
videoColorFilter,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user