Compare commits

..

3 Commits

Author SHA1 Message Date
Marc Brooks 56a13da763
Merge 83d544f0f7 into 403141c96a 2025-10-15 15:10:09 +00:00
Marc Brooks 83d544f0f7
Add inlang/paraglide-js localization
Remove the temporary directory after extracting buildkit
Localize the extension popovers.
Update package and fix tsconfig.json
Expand development directory guide
Move messages under localization
Popovers and sidebar
Update Chinese translations
Accidentally lost the changes that @ym provided, brought them back
File formatting pass
Localized all components, hooks, providers, hooks
Localize all pages except Settings
Bump packages
Settings Access page
Settings local auth page
Fix ref lint warning
Settings Advanced page
Fix UI lint warnings there were a bunch of ref and useEffect violations.
Settings appearance page
Settings general pages
Settings hardware page
Settings keyboard page
Settings macros pages
Settings mouse page
Settings page
Settings video page
Settings network page
Fix compilation issues
Ran machine translate
Use getLocale for date, relative time, and money formatting
Fix eslint
Delete unused messages
Added setting to choose locale
Merged in dev hotfix
Fix update status rendering
2025-10-15 10:09:56 -05:00
Adam Shiervani 403141c96a
refactor: safe Comboxbox onChange (#886) 2025-10-14 22:45:48 -05:00
2 changed files with 25 additions and 24 deletions

View File

@ -2,7 +2,7 @@ import { useMemo } from "react";
import { LuArrowUp, LuArrowDown, LuX, LuTrash2 } from "react-icons/lu"; import { LuArrowUp, LuArrowDown, LuX, LuTrash2 } from "react-icons/lu";
import { Button } from "@components/Button"; import { Button } from "@components/Button";
import { Combobox } from "@components/Combobox"; import { Combobox, ComboboxOption } from "@components/Combobox";
import Card from "@components/Card"; import Card from "@components/Card";
import FieldLabel from "@components/FieldLabel"; import FieldLabel from "@components/FieldLabel";
import { SelectMenuBasic } from "@components/SelectMenuBasic"; import { SelectMenuBasic } from "@components/SelectMenuBasic";
@ -179,6 +179,7 @@ export function MacroStepCard({
</div> </div>
</div> </div>
<div className="w-full flex flex-col gap-1"> <div className="w-full flex flex-col gap-1">
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<FieldLabel label={m.macro_step_keys_label()} description={m.macro_step_keys_description({ max: MAX_KEYS_PER_STEP })} /> <FieldLabel label={m.macro_step_keys_label()} description={m.macro_step_keys_description({ max: MAX_KEYS_PER_STEP })} />
@ -209,8 +210,9 @@ export function MacroStepCard({
)} )}
<div className="relative w-full"> <div className="relative w-full">
<Combobox <Combobox
onChange={(value) => { onChange={(option) => {
onKeySelect({ value: value as string | null }); const selectedOption = option as ComboboxOption | null;
onKeySelect({ value: selectedOption?.value ?? null });
onKeyQueryChange(''); onKeyQueryChange('');
}} }}
displayValue={() => keyQuery} displayValue={() => keyQuery}
@ -243,4 +245,4 @@ export function MacroStepCard({
</div> </div>
</Card> </Card>
); );
} }

View File

@ -189,8 +189,6 @@ function UpdatingDeviceState({
otaState: UpdateState["otaState"]; otaState: UpdateState["otaState"];
onMinimizeUpgradeDialog: () => void; onMinimizeUpgradeDialog: () => void;
}) { }) {
const formatProgress = (progress: number) => `${Math.round(progress)}%`;
const calculateOverallProgress = (type: "system" | "app") => { const calculateOverallProgress = (type: "system" | "app") => {
const downloadProgress = Math.round((otaState[`${type}DownloadProgress`] || 0) * 100); const downloadProgress = Math.round((otaState[`${type}DownloadProgress`] || 0) * 100);
const updateProgress = Math.round((otaState[`${type}UpdateProgress`] || 0) * 100); const updateProgress = Math.round((otaState[`${type}UpdateProgress`] || 0) * 100);
@ -258,6 +256,11 @@ function UpdatingDeviceState({
); );
}; };
const systemOverallProgress = calculateOverallProgress("system");
const systemUpdateStatus = getUpdateStatus("system");
const appOverallProgress = calculateOverallProgress("app");
const appUpdateStatus = getUpdateStatus("app");
return ( return (
<div className="flex flex-col items-start justify-start space-y-4 text-left"> <div className="flex flex-col items-start justify-start space-y-4 text-left">
<div className="w-full max-w-sm space-y-4"> <div className="w-full max-w-sm space-y-4">
@ -293,7 +296,7 @@ function UpdatingDeviceState({
<p className="text-sm font-semibold text-black dark:text-white"> <p className="text-sm font-semibold text-black dark:text-white">
{m.general_update_system_update_title()} {m.general_update_system_update_title()}
</p> </p>
{calculateOverallProgress("system") < 100 ? ( {systemOverallProgress < 100 ? (
<LoadingSpinner className="h-4 w-4 text-blue-700 dark:text-blue-500" /> <LoadingSpinner className="h-4 w-4 text-blue-700 dark:text-blue-500" />
) : ( ) : (
<CheckCircleIcon className="h-4 w-4 text-blue-700 dark:text-blue-500" /> <CheckCircleIcon className="h-4 w-4 text-blue-700 dark:text-blue-500" />
@ -302,16 +305,14 @@ function UpdatingDeviceState({
<div className="h-2.5 w-full overflow-hidden rounded-full bg-slate-300 dark:bg-slate-600"> <div className="h-2.5 w-full overflow-hidden rounded-full bg-slate-300 dark:bg-slate-600">
<div <div
className="h-2.5 rounded-full bg-blue-700 transition-all duration-500 ease-linear dark:bg-blue-500" className="h-2.5 rounded-full bg-blue-700 transition-all duration-500 ease-linear dark:bg-blue-500"
style={{ style={{ width: `${systemOverallProgress}%` }}
width: formatProgress(calculateOverallProgress("system")),
}}
></div> ></div>
</div> </div>
<div className="flex justify-between text-sm text-slate-600 dark:text-slate-300"> <div className="flex justify-between text-sm text-slate-600 dark:text-slate-300">
<span>{getUpdateStatus("system")}</span>{" "} <span>{systemUpdateStatus}</span>{" "}
{calculateOverallProgress("system") < 100 ? ( {systemOverallProgress < 100
<span>{formatProgress(calculateOverallProgress("system"))}</span> ? (<span>{`${systemOverallProgress}%`}</span>)
) : null} : null}
</div> </div>
</div> </div>
)} )}
@ -325,7 +326,7 @@ function UpdatingDeviceState({
<p className="text-sm font-semibold text-black dark:text-white"> <p className="text-sm font-semibold text-black dark:text-white">
{m.general_update_app_update_title()} {m.general_update_app_update_title()}
</p> </p>
{calculateOverallProgress("app") < 100 ? ( {appOverallProgress < 100 ? (
<LoadingSpinner className="h-4 w-4 text-blue-700 dark:text-blue-500" /> <LoadingSpinner className="h-4 w-4 text-blue-700 dark:text-blue-500" />
) : ( ) : (
<CheckCircleIcon className="h-4 w-4 text-blue-700 dark:text-blue-500" /> <CheckCircleIcon className="h-4 w-4 text-blue-700 dark:text-blue-500" />
@ -334,16 +335,14 @@ function UpdatingDeviceState({
<div className="h-2.5 w-full overflow-hidden rounded-full bg-slate-300 dark:bg-slate-600"> <div className="h-2.5 w-full overflow-hidden rounded-full bg-slate-300 dark:bg-slate-600">
<div <div
className="h-2.5 rounded-full bg-blue-700 transition-all duration-500 ease-linear dark:bg-blue-500" className="h-2.5 rounded-full bg-blue-700 transition-all duration-500 ease-linear dark:bg-blue-500"
style={{ style={{ width: `${appOverallProgress}%` }}
width: formatProgress(calculateOverallProgress("app")),
}}
></div> ></div>
</div> </div>
<div className="flex justify-between text-sm text-slate-600 dark:text-slate-300"> <div className="flex justify-between text-sm text-slate-600 dark:text-slate-300">
<span>{getUpdateStatus("app")}</span>{" "} <span>{appUpdateStatus}</span>{" "}
{calculateOverallProgress("system") < 100 ? ( {appOverallProgress < 100
<span>{formatProgress(calculateOverallProgress("app"))}</span> ? (<span>{`${appOverallProgress}%`}</span>)
) : null} : null}
</div> </div>
</div> </div>
</> </>
@ -411,13 +410,13 @@ function UpdateAvailableState({
<p className="mb-4 text-sm text-slate-600 dark:text-slate-300"> <p className="mb-4 text-sm text-slate-600 dark:text-slate-300">
{versionInfo?.systemUpdateAvailable ? ( {versionInfo?.systemUpdateAvailable ? (
<> <>
<span className="font-semibold">{m.general_update_system_type()}</span>:&nbsp;{versionInfo?.remote?.systemVersion} <span className="font-semibold">{m.general_update_system_type()}</span>: {versionInfo?.remote?.systemVersion}
<br /> <br />
</> </>
) : null} ) : null}
{versionInfo?.appUpdateAvailable ? ( {versionInfo?.appUpdateAvailable ? (
<> <>
<span className="font-semibold">{m.general_update_application_type()}</span>:&nbsp;{versionInfo?.remote?.appVersion} <span className="font-semibold">{m.general_update_application_type()}</span>: {versionInfo?.remote?.appVersion}
</> </>
) : null} ) : null}
</p> </p>