From 6e0d5cee382fa9a4bd50210179f4ceebb04ded14 Mon Sep 17 00:00:00 2001 From: Tenzin Youdon <94886097+Tech-lo@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:29:21 +0530 Subject: [PATCH 01/37] standardize the tags casing (#157) --- src/components/routes/create-plan/CreatePlan.test.tsx | 2 +- src/components/ui/molecules/tag-input/TagInput.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/routes/create-plan/CreatePlan.test.tsx b/src/components/routes/create-plan/CreatePlan.test.tsx index 63ead223..3351247e 100644 --- a/src/components/routes/create-plan/CreatePlan.test.tsx +++ b/src/components/routes/create-plan/CreatePlan.test.tsx @@ -320,7 +320,7 @@ describe("CreatePlan Component", () => { const tagInput = screen.getByPlaceholderText("Add a tag"); fireEvent.change(tagInput, { target: { value: "tag1" } }); fireEvent.keyDown(tagInput, { key: "Enter", code: "Enter" }); - expect(screen.getByText("tag1")).toBeInTheDocument(); + expect(screen.getByText("Tag1")).toBeInTheDocument(); }); it("shows no image preview initially", () => { diff --git a/src/components/ui/molecules/tag-input/TagInput.tsx b/src/components/ui/molecules/tag-input/TagInput.tsx index ab6e5f5a..5c860010 100644 --- a/src/components/ui/molecules/tag-input/TagInput.tsx +++ b/src/components/ui/molecules/tag-input/TagInput.tsx @@ -13,7 +13,13 @@ const TagInput = ({ value = [], onChange }: TagInputProps) => { const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === "Enter" && inputValue.trim()) { e.preventDefault(); - onChange?.([inputValue.trim(), ...value]); + const trimmed = inputValue.trim(); + const normalizedTag = + trimmed.charAt(0).toUpperCase() + trimmed.slice(1).toLowerCase(); + + if (!value.includes(normalizedTag)) { + onChange?.([normalizedTag, ...value]); + } setInputValue(""); } }; From 7e43129231d0d5a5bb7b185e6c8ce3975892dd11 Mon Sep 17 00:00:00 2001 From: Tenzin Youdon <94886097+Tech-lo@users.noreply.github.com> Date: Fri, 3 Apr 2026 20:53:58 +0530 Subject: [PATCH 02/37] update (#158) --- src/components/routes/task/api/taskApi.ts | 4 ++-- .../routes/task/components/view/TaskForm.tsx | 10 +++++----- .../ui/molecules/content-sub/ContentTypeSelector.tsx | 2 +- .../ui/molecules/subtask-card/SubTaskCard.tsx | 2 +- .../webuddhist-source/SourceSelectorSheet.tsx | 2 +- .../ui/molecules/webuddhist-source/sourceItem.tsx | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/routes/task/api/taskApi.ts b/src/components/routes/task/api/taskApi.ts index 7c37ee27..c4f5ce69 100644 --- a/src/components/routes/task/api/taskApi.ts +++ b/src/components/routes/task/api/taskApi.ts @@ -46,7 +46,7 @@ export const createSubTasks = async ( duration?: string; source_text_id?: string | null; pecha_segment_id?: string | null; - segment_id?: string | null; + segment_ids?: string[] | null; }[], ) => { const { data } = await axiosInstance.post( @@ -72,7 +72,7 @@ export const updateSubTasks = async ( duration?: string; source_text_id?: string | null; pecha_segment_id?: string | null; - segment_id?: string | null; + segment_ids?: string[] | null; }[], ) => { await axiosInstance.put( diff --git a/src/components/routes/task/components/view/TaskForm.tsx b/src/components/routes/task/components/view/TaskForm.tsx index d4ba6a5b..6ecb94d6 100644 --- a/src/components/routes/task/components/view/TaskForm.tsx +++ b/src/components/routes/task/components/view/TaskForm.tsx @@ -84,7 +84,7 @@ const TaskForm = ({ ...(subTask.content_type === "SOURCE_REFERENCE" && { source_text_id: subTask.source_text_id || null, pecha_segment_id: subTask.pecha_segment_id || null, - segment_id: subTask.segment_id || null, + segment_ids: subTask.segment_ids || null, }), })); await createSubTasks(taskResponse.id, subTasksPayload); @@ -117,7 +117,7 @@ const TaskForm = ({ ...(subTask.content_type === "SOURCE_REFERENCE" && { source_text_id: subTask.source_text_id || null, pecha_segment_id: subTask.pecha_segment_id || null, - segment_id: subTask.segment_id || null, + segment_ids: subTask.segment_ids || null, }), })); await updateSubTasks(editingTask.id, subTasksPayload); @@ -194,7 +194,7 @@ const TaskForm = ({ content: data.content, source_text_id: data.source_text_id || null, pecha_segment_id: data.pecha_segment_id || null, - segment_id: data.segment_id || null, + segment_ids: data.segment_ids || null, }; default: return { @@ -212,7 +212,7 @@ const TaskForm = ({ content: string; pecha_segment_id: string; text_id: string; - segment_id: string; + segment_ids: string[]; } const handleAddSubTask = (content_type: any, sourceData?: SourceData) => { @@ -256,7 +256,7 @@ const TaskForm = ({ content: sourceData?.content || "", source_text_id: sourceData?.text_id || null, pecha_segment_id: sourceData?.pecha_segment_id || null, - segment_id: sourceData?.segment_id || null, + segment_ids: sourceData?.segment_ids || null, }; break; } diff --git a/src/components/ui/molecules/content-sub/ContentTypeSelector.tsx b/src/components/ui/molecules/content-sub/ContentTypeSelector.tsx index 62d6e135..ed145a5a 100644 --- a/src/components/ui/molecules/content-sub/ContentTypeSelector.tsx +++ b/src/components/ui/molecules/content-sub/ContentTypeSelector.tsx @@ -10,7 +10,7 @@ interface SourceData { content: string; pecha_segment_id: string; text_id: string; - segment_id: string; + segment_ids: string[]; } interface ContentTypeSelectorProps { diff --git a/src/components/ui/molecules/subtask-card/SubTaskCard.tsx b/src/components/ui/molecules/subtask-card/SubTaskCard.tsx index 92c2b449..f88e4749 100644 --- a/src/components/ui/molecules/subtask-card/SubTaskCard.tsx +++ b/src/components/ui/molecules/subtask-card/SubTaskCard.tsx @@ -46,7 +46,7 @@ interface SourceSubTask { display_order?: number; source_text_id?: string | null; pecha_segment_id?: string | null; - segment_id?: string | null; + segment_ids?: string[] | null; } export type SubTask = | VideoSubTask diff --git a/src/components/ui/molecules/webuddhist-source/SourceSelectorSheet.tsx b/src/components/ui/molecules/webuddhist-source/SourceSelectorSheet.tsx index 5a0ef26c..d75d9248 100644 --- a/src/components/ui/molecules/webuddhist-source/SourceSelectorSheet.tsx +++ b/src/components/ui/molecules/webuddhist-source/SourceSelectorSheet.tsx @@ -13,7 +13,7 @@ interface SourceData { content: string; pecha_segment_id: string; text_id: string; - segment_id: string; + segment_ids: string[]; } interface SourceSelectorSheetProps { diff --git a/src/components/ui/molecules/webuddhist-source/sourceItem.tsx b/src/components/ui/molecules/webuddhist-source/sourceItem.tsx index 9cc49b62..aafeb49a 100644 --- a/src/components/ui/molecules/webuddhist-source/sourceItem.tsx +++ b/src/components/ui/molecules/webuddhist-source/sourceItem.tsx @@ -19,7 +19,7 @@ const SourceItem = ({ source, onSegment }: any) => { content: segment.content, pecha_segment_id: segment.pecha_segment_id, text_id: source.text.text_id, - segment_id: segment.segment_id, + segment_ids: [segment.segment_id], }) } > From 8818e2b95d1d204c151c147a218e26aa3b1b55ab Mon Sep 17 00:00:00 2001 From: Harshal Madgulkar Date: Tue, 28 Apr 2026 10:24:19 +0530 Subject: [PATCH 03/37] fix(ui): improve responsiveness in profile edit form and user card layout; add patch files to gitignore --- .gitignore | 1 + .../ui/molecules/profile-edit-form/ProfileEditForm.tsx | 2 +- src/components/ui/molecules/user-card/UserCard.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fdbb5352..6950dfae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Logs logs *.log +*.patch npm-debug.log* yarn-debug.log* yarn-error.log* diff --git a/src/components/ui/molecules/profile-edit-form/ProfileEditForm.tsx b/src/components/ui/molecules/profile-edit-form/ProfileEditForm.tsx index 20fe388c..1578ebaf 100644 --- a/src/components/ui/molecules/profile-edit-form/ProfileEditForm.tsx +++ b/src/components/ui/molecules/profile-edit-form/ProfileEditForm.tsx @@ -159,7 +159,7 @@ const ProfileEditForm = ({
diff --git a/src/components/ui/molecules/user-card/UserCard.tsx b/src/components/ui/molecules/user-card/UserCard.tsx index bd42d28a..08eff892 100644 --- a/src/components/ui/molecules/user-card/UserCard.tsx +++ b/src/components/ui/molecules/user-card/UserCard.tsx @@ -4,7 +4,7 @@ import { getIcon } from "@/lib/utils"; const UserCard = ({ userInfo }: any) => { return (
-
+
Date: Tue, 28 Apr 2026 14:16:29 +0530 Subject: [PATCH 04/37] feat(dashboard): show empty state with create plan action; clean up table logic and refine layout responsiveness --- src/components/routes/dashboard/Dashboard.tsx | 43 +++++++++++++------ src/components/ui/atoms/studio-card.tsx | 4 +- .../dashboard-table/DashBoardTable.tsx | 24 ----------- 3 files changed, 33 insertions(+), 38 deletions(-) diff --git a/src/components/routes/dashboard/Dashboard.tsx b/src/components/routes/dashboard/Dashboard.tsx index 561a3a92..27d2e8c0 100644 --- a/src/components/routes/dashboard/Dashboard.tsx +++ b/src/components/routes/dashboard/Dashboard.tsx @@ -7,7 +7,7 @@ import { useTranslate } from "@tolgee/react"; import { Button } from "@/components/ui/atoms/button"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import axiosInstance from "@/config/axios-config"; -import { Link } from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; import { Pagination } from "@/components/ui/molecules/pagination/Pagination"; import AuthButton from "@/components/ui/molecules/auth-button/AuthButton"; import { toast } from "sonner"; @@ -57,6 +57,8 @@ const Dashboard = () => { const [sortBy, setSortBy] = useState(""); const [sortOrder, setSortOrder] = useState(""); + const navigate = useNavigate(); + const handleSort = (column: string) => { if (sortBy === column) { setSortOrder(sortOrder === "asc" ? "desc" : "asc"); @@ -129,17 +131,34 @@ const Dashboard = () => {
-
- +
+ {planData?.plans.length === 0 ? + ( +
+

+ {t("studio.dashboard.no_plan_found")} +

+ navigate("/plan/new")} + variant="outline" + className="mt-2" + > + {t("studio.dashboard.add_plan")} + +
+ ) : ( + + ) + }
0 ? "visible" : "hidden"}> { return (
-
+
-
+
Pecha Studio Logo - -
-

- {t("studio.dashboard.no_plan_found")} -

- navigate("/plan/new")} - variant="outline" - className="mt-2" - > - {t("studio.dashboard.add_plan")} - -
-
- - ); - } - return plans.map((plan) => ( From 043a2a10c8ba6447163a70b10e6881b79be99408 Mon Sep 17 00:00:00 2001 From: Harshal Madgulkar Date: Tue, 28 Apr 2026 14:51:30 +0530 Subject: [PATCH 05/37] feat(pagination): add mobile-friendly icons for previous and next buttons --- src/components/ui/atoms/pagination.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/ui/atoms/pagination.tsx b/src/components/ui/atoms/pagination.tsx index 6d5eb00e..44b04a58 100644 --- a/src/components/ui/atoms/pagination.tsx +++ b/src/components/ui/atoms/pagination.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { FaEllipsis } from "react-icons/fa6"; +import { FaAngleLeft, FaAngleRight, FaEllipsis } from "react-icons/fa6"; import { cn } from "@/lib/utils"; import { Button, buttonVariants } from "@/components/ui/atoms/button"; @@ -76,6 +76,9 @@ function PaginationPrevious({ {...props} > Previous + + + ); } @@ -95,6 +98,9 @@ function PaginationNext({ {...props} > Next + + + ); } From b977d3ec227843571fc886d59e88f4075749fdcc Mon Sep 17 00:00:00 2001 From: Harshal Madgulkar Date: Tue, 28 Apr 2026 15:46:31 +0530 Subject: [PATCH 06/37] fix(create-plan): improve responsive layout and spacing for form sections --- src/components/routes/create-plan/CreatePlan.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/routes/create-plan/CreatePlan.tsx b/src/components/routes/create-plan/CreatePlan.tsx index d569d3f5..5be54b67 100644 --- a/src/components/routes/create-plan/CreatePlan.tsx +++ b/src/components/routes/create-plan/CreatePlan.tsx @@ -196,8 +196,8 @@ const Createplan = () => { } }; return ( -
-
+
+

{t("studio.plan.form_field.details")}

@@ -374,7 +374,7 @@ const Createplan = () => {
-
+
Date: Tue, 28 Apr 2026 17:32:52 +0530 Subject: [PATCH 07/37] feat(image-upload): improve file selection UX and responsive layout; adjust create plan button styles for mobile --- .../routes/create-plan/CreatePlan.tsx | 7 +- .../modals/image-upload/ImageContentData.tsx | 127 +++++++++--------- 2 files changed, 68 insertions(+), 66 deletions(-) diff --git a/src/components/routes/create-plan/CreatePlan.tsx b/src/components/routes/create-plan/CreatePlan.tsx index 5be54b67..d5d765dd 100644 --- a/src/components/routes/create-plan/CreatePlan.tsx +++ b/src/components/routes/create-plan/CreatePlan.tsx @@ -324,6 +324,7 @@ const Createplan = () => { )} /> + { @@ -482,7 +483,7 @@ const Createplan = () => { navigate(`/dashboard`)} > {t("common.button.cancel")} @@ -491,7 +492,7 @@ const Createplan = () => { { /> ) : ( <> - { - if (acceptedFiles && acceptedFiles.length > 0) { - setSelectedFile(acceptedFiles[0]); + {!selectedFile ? + ( + { + if (acceptedFiles && acceptedFiles.length > 0) { + setSelectedFile(acceptedFiles[0]); + } + }} + > + {({ getRootProps, getInputProps }) => ( +
+
+ +

Drag & drop an image here, or click to select

+
+
+ )} +
+ ) : ( +
+ {selectedFile.name} +
+

+ {selectedFile?.name} +

+
+ + +
+
+
+ )} + + - -
-
-
- )} -
- -
+ Upload + )}
From bbff6596e696387db32c3c3958556c2ea0be9006 Mon Sep 17 00:00:00 2001 From: Harshal Madgulkar Date: Tue, 28 Apr 2026 17:44:46 +0530 Subject: [PATCH 08/37] Remove unused import --- src/components/ui/molecules/dashboard-table/DashBoardTable.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ui/molecules/dashboard-table/DashBoardTable.tsx b/src/components/ui/molecules/dashboard-table/DashBoardTable.tsx index a9d202eb..3d946521 100644 --- a/src/components/ui/molecules/dashboard-table/DashBoardTable.tsx +++ b/src/components/ui/molecules/dashboard-table/DashBoardTable.tsx @@ -1,5 +1,4 @@ import { Pecha } from "@/components/ui/shadimport"; -import { IoMdAdd } from "react-icons/io"; import { FaChevronUp, FaChevronDown } from "react-icons/fa6"; import { useNavigate } from "react-router-dom"; import defaultCover from "/default-image.webp"; From b8511addbdb72053acb9870163cc786ff6452beb Mon Sep 17 00:00:00 2001 From: Harshal Madgulkar Date: Tue, 28 Apr 2026 17:51:23 +0530 Subject: [PATCH 09/37] Format changes --- src/components/routes/dashboard/Dashboard.tsx | 52 +++++---- .../modals/image-upload/ImageContentData.tsx | 101 +++++++++--------- 2 files changed, 75 insertions(+), 78 deletions(-) diff --git a/src/components/routes/dashboard/Dashboard.tsx b/src/components/routes/dashboard/Dashboard.tsx index 27d2e8c0..b3646a9a 100644 --- a/src/components/routes/dashboard/Dashboard.tsx +++ b/src/components/routes/dashboard/Dashboard.tsx @@ -132,33 +132,31 @@ const Dashboard = () => {
- {planData?.plans.length === 0 ? - ( -
-

- {t("studio.dashboard.no_plan_found")} -

- navigate("/plan/new")} - variant="outline" - className="mt-2" - > - {t("studio.dashboard.add_plan")} - -
- ) : ( - - ) - } + {planData?.plans.length === 0 ? ( +
+

+ {t("studio.dashboard.no_plan_found")} +

+ navigate("/plan/new")} + variant="outline" + className="mt-2" + > + {t("studio.dashboard.add_plan")} + +
+ ) : ( + + )}
0 ? "visible" : "hidden"}> { /> ) : ( <> - {!selectedFile ? - ( - { - if (acceptedFiles && acceptedFiles.length > 0) { - setSelectedFile(acceptedFiles[0]); - } - }} - > - {({ getRootProps, getInputProps }) => ( -
-
- -

Drag & drop an image here, or click to select

-
-
- )} -
- ) : ( -
- {selectedFile.name} -
-

- {selectedFile?.name} -

-
- - + {!selectedFile ? ( + { + if (acceptedFiles && acceptedFiles.length > 0) { + setSelectedFile(acceptedFiles[0]); + } + }} + > + {({ getRootProps, getInputProps }) => ( +
+
+ +

Drag & drop an image here, or click to select

+
+ )} +
+ ) : ( +
+ {selectedFile.name} +
+

+ {selectedFile?.name} +

+
+ +
- )} +
+ )}