Skip to content

Dev#219

Open
tenkus47 wants to merge 98 commits into
mainfrom
dev
Open

Dev#219
tenkus47 wants to merge 98 commits into
mainfrom
dev

Conversation

@tenkus47

@tenkus47 tenkus47 commented Jun 8, 2026

Copy link
Copy Markdown
Member

No description provided.

harshal-2304 and others added 30 commits May 25, 2026 12:28
* shared component

* ui

* tag removal

* Enhance Dashboard with Series Management and UI Improvements

- Updated Dashboard component to include a new tab for managing series alongside plans.
- Implemented fetching and displaying series data with a new SeriesTable component.
- Refactored add button to a dropdown menu for adding plans and series.
- Improved test cases to reflect changes in button labels and API endpoints.
- Enhanced PlanDeleteDialog to support dynamic entity labels for better reusability.

* integration of plan search, UI not the finalized

* initial commit

* update the filter function for type safety

* Add Dashboard Frontend Plan and Enhance Dashboard Component

- Introduced a comprehensive plan document for the CMS dashboard, detailing goals, backend assumptions, and implementation strategies.
- Refactored Dashboard component to support a unified table for plans and series, including improved filtering and sorting capabilities.
- Implemented a new DashboardContentTable for rendering dashboard data with enhanced UI elements.
- Updated tests to reflect changes in component structure and functionality, ensuring accurate rendering and interaction.
- Added mock data handling for the unified feed to support frontend development without backend dependencies.

* feat(dashboard): add dropdown to create series or plan

- replace the direct Add Plan link with an Add menu for series and plan flows
- restyle the trigger and use dropdown primitives for clearer navigation
- apply prettier formatting and EOF fixes in related create and form UI files

* refactor(create-series): stub series route and tweak dashboard sort table

- replace the full CreateSeries form with a minimal placeholder until the API is ready
- set dashboard sort to recent when the sort select content is clicked
- stop destructuring unused isLoading in the dashboard content table

* feat(create-series): implement series create and edit with CMS integration

- add multi-language series editor with cover upload, plan tabs, and unsaved-change navigation blocking
- add series API module for load, create, update, and full plan snapshot replace with graceful partial failure handling
- rework plan search to store rich plan objects, filter by language, and improve browse and selection UX
- require complete language blocks and a cover image before submit; refine zod validation for languages and image
- remove duplicate series route registration and align dashboard series rows with the unified table type

* feat(create-series): support plan display order and drag reorder

- sort hydrated plans per language using optional display_order from the series detail payload
- document that plan id array order in the replace payload represents display order for the API
- add drag handles to reorder selected plans before save, disabled when only one plan is attached
- remove the desktop-only vertical divider on the series details column for a cleaner split layout

* refactor(create-series): unify series create and update payload with plans

- send name, featured, image_key, and per-language plan ids in one POST or PUT body
- drop the separate plans replace endpoint and client-side author resolution on save
- build plan lists only for languages present in the series name payload
- remove author profile gating from submit enabled state
- show cancel on create as well as edit

* style(create-series): polish series editor and plan picker layout

- align page background, title divider, and language block surfaces with the design spec
- show English, Tibetan, and Chinese labels on language fields and style the add-language control
- resize cover upload placeholder and refine description field backgrounds
- highlight active plan tabs with brand color and muted plan counts
- simplify plan picker chrome and add spacing above the search field

* style(create-series): simplify PlanSearchSelector layout

- remove unnecessary padding from the PlanSearchSelector component

* feat(dashboard): load tabs from unified CMS dashboard items API

- add dashboard items client with tab, pagination, search, and filter params mapped to table rows
- replace separate plan and series fetches and mock all feed with a single React Query load per view
- send language and status filters to the server instead of filtering client-side
- use one content table and pagination state for all, plans, and series tabs
- update dashboard tests and invalidate dashboard-items after plan and series mutations

* feat(dashboard): show plan count badge on series cover thumbnails

- overlay a stack badge with plans_count on series rows in the content table
- map plans_count from dashboard items API responses into table row data
- rename modified column header to Date Modified
- add dashboard test for the accessible series plans badge
- fix CreatePlan cover image tests to match constraints copy key

* feat(dashboard): unify plan and series row actions via DropdownButton

- add entityType to DropdownButton for plan vs series API, labels, and edit links
- use shared dropdown for series rows with delete and status mutations
- remove placeholder onDeleteSeries handler and inline series action menu

* feat(dashboard): enable series featured toggle and align table controls

- route featured PATCH by row kind (plan vs series)
- allow published series rows to toggle featured from the table
- refresh featured star states and shared icon button styles for Featured and Actions
- add test covering series featured toggle

* refactor(dashboard): rely on axios interceptor for auth headers

- remove per-request Authorization headers from dashboard fetch, featured toggle, and row actions
- simplify featured toggle tests to match patch call signature
- tighten status update error handling in DropdownButton

* feat(dashboard): support series metadata API and featured updates

- resolve dashboard series titles from metadata with language preference
- toggle series featured via CMS PUT with featured flag instead of patch endpoint
- migrate series write payloads from name map to metadata array
- improve series detail mapping for metadata, image_key, and plan language fallbacks
- normalize dashboard status to uppercase and link series rows to series-details
- invalidate series cache after row status changes
- fix Tolgee translate prop typing on dashboard table
- add dashboard API tests and expand dashboard component coverage

* fix(dashboard): hide cover column header and align tests

- remove cover image label from dashboard table header
- assert table headers only when rows are present
- validate empty cover column and six column headers in tests

* feat(series-details): add series details page with plan management

- implement series details view with language tabs and plans table
- add plan search, reorder, remove, and featured actions with CMS persistence
- extend series API and dropdown for plan updates and extra menu items
- extract dashboard status and language chips into shared UI helpers
- wire series details route and add mapper and page tests

---------

Co-authored-by: Tech-lo <taylorhent@gmail.com>
- Introduced `uploadDayAudio` and `deleteDayAudio` functions for handling audio uploads and deletions associated with task days.
- Enhanced `SubTask` interfaces to include optional timestamp fields for audio segments.
- Updated `TaskForm` and `SubTaskCard` components to support audio management, including a new `DayAudioSection` for displaying and editing audio timestamps.
- Implemented utility functions for formatting audio timestamps and retrieving audio duration from files.
- Enhanced code formatting in AudioTrimmer component for better readability.
- Simplified conditional checks in SubTaskCard component.
- Improved formatting in subtaskTimestamps validation function for clarity.
feat(task): add audio upload and management features
- Made the task editing feature always editable by setting `isEditable` to true.
- Integrated audio playback for daily tasks by adding `dayAudioUrl` to the `SubtaskCard` component.
- Improved the `DayAudioSection` to manage audio uploads and deletions more effectively, including UI enhancements for better user experience.
- Refactored the `DropdownButton` to streamline the dropdown menu structure.
- Commented out the `status` variable assignment to improve code clarity and prevent potential confusion regarding its usage.
…DayAudioSection

- Updated the conditional rendering in SubtaskCard to ensure both start and end timestamps are checked before displaying the audio player.
- Removed unnecessary whitespace in DayAudioSection for cleaner code formatting.
- Refactored DropdownButton to enhance readability by adjusting indentation and structure.
- drive tab, search, language, status, page, and page size from the URL
- add helpers to parse, serialize, and map dashboard URL state to API params
- debounce search input before committing search to the URL
- reset page when filters change and clamp page when results shrink
feat(task): enhance audio management and task editing capabilities
feat(dashboard): sync filters and pagination to URL query params
* series inclusion

* lint

* handle series loading and error states

* lint

* naming

* lint

* updated with serach filter
- Updated package version to 2026.05.28.1200.
- Introduced new routes for managing groups, including group creation, editing, and details pages.
- Enhanced the Navbar to include a link for groups management.
- Modified PlanTagSearchInput to conditionally hide the label.
- Replaced error handling in Tags component to utilize a centralized API error message function.
- Added PlanAudioDTO and PlanAudioListResponse interfaces for audio data handling.
- Implemented fetchPlanAudioList function to retrieve audio files associated with plans.
- Introduced attachDayAudio function to link audio files to specific days.
- Updated TaskForm to include plan title in DayAudioSection.
- Integrated PlanAudioSearchInput component for searching existing audio files in DayAudioSection.
- Improved user instructions for audio uploads and management in the UI.
…sk management

- Added new API functions for creating multiple days and bulk deleting days.
- Updated the SideBar component to support day selection mode for bulk actions.
- Enhanced the DayDeleteDialog to handle bulk deletion.
- Refactored usePlanMutations to integrate new API functions for creating and deleting days.
- Improved user experience with feedback messages for successful and failed operations.
- pass seriesId and active language tab via router state from Add New Plan link
- validate location state and pre-fill create form when series is in the list
- disable series and language fields and show contextual heading when locked
- fall back to default create form when series id is missing or invalid
- add tests for Series Details navigation, CreatePlan pre-fill, and state parser
- prevent committing local GitHub issue drafts and related files
- align with existing .cursor ignore for developer-only paths
- re-add .cursor to ignore list to prevent committing local cursor files
- maintain consistency with previous ignore entries for developer-specific files
- lay out plan picker and audio library search on one row in day audio UI
- preserve search, infinite scroll, preview, and attach behavior
- apply formatting-only updates across groups routes and day create dialog
…react-split-pane

- Updated the version of the project to 2026.05.28.1200 in package.json and package-lock.json.
- Added react-split-pane for a responsive layout in PlanDetailsPage, allowing for a mobile preview.
- Introduced MobileView component to display the WeBuddhist Plan Viewer.
- Enhanced SideBar component to accept selectedDayId for better state management.
- Fixed a typo in the CSS variable for JetBrains font.
feat(create-plan): pre-fill series and language from series details
…orm on day change

- Updated the project version in package-lock.json to 2025.11.05.0657.
- Integrated useSearchParams for managing selected day in PlanDetailsPage.
- Added functionality to reset selected task and editing task when the day changes.
- Enhanced TaskForm to reset the form when the selected day changes in create mode.
…age test suite

- Removed tests for updating and reading search params related to day changes in PlanDetailsPage.
- Cleaned up the test suite to focus on relevant functionality after recent updates to state management.
@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown

Confidence Score: 3/5

Three issues in PlanDetailsPage need to be fixed before merging: a hardcoded development UUID used as a fallback redirect, the edit guard being removed so published plans become fully editable, and a string passed to navigate() that breaks the back button on SeriesDetailsPage.

The hardcoded UUID redirect exposes an unintended plan to any unauthenticated or mis-routed request. The isEditable regression bypasses the status check that protects published/unpublished plans from accidental edits. The navigate string typo renders the back button on the Series Details page non-functional. Together these three regressions affect core editing workflows.

src/components/routes/task/PlanDetailsPage.tsx (hardcoded UUID fallback, isEditable regression) and src/components/routes/series-details/SeriesDetailsPage.tsx (navigate string typo)

Reviews (1): Last reviewed commit: "refactor(groups): remove unused close bu..." | Re-trigger Greptile

variant="ghost"
size="icon"
aria-label="Back to dashboard"
onClick={() => navigate("-1")}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 navigate("-1") passes a string to navigate, which navigates to a route literally named "-1" instead of going back in browser history. The programmatic back-navigation overload requires a number.

Suggested change
onClick={() => navigate("-1")}
onClick={() => navigate(-1)}

Comment on lines +62 to +63
const isEditable = true;
const isPlanPublished = planDetails?.status === "PUBLISHED";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 isEditable is now hardcoded to true, removing the status-based guard that prevented editing PUBLISHED or UNPUBLISHED plans. Previously only DRAFT and ARCHIVED plans were editable. This allows any plan — including live published ones — to be modified through the task form.

Suggested change
const isEditable = true;
const isPlanPublished = planDetails?.status === "PUBLISHED";
const status = planDetails?.status ?? "DRAFT";
const isEditable = status === "DRAFT" || status === "ARCHIVED";
const isPlanPublished = planDetails?.status === "PUBLISHED";

Comment on lines +42 to +48
useEffect(() => {
if (!planId) {
// If no planId in URL but we want to use the specific one from the WeBuddhist plan viewer
const targetPlanId = "24e15ca6-ae54-4b5c-a12d-11355730158e";
navigate(`/plans/${targetPlanId}`, { replace: true });
}
}, [planId, navigate]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 When planId is absent from the URL, the component hard-redirects to a specific UUID that appears to be a development artifact. Any user navigating to /plan/ without an ID will silently land on one particular plan they may not have access to; the correct fallback is to send them back to the dashboard.

Suggested change
useEffect(() => {
if (!planId) {
// If no planId in URL but we want to use the specific one from the WeBuddhist plan viewer
const targetPlanId = "24e15ca6-ae54-4b5c-a12d-11355730158e";
navigate(`/plans/${targetPlanId}`, { replace: true });
}
}, [planId, navigate]);
useEffect(() => {
if (!planId) {
navigate(ROUTES.dashboard, { replace: true });
}
}, [planId, navigate]);

Comment on lines +27 to +29
}

const getAuthHeaders = () => ({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 getAuthHeaders() reads directly from sessionStorage here and in planApi.ts, while every other new API file in this PR (dashboardApi.ts, seriesApi.ts, groupsApi.ts, etc.) relies on the axios interceptor for auth. If the interceptor is the authoritative token source, these calls will double-attach headers; if the token is ever refreshed and only the interceptor is updated, these calls will send stale credentials.

tenkus47 and others added 28 commits June 8, 2026 12:51
- Removed the TextSearchItem and TitleSearchResponse types as they were no longer needed.
- Updated the searchTitles function to directly fetch data without checking for minimum title length.
- Adjusted the SourceSelectorSheet component to remove dependency on MIN_TITLE_SEARCH_LENGTH and simplified source selection logic.
refactor(searchApi): simplify title search logic and remove unused types
- Introduced a new sub-title field in GroupMetadataDTO and GroupMetadataInput interfaces.
- Updated GroupFormPage to include sub-title input in the form and validation.
- Enhanced GroupDetailsPage to display the sub-title if provided.
- Adjusted group schema validation to require sub-title along with title and description.
- Updated `resolveSeriesImageKey` to ensure proper handling of image strings.
- Refactored `resolveGroupBannerUrl` and `resolveGroupAvatarUrl` to utilize `resolveDashboardItemImageUrl` for improved URL resolution.
- Simplified image URL mapping in `groupLinkedPlansToFkOptions` for better clarity and maintainability.
- Changed the language label for Chinese from "中国人" to "中文" for better clarity.
- Added a loading state to the DashboardContentTable to inform users when data is being fetched.
fix(dashboard): update language label and enhance loading state display
- Added `buildSeriesCreateBody` function to construct request body for new series creation.
- Updated `saveSeriesMutation` to handle series creation and partial updates based on whether the series is new or being updated.
- Introduced helper functions to compare series metadata and plans for efficient updates.
- Enhanced `buildSeriesUpdateBody` to support partial updates with original data comparison.
- Introduced a new `sub_title` field in the SeriesMetadataInput and SeriesMetadataDTO types.
- Updated series form handling to include `sub_title` in the languages object.
- Enhanced series API functions to accommodate the new `sub_title` field in metadata parsing and comparison.
- Refactored the CreateSeries component to utilize a new controller for improved state management and form handling.
feat(series): implement series creation and partial update functionality
- Updated series API tests to include the new `sub_title` field in various test cases.
- Ensured that both creation and update scenarios reflect the addition of `sub_title` in the languages object.
* md_preview_for_detail+subtask

* fix: format code with prettier

* feat(markdown-editor): set default tab to preview when disabled
…deBar

- Added logic to maintain the selected day when days are removed or renumbered in PlanDetailsPage.
- Implemented task selection clearing when a task no longer exists in the current plan.
- Updated SideBar to ensure the expanded day reflects the current plan's available days.
- Improved error handling in usePlanMutations to provide more informative error messages.
- Introduced `GenerateDayAudioOptions` interface for better parameter handling in `generateDayAudio`.
- Updated `generateDayAudio` function to accept options for language, type, and voice name.
- Refactored audio generation logic in `DayAudioDialog`, `SubTaskCard`, and `GenerateAudioButton` components to utilize new options structure.
- Integrated `TtsGenerateControls` for improved user interaction in audio generation.
- Passed `planLanguage` prop to relevant components for consistent language handling.
- Increased `client_max_body_size` to 50m to accommodate larger requests.
- Set `proxy_read_timeout` and `proxy_send_timeout` to 300s for better handling of long-running requests.
- Introduced `uploadSubTaskAudio` and `deleteSubTaskAudio` functions for handling audio uploads and deletions.
- Enhanced `SubTaskCard` component with audio upload functionality using a dropzone interface.
- Updated `TaskForm` to pass `taskId` for better audio management.
- Integrated audio controls and state management for seamless user experience in subtask audio handling.
…Trimmer

- Introduced `deleteSubTaskTimestamp` API function for removing timestamps associated with subtasks.
- Updated `AudioTrimmer` component to support an optional `onClear` callback for clearing audio selection.
- Enhanced `SubTaskCard` to integrate timestamp deletion logic, allowing users to clear timestamps directly from the UI.
- Implemented mutation handling for successful and error states during timestamp deletion.
…Card

- Updated `SubtaskTimestampSection` to conditionally render the `AudioTrimmer` based on the availability of day audio.
- Added user feedback for when day audio is not available, including a clear timestamps button.
- Refactored logic in `SubTaskCard` to improve clarity and maintainability regarding timestamp and audio state management.
- Enhanced `SubtaskCard` to conditionally render audio controls based on the presence of `audio_url`.
- Updated logic to ensure proper handling of audio playback and timeline display when audio is available or absent.
- Improved user experience by providing clear audio controls for subtasks with associated audio.
- Introduced a new `description_long` field in the group metadata interface to allow for more detailed descriptions.
- Updated `GroupFormPage` to include a form field for `description_long`, enhancing the user input options.
- Modified `GroupDetailsPage` to display the long description if available, improving the information presented to users.
- Adjusted the schema to validate the new long description field, ensuring proper data handling.
- Introduced a new form field for selecting the group type (PAGE or COMMUNITY) in the GroupFormPage.
- Updated the schema to include group_type validation.
- Enhanced the create and patch group mutations to handle the new group_type field.
- Added GROUP_TYPE_OPTIONS for better user guidance in the selection process.
- Added a new state for group type selection in the Groups component.
- Updated the query to include group type as a filter when fetching groups.
- Enhanced the GroupsTable to display the group type alongside other group details.
- Introduced a new select component for users to filter groups by type, improving user experience and data organization.
- Introduced a new API function `searchSegments` to fetch segments based on user input.
- Updated `MarkdownLinkDialog` to support segment linking, including state management for selected segments.
- Enhanced the UI to display search results for segments, improving user experience when linking content.
- Adjusted placeholder text and rendering logic to accommodate the new segment search feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants