style: copy

This commit is contained in:
zhom
2026-04-11 17:12:21 +04:00
parent 404e12dc2d
commit cff3f521c1
12 changed files with 61 additions and 12 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
### Maintenance ### Maintenance
- chore: versiom bump - chore: version bump
- chore: serialize changelog and flake jobs - chore: serialize changelog and flake jobs
- chore: update flake.nix for v0.20.2 [skip ci] (#273) - chore: update flake.nix for v0.20.2 [skip ci] (#273)
+3 -1
View File
@@ -2,6 +2,7 @@
import { invoke } from "@tauri-apps/api/core"; import { invoke } from "@tauri-apps/api/core";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { toast } from "sonner"; import { toast } from "sonner";
import { LoadingButton } from "@/components/loading-button"; import { LoadingButton } from "@/components/loading-button";
import { import {
@@ -31,6 +32,7 @@ export function DeleteGroupDialog({
group, group,
onGroupDeleted, onGroupDeleted,
}: DeleteGroupDialogProps) { }: DeleteGroupDialogProps) {
const { t } = useTranslation();
const [associatedProfiles, setAssociatedProfiles] = useState< const [associatedProfiles, setAssociatedProfiles] = useState<
BrowserProfile[] BrowserProfile[]
>([]); >([]);
@@ -155,7 +157,7 @@ export function DeleteGroupDialog({
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
<RadioGroupItem value="move" id="move" /> <RadioGroupItem value="move" id="move" />
<Label htmlFor="move" className="text-sm"> <Label htmlFor="move" className="text-sm">
Move profiles to Default group {t("groups.moveToDefault")}
</Label> </Label>
</div> </div>
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
+11 -3
View File
@@ -2,6 +2,7 @@
import { invoke } from "@tauri-apps/api/core"; import { invoke } from "@tauri-apps/api/core";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { GoPlus } from "react-icons/go"; import { GoPlus } from "react-icons/go";
import { toast } from "sonner"; import { toast } from "sonner";
import { CreateGroupDialog } from "@/components/create-group-dialog"; import { CreateGroupDialog } from "@/components/create-group-dialog";
@@ -40,6 +41,7 @@ export function GroupAssignmentDialog({
onAssignmentComplete, onAssignmentComplete,
profiles = [], profiles = [],
}: GroupAssignmentDialogProps) { }: GroupAssignmentDialogProps) {
const { t } = useTranslation();
const [groups, setGroups] = useState<ProfileGroup[]>([]); const [groups, setGroups] = useState<ProfileGroup[]>([]);
const [selectedGroupId, setSelectedGroupId] = useState<string | null>(null); const [selectedGroupId, setSelectedGroupId] = useState<string | null>(null);
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
@@ -72,10 +74,13 @@ export function GroupAssignmentDialog({
const groupName = selectedGroupId const groupName = selectedGroupId
? groups.find((g) => g.id === selectedGroupId)?.name || "Unknown Group" ? groups.find((g) => g.id === selectedGroupId)?.name || "Unknown Group"
: "Default"; : t("groups.defaultGroup");
toast.success( toast.success(
`Successfully assigned ${selectedProfiles.length} profile(s) to ${groupName}`, t("groups.assignSuccess", {
count: selectedProfiles.length,
group: groupName,
}),
); );
onAssignmentComplete(); onAssignmentComplete();
onClose(); onClose();
@@ -96,6 +101,7 @@ export function GroupAssignmentDialog({
groups, groups,
onAssignmentComplete, onAssignmentComplete,
onClose, onClose,
t,
]); ]);
useEffect(() => { useEffect(() => {
@@ -166,7 +172,9 @@ export function GroupAssignmentDialog({
<SelectValue placeholder="Select a group" /> <SelectValue placeholder="Select a group" />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="default">Default (No Group)</SelectItem> <SelectItem value="default">
{t("groups.defaultGroupNoGroup")}
</SelectItem>
{groups.map((group) => ( {groups.map((group) => (
<SelectItem key={group.id} value={group.id}> <SelectItem key={group.id} value={group.id}>
{group.name} {group.name}
+5 -1
View File
@@ -1,6 +1,7 @@
"use client"; "use client";
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { Badge } from "@/components/ui/badge"; import { Badge } from "@/components/ui/badge";
import type { GroupWithCount } from "@/types"; import type { GroupWithCount } from "@/types";
@@ -18,6 +19,7 @@ export function GroupBadges({
groups, groups,
isLoading, isLoading,
}: GroupBadgesProps) { }: GroupBadgesProps) {
const { t } = useTranslation();
const scrollContainerRef = useRef<HTMLDivElement>(null); const scrollContainerRef = useRef<HTMLDivElement>(null);
const [showLeftFade, setShowLeftFade] = useState(false); const [showLeftFade, setShowLeftFade] = useState(false);
const [showRightFade, setShowRightFade] = useState(false); const [showRightFade, setShowRightFade] = useState(false);
@@ -181,7 +183,9 @@ export function GroupBadges({
} }
}} }}
> >
<span>{group.name}</span> <span>
{group.id === "default" ? t("groups.defaultGroup") : group.name}
</span>
<span className="bg-background/20 text-xs px-1.5 py-0.5 rounded-sm"> <span className="bg-background/20 text-xs px-1.5 py-0.5 rounded-sm">
{group.count} {group.count}
</span> </span>
+6 -6
View File
@@ -3,6 +3,7 @@
import { invoke } from "@tauri-apps/api/core"; import { invoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event"; import { listen } from "@tauri-apps/api/event";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { GoPlus } from "react-icons/go"; import { GoPlus } from "react-icons/go";
import { LuPencil, LuTrash2 } from "react-icons/lu"; import { LuPencil, LuTrash2 } from "react-icons/lu";
import { CreateGroupDialog } from "@/components/create-group-dialog"; import { CreateGroupDialog } from "@/components/create-group-dialog";
@@ -90,6 +91,7 @@ export function GroupManagementDialog({
onClose, onClose,
onGroupManagementComplete, onGroupManagementComplete,
}: GroupManagementDialogProps) { }: GroupManagementDialogProps) {
const { t } = useTranslation();
const [groups, setGroups] = useState<GroupWithCount[]>([]); const [groups, setGroups] = useState<GroupWithCount[]>([]);
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
@@ -233,10 +235,9 @@ export function GroupManagementDialog({
<Dialog open={isOpen} onOpenChange={onClose}> <Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent className="max-w-2xl max-h-[90vh] flex flex-col"> <DialogContent className="max-w-2xl max-h-[90vh] flex flex-col">
<DialogHeader> <DialogHeader>
<DialogTitle>Manage Profile Groups</DialogTitle> <DialogTitle>{t("groups.management")}</DialogTitle>
<DialogDescription> <DialogDescription>
Create, edit, and delete profile groups. Profiles without a group {t("groups.noGroupDescription")}
will appear in the "Default" group.
</DialogDescription> </DialogDescription>
</DialogHeader> </DialogHeader>
@@ -265,12 +266,11 @@ export function GroupManagementDialog({
{/* Groups list */} {/* Groups list */}
{isLoading ? ( {isLoading ? (
<div className="text-sm text-muted-foreground"> <div className="text-sm text-muted-foreground">
Loading groups... {t("common.loading")}
</div> </div>
) : groups.length === 0 ? ( ) : groups.length === 0 ? (
<div className="text-sm text-muted-foreground"> <div className="text-sm text-muted-foreground">
No groups created yet. Create your first group using the button {t("groups.noGroupsDescription")}
above.
</div> </div>
) : ( ) : (
<div className="border rounded-md"> <div className="border rounded-md">
+5
View File
@@ -323,6 +323,11 @@
"add": "Add Group", "add": "Add Group",
"edit": "Edit Group", "edit": "Edit Group",
"delete": "Delete Group", "delete": "Delete Group",
"defaultGroup": "Default",
"defaultGroupNoGroup": "Default (No Group)",
"moveToDefault": "Move profiles to Default group",
"noGroupDescription": "Profiles without a group will appear in the \"Default\" group.",
"assignSuccess": "Successfully assigned {{count}} profile(s) to {{group}}",
"noGroups": "No groups created", "noGroups": "No groups created",
"noGroupsDescription": "Create a group to organize your profiles.", "noGroupsDescription": "Create a group to organize your profiles.",
"form": { "form": {
+5
View File
@@ -323,6 +323,11 @@
"add": "Agregar Grupo", "add": "Agregar Grupo",
"edit": "Editar Grupo", "edit": "Editar Grupo",
"delete": "Eliminar Grupo", "delete": "Eliminar Grupo",
"defaultGroup": "Predeterminado",
"defaultGroupNoGroup": "Predeterminado (Sin Grupo)",
"moveToDefault": "Mover perfiles al grupo Predeterminado",
"noGroupDescription": "Los perfiles sin grupo aparecerán en el grupo \"Predeterminado\".",
"assignSuccess": "Se asignaron {{count}} perfil(es) a {{group}} exitosamente",
"noGroups": "No hay grupos creados", "noGroups": "No hay grupos creados",
"noGroupsDescription": "Crea un grupo para organizar tus perfiles.", "noGroupsDescription": "Crea un grupo para organizar tus perfiles.",
"form": { "form": {
+5
View File
@@ -323,6 +323,11 @@
"add": "Ajouter un groupe", "add": "Ajouter un groupe",
"edit": "Modifier le groupe", "edit": "Modifier le groupe",
"delete": "Supprimer le groupe", "delete": "Supprimer le groupe",
"defaultGroup": "Par défaut",
"defaultGroupNoGroup": "Par défaut (Aucun groupe)",
"moveToDefault": "Déplacer les profils vers le groupe Par défaut",
"noGroupDescription": "Les profils sans groupe apparaîtront dans le groupe « Par défaut ».",
"assignSuccess": "{{count}} profil(s) assigné(s) à {{group}} avec succès",
"noGroups": "Aucun groupe créé", "noGroups": "Aucun groupe créé",
"noGroupsDescription": "Créez un groupe pour organiser vos profils.", "noGroupsDescription": "Créez un groupe pour organiser vos profils.",
"form": { "form": {
+5
View File
@@ -323,6 +323,11 @@
"add": "グループを追加", "add": "グループを追加",
"edit": "グループを編集", "edit": "グループを編集",
"delete": "グループを削除", "delete": "グループを削除",
"defaultGroup": "デフォルト",
"defaultGroupNoGroup": "デフォルト(グループなし)",
"moveToDefault": "プロファイルをデフォルトグループに移動",
"noGroupDescription": "グループに属していないプロファイルは「デフォルト」グループに表示されます。",
"assignSuccess": "{{count}} 件のプロファイルを {{group}} に割り当てました",
"noGroups": "グループがありません", "noGroups": "グループがありません",
"noGroupsDescription": "プロファイルを整理するためのグループを作成してください。", "noGroupsDescription": "プロファイルを整理するためのグループを作成してください。",
"form": { "form": {
+5
View File
@@ -323,6 +323,11 @@
"add": "Adicionar Grupo", "add": "Adicionar Grupo",
"edit": "Editar Grupo", "edit": "Editar Grupo",
"delete": "Excluir Grupo", "delete": "Excluir Grupo",
"defaultGroup": "Padrão",
"defaultGroupNoGroup": "Padrão (Sem Grupo)",
"moveToDefault": "Mover perfis para o grupo Padrão",
"noGroupDescription": "Perfis sem grupo aparecerão no grupo \"Padrão\".",
"assignSuccess": "{{count}} perfil(s) atribuído(s) a {{group}} com sucesso",
"noGroups": "Nenhum grupo criado", "noGroups": "Nenhum grupo criado",
"noGroupsDescription": "Crie um grupo para organizar seus perfis.", "noGroupsDescription": "Crie um grupo para organizar seus perfis.",
"form": { "form": {
+5
View File
@@ -323,6 +323,11 @@
"add": "Добавить группу", "add": "Добавить группу",
"edit": "Редактировать группу", "edit": "Редактировать группу",
"delete": "Удалить группу", "delete": "Удалить группу",
"defaultGroup": "По умолчанию",
"defaultGroupNoGroup": "По умолчанию (Без группы)",
"moveToDefault": "Переместить профили в группу по умолчанию",
"noGroupDescription": "Профили без группы будут отображаться в группе «По умолчанию».",
"assignSuccess": "Успешно назначено {{count}} профиль(ей) в {{group}}",
"noGroups": "Группы не созданы", "noGroups": "Группы не созданы",
"noGroupsDescription": "Создайте группу для организации профилей.", "noGroupsDescription": "Создайте группу для организации профилей.",
"form": { "form": {
+5
View File
@@ -323,6 +323,11 @@
"add": "添加分组", "add": "添加分组",
"edit": "编辑分组", "edit": "编辑分组",
"delete": "删除分组", "delete": "删除分组",
"defaultGroup": "默认",
"defaultGroupNoGroup": "默认(无分组)",
"moveToDefault": "将配置文件移至默认分组",
"noGroupDescription": "未分组的配置文件将显示在「默认」分组中。",
"assignSuccess": "已成功将 {{count}} 个配置文件分配到 {{group}}",
"noGroups": "暂无分组", "noGroups": "暂无分组",
"noGroupsDescription": "创建分组来组织您的配置文件。", "noGroupsDescription": "创建分组来组织您的配置文件。",
"form": { "form": {