diff --git a/src-ui/app/config_page/setting_section/setting_box/components/useSettingBox.module.scss b/src-ui/app/config_page/setting_section/setting_box/components/useSettingBox.module.scss
index 6740a057..8eb56996 100644
--- a/src-ui/app/config_page/setting_section/setting_box/components/useSettingBox.module.scss
+++ b/src-ui/app/config_page/setting_section/setting_box/components/useSettingBox.module.scss
@@ -4,7 +4,6 @@
justify-content: space-between;
align-items: center;
padding: 2rem;
- display: flex;
justify-content: space-between;
align-items: center;
gap: 2rem;
@@ -18,27 +17,25 @@
width: 100%;
}
-.threshold_container {
- display: flex;
- width: 100%;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- gap: 2rem;
- padding: 2rem;
- border-bottom: solid 0.1rem var(--dark_800_color);
-}
+// .threshold_container {
+// display: flex;
+// width: 100%;
+// flex-direction: column;
+// justify-content: space-between;
+// align-items: center;
+// gap: 2rem;
+// }
-.threshold_switch_section {
- display: flex;
- width: 100%;
- justify-content: space-between;
- align-items: center;
-}
+// .threshold_switch_section {
+// display: flex;
+// width: 100%;
+// justify-content: space-between;
+// align-items: center;
+// }
-.threshold_section {
- width: 100%;
-}
+// .threshold_section {
+// width: 100%;
+// }
.deepl_auth_key_label_section {
max-width: 34rem;
diff --git a/src-ui/app/config_page/setting_section/setting_box/device/Device.jsx b/src-ui/app/config_page/setting_section/setting_box/device/Device.jsx
index 0354f438..6bfee05f 100644
--- a/src-ui/app/config_page/setting_section/setting_box/device/Device.jsx
+++ b/src-ui/app/config_page/setting_section/setting_box/device/Device.jsx
@@ -1,119 +1,177 @@
import { useTranslation } from "react-i18next";
+import styles from "./Device.module.scss";
import {
- DropdownMenuContainer,
- ThresholdContainer,
+ useOnMouseLeaveDropdownMenu,
} from "../components/useSettingBox";
export const Device = () => {
-
return (
<>
-
-
-
-
-
+
+
>
);
};
import { useMicHostList } from "@logics_configs/useMicHostList";
import { useSelectedMicHost } from "@logics_configs/useSelectedMicHost";
-const DropdownMenuContainer_MicHost = () => {
- const { t } = useTranslation();
- const { currentSelectedMicHost, setSelectedMicHost } = useSelectedMicHost();
- const { currentMicHostList, getMicHostList } = useMicHostList();
-
- const selectFunction = (selected_data) => {
- setSelectedMicHost(selected_data.selected_id);
- };
-
- return (
-
- );
-};
import { useMicDeviceList } from "@logics_configs/useMicDeviceList";
import { useSelectedMicDevice } from "@logics_configs/useSelectedMicDevice";
-const DropdownMenuContainer_MicDevice = () => {
+import { useMicThreshold } from "@logics_configs/useMicThreshold";
+
+import { LabelComponent } from "../components/label_component/LabelComponent";
+import { DropdownMenu } from "../components/dropdown_menu/DropdownMenu";
+import { ThresholdComponent } from "../components/threshold_component/ThresholdComponent";
+import { Switchbox } from "../components/switchbox/Switchbox";
+
+const Mic_Container = () => {
const { t } = useTranslation();
+ const { currentSelectedMicHost, setSelectedMicHost } = useSelectedMicHost();
+ const { currentMicHostList, getMicHostList } = useMicHostList();
+ const { onMouseLeaveFunction } = useOnMouseLeaveDropdownMenu();
+ const { currentEnableAutomaticMicThreshold, toggleEnableAutomaticMicThreshold } = useMicThreshold();
+
+ const selectFunction_host = (selected_data) => {
+ setSelectedMicHost(selected_data.selected_id);
+ };
+
const { currentSelectedMicDevice, setSelectedMicDevice } = useSelectedMicDevice();
const { currentMicDeviceList, getMicDeviceList } = useMicDeviceList();
- const selectFunction = (selected_data) => {
+ const selectFunction_device = (selected_data) => {
setSelectedMicDevice(selected_data.selected_id);
};
+ const getLabels = () => {
+ if (currentEnableAutomaticMicThreshold.data === true) {
+ return {
+ label: t("config_page.mic_dynamic_energy_threshold.label_for_automatic"),
+ desc: t("config_page.mic_dynamic_energy_threshold.desc_for_automatic"),
+ };
+ } else {
+ return {
+ label: t("config_page.mic_dynamic_energy_threshold.label_for_manual"),
+ desc: t("config_page.mic_dynamic_energy_threshold.desc_for_manual"),
+ };
+ }
+
+ };
return (
-
+
+
+
+
+
+
{t("config_page.mic_host_device.label_host")}
+
+
+
+
+
{t("config_page.mic_host_device.label_device")}
+
+
+
+
+
+
);
};
import { useSpeakerDeviceList } from "@logics_configs/useSpeakerDeviceList";
import { useSelectedSpeakerDevice } from "@logics_configs/useSelectedSpeakerDevice";
-const DropdownMenuContainer_SpeakerDevice = () => {
+import { useSpeakerThreshold } from "@logics_configs/useSpeakerThreshold";
+
+const Speaker_Container = () => {
const { t } = useTranslation();
const { currentSelectedSpeakerDevice, setSelectedSpeakerDevice } = useSelectedSpeakerDevice();
const { currentSpeakerDeviceList, getSpeakerDeviceList } = useSpeakerDeviceList();
+ const { onMouseLeaveFunction } = useOnMouseLeaveDropdownMenu();
+ const { currentEnableAutomaticSpeakerThreshold, toggleEnableAutomaticSpeakerThreshold } = useSpeakerThreshold();
const selectFunction = (selected_data) => {
setSelectedSpeakerDevice(selected_data.selected_id);
};
+ const getLabels = () => {
+ if (currentEnableAutomaticSpeakerThreshold.data === true) {
+ return {
+ label: t("config_page.speaker_dynamic_energy_threshold.label_for_automatic"),
+ desc: t("config_page.speaker_dynamic_energy_threshold.desc_for_automatic"),
+ };
+ } else {
+ return {
+ label: t("config_page.speaker_dynamic_energy_threshold.label_for_manual"),
+ desc: t("config_page.speaker_dynamic_energy_threshold.desc_for_manual"),
+ };
+ }
+
+ };
return (
-
- );
-};
-
-const ThresholdContainer_Mic = () => {
- const { t } = useTranslation();
-
- return (
-
- );
-};
-
-const ThresholdContainer_Speaker = () => {
- const { t } = useTranslation();
-
- return (
-
+
);
};
\ No newline at end of file
diff --git a/src-ui/app/config_page/setting_section/setting_box/device/Device.module.scss b/src-ui/app/config_page/setting_section/setting_box/device/Device.module.scss
new file mode 100644
index 00000000..1e2f9117
--- /dev/null
+++ b/src-ui/app/config_page/setting_section/setting_box/device/Device.module.scss
@@ -0,0 +1,70 @@
+.mic_container {
+ display: flex;
+ flex-direction: column;
+ border-bottom: solid 0.1rem var(--dark_800_color);
+ padding-bottom: 2rem;
+}
+
+.speaker_container {
+ padding-top: 2rem;
+}
+
+.device_container {
+ display: flex;
+ width: 100%;
+ justify-content: space-between;
+ align-items: center;
+ padding: 2rem;
+ margin-bottom: 0rem;
+}
+
+.threshold_container {
+ padding: 2rem;
+}
+
+
+
+.threshold_container {
+ display: flex;
+ width: 100%;
+ flex-direction: column;
+ justify-content: space-between;
+ align-items: center;
+ gap: 2rem;
+}
+
+.threshold_switch_section {
+ display: flex;
+ width: 100%;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.threshold_section {
+ width: 100%;
+}
+
+
+
+
+.device_label {
+ font-size: 1.8rem;
+ color: var(--dark_basic_text_color);
+}
+
+.device_contents {
+ display: flex;
+ gap: 2.8rem;
+}
+
+.device_dropdown_wrapper {
+ display: flex;
+ flex-direction: column;
+ gap: 0.6rem;
+}
+
+.device_dropdown_label {
+ padding-left: 0.2rem;
+ font-size: 1.4rem;
+ color: var(--dark_500_color);
+}
\ No newline at end of file
diff --git a/src-ui/app/main_page/sidebar_section/SidebarSection.jsx b/src-ui/app/main_page/sidebar_section/SidebarSection.jsx
index 1d00ea55..64e7c7ba 100644
--- a/src-ui/app/main_page/sidebar_section/SidebarSection.jsx
+++ b/src-ui/app/main_page/sidebar_section/SidebarSection.jsx
@@ -1,7 +1,7 @@
import clsx from "clsx";
import styles from "./SidebarSection.module.scss";
-import { useStore_IsMainPageCompactMode } from "@store";
+import { useStore_IsMainPageCompactMode, useStore_IsOpenedLanguageSelector } from "@store";
import { Logo } from "./logo/Logo";
import { MainFunctionSwitch } from "./main_function_switch/MainFunctionSwitch";
@@ -10,15 +10,22 @@ import { OpenSettings } from "./open_settings/OpenSettings";
export const SidebarSection = () => {
const { currentIsMainPageCompactMode } = useStore_IsMainPageCompactMode();
- const container_class_name = clsx(styles["container"], {
- [styles["is_compact_mode"]]: currentIsMainPageCompactMode
+ const container_class_name = clsx(styles.container, {
+ [styles.is_compact_mode]: currentIsMainPageCompactMode
+ });
+
+ const { currentIsOpenedLanguageSelector } = useStore_IsOpenedLanguageSelector();
+ const scroll_container_class_names = clsx(styles.scroll_container, {
+ [styles.is_opened]: (currentIsOpenedLanguageSelector.your_language === true || currentIsOpenedLanguageSelector.target_language === true)
});
return (
-
- {!currentIsMainPageCompactMode &&
}
+
+
+ {!currentIsMainPageCompactMode && }
+
);
diff --git a/src-ui/app/main_page/sidebar_section/SidebarSection.module.scss b/src-ui/app/main_page/sidebar_section/SidebarSection.module.scss
index de2f091a..26096649 100644
--- a/src-ui/app/main_page/sidebar_section/SidebarSection.module.scss
+++ b/src-ui/app/main_page/sidebar_section/SidebarSection.module.scss
@@ -7,5 +7,45 @@
background-color: var(--dark_850_color);
&.is_compact_mode {
min-width: auto;
+ .scroll_container {
+ overflow-y: hidden;
+ width: auto;
+ }
}
-}
\ No newline at end of file
+}
+
+.scroll_container {
+ width: calc(100% + 0.8rem);
+ overflow-y: scroll;
+ overflow-x: hidden;
+ margin-bottom: calc(2rem + 1.6rem + 2rem); // config button's sizes (svg + padding + margin).
+ pointer-events: auto;
+ z-index: 1;
+ &::-webkit-scrollbar {
+ width: 0.8rem;
+ }
+ &::-webkit-scrollbar-track {
+ background-color: var(--dark_888_color);
+ border-radius: 0.4rem;
+ }
+ &::-webkit-scrollbar-thumb {
+ background-color: var(--dark_888_color);
+ border-radius: 0.4rem;
+ }
+
+ &.is_opened {
+ &::-webkit-scrollbar-track {
+ background-color: var(--dark_875_color);
+ }
+ &::-webkit-scrollbar-thumb {
+ background-color: var(--dark_875_color);
+ }
+ }
+
+ &:hover {
+ &::-webkit-scrollbar-thumb {
+ background-color: var(--dark_800_color);
+ }
+ }
+
+}
diff --git a/src-ui/logics/configs/useMicThreshold.js b/src-ui/logics/configs/useMicThreshold.js
index 14b2a91c..0a850f88 100644
--- a/src-ui/logics/configs/useMicThreshold.js
+++ b/src-ui/logics/configs/useMicThreshold.js
@@ -1,9 +1,10 @@
-import { useStore_MicThreshold } from "@store";
+import { useStore_MicThreshold, useStore_EnableAutomaticMicThreshold } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useMicThreshold = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { updateMicThreshold, currentMicThreshold } = useStore_MicThreshold();
+ const { updateEnableAutomaticMicThreshold, currentEnableAutomaticMicThreshold } = useStore_EnableAutomaticMicThreshold();
const getMicThreshold = () => {
asyncStdoutToPython("/config/input_mic_energy_threshold");
@@ -13,10 +14,29 @@ export const useMicThreshold = () => {
asyncStdoutToPython("/controller/callback_set_mic_energy_threshold", mic_threshold);
};
+ const getEnableAutomaticMicThreshold = () => {
+ updateEnableAutomaticMicThreshold(() => new Promise(() => {}));
+ asyncStdoutToPython("/config/input_mic_dynamic_energy_threshold");
+ };
+
+ const toggleEnableAutomaticMicThreshold = () => {
+ updateEnableAutomaticMicThreshold(() => new Promise(() => {}));
+ if (currentEnableAutomaticMicThreshold.data) {
+ asyncStdoutToPython("/controller/callback_disable_mic_dynamic_energy_threshold");
+ } else {
+ asyncStdoutToPython("/controller/callback_enable_mic_dynamic_energy_threshold");
+ }
+ };
+
return {
currentMicThreshold,
getMicThreshold,
setMicThreshold,
updateMicThreshold,
+
+ currentEnableAutomaticMicThreshold,
+ getEnableAutomaticMicThreshold,
+ toggleEnableAutomaticMicThreshold,
+ updateEnableAutomaticMicThreshold,
};
};
\ No newline at end of file
diff --git a/src-ui/logics/configs/useSpeakerThreshold.js b/src-ui/logics/configs/useSpeakerThreshold.js
index f30c4382..74c2307b 100644
--- a/src-ui/logics/configs/useSpeakerThreshold.js
+++ b/src-ui/logics/configs/useSpeakerThreshold.js
@@ -1,9 +1,10 @@
-import { useStore_SpeakerThreshold } from "@store";
+import { useStore_SpeakerThreshold, useStore_EnableAutomaticSpeakerThreshold } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useSpeakerThreshold = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { updateSpeakerThreshold, currentSpeakerThreshold } = useStore_SpeakerThreshold();
+ const { updateEnableAutomaticSpeakerThreshold, currentEnableAutomaticSpeakerThreshold } = useStore_EnableAutomaticSpeakerThreshold();
const getSpeakerThreshold = () => {
asyncStdoutToPython("/config/input_speaker_energy_threshold");
@@ -13,10 +14,29 @@ export const useSpeakerThreshold = () => {
asyncStdoutToPython("/controller/callback_set_speaker_energy_threshold", speaker_threshold);
};
+ const getEnableAutomaticSpeakerThreshold = () => {
+ updateEnableAutomaticSpeakerThreshold(() => new Promise(() => {}));
+ asyncStdoutToPython("/config/input_speaker_dynamic_energy_threshold");
+ };
+
+ const toggleEnableAutomaticSpeakerThreshold = () => {
+ updateEnableAutomaticSpeakerThreshold(() => new Promise(() => {}));
+ if (currentEnableAutomaticSpeakerThreshold.data) {
+ asyncStdoutToPython("/controller/callback_disable_speaker_dynamic_energy_threshold");
+ } else {
+ asyncStdoutToPython("/controller/callback_enable_speaker_dynamic_energy_threshold");
+ }
+ };
+
return {
currentSpeakerThreshold,
getSpeakerThreshold,
setSpeakerThreshold,
updateSpeakerThreshold,
+
+ currentEnableAutomaticSpeakerThreshold,
+ getEnableAutomaticSpeakerThreshold,
+ toggleEnableAutomaticSpeakerThreshold,
+ updateEnableAutomaticSpeakerThreshold,
};
};
\ No newline at end of file
diff --git a/src-ui/logics/useReceiveRoutes.js b/src-ui/logics/useReceiveRoutes.js
index badd556b..fe05b0b1 100644
--- a/src-ui/logics/useReceiveRoutes.js
+++ b/src-ui/logics/useReceiveRoutes.js
@@ -36,8 +36,10 @@ export const useReceiveRoutes = () => {
const { updateSelectedMicDevice } = useSelectedMicDevice();
const { updateSpeakerDeviceList } = useSpeakerDeviceList();
const { updateSelectedSpeakerDevice } = useSelectedSpeakerDevice();
- const { updateMicThreshold } = useMicThreshold();
- const { updateSpeakerThreshold } = useSpeakerThreshold();
+
+ const { updateMicThreshold, updateEnableAutomaticMicThreshold } = useMicThreshold();
+ const { updateSpeakerThreshold, updateEnableAutomaticSpeakerThreshold } = useSpeakerThreshold();
+
const { updateEnableAutoClearMessageBox } = useEnableAutoClearMessageBox();
const { updateSendMessageButtonType } = useSendMessageButtonType();
@@ -94,6 +96,12 @@ export const useReceiveRoutes = () => {
"/config/input_speaker_energy_threshold": updateSpeakerThreshold,
"/controller/callback_set_speaker_energy_threshold": updateSpeakerThreshold,
+ "/config/input_mic_dynamic_energy_threshold": updateEnableAutomaticMicThreshold,
+ "/controller/callback_enable_mic_dynamic_energy_threshold": updateEnableAutomaticMicThreshold,
+ "/controller/callback_disable_mic_dynamic_energy_threshold": updateEnableAutomaticMicThreshold,
+ "/config/input_speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
+ "/controller/callback_enable_speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
+ "/controller/callback_disable_speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
"/controller/callback_messagebox_send": updateSentMessageLogById,
"/action/transcription_send_mic_message": addSentMessageLog,
diff --git a/src-ui/store.js b/src-ui/store.js
index 9a161d83..9fc296c1 100644
--- a/src-ui/store.js
+++ b/src-ui/store.js
@@ -133,6 +133,8 @@ export const { atomInstance: Atom_SpeakerThresholdCheckStatus, useHook: useStore
export const { atomInstance: Atom_MicThreshold, useHook: useStore_MicThreshold } = createAtomWithHook(0, "MicThreshold");
export const { atomInstance: Atom_SpeakerThreshold, useHook: useStore_SpeakerThreshold } = createAtomWithHook(0, "SpeakerThreshold");
+export const { atomInstance: Atom_EnableAutomaticMicThreshold, useHook: useStore_EnableAutomaticMicThreshold } = createAsyncAtomWithHook(false, "EnableAutomaticMicThreshold");
+export const { atomInstance: Atom_EnableAutomaticSpeakerThreshold, useHook: useStore_EnableAutomaticSpeakerThreshold } = createAsyncAtomWithHook(false, "EnableAutomaticSpeakerThreshold");
export const { atomInstance: Atom_SendMessageFormat, useHook: useStore_SendMessageFormat } = createAtomWithHook({
before: "",
diff --git a/src-ui/utils/mixins.scss b/src-ui/utils/mixins.scss
index c1776870..72420f7f 100644
--- a/src-ui/utils/mixins.scss
+++ b/src-ui/utils/mixins.scss
@@ -76,6 +76,9 @@ $toggle_control_size: $toggle_height - calc($toggle_gutter * 2);
background: $toggle_control_color;
transition: left $toggle_control_speed $toggle_control_ease;
}
+ &.is_loading:after{
+ background-color: var(--dark_600_color);
+ }
&.is_hovered {
background-color: var(--dark_725_color);
}