Closed ttizze closed 3 months ago
This PR is linked to issue #171
The recent changes enhance the translation and content management capabilities of the web application. Key updates include a streamlined translation handling process, improved editing functionalities, and refined database interactions. With new utility functions and adjusted data structures, the system now efficiently manages source text IDs, reduces duplicate entries, and optimizes database queries, ultimately boosting performance and maintainability.
File Path | Change Summary |
---|---|
web/app/routes/$userName+/page+/$slug+/components/... |
Revised ContentWithTranslations component for more efficient translation handling, linking translations via data-source-text-id . |
web/app/routes/$userName+/page+/$slug+/edit/_edit.tsx |
Updated page submission logic, introducing new utility functions to manage sourceTextId and reduce duplicates. Renamed key functions for clarity. |
web/app/routes/$userName+/page+/$slug+/edit/components/Editor.tsx |
Added CustomDataAttribute extension to the Tiptap editor for managing data-source-text-id . Enhanced editor's initialization tracking. |
web/app/routes/$userName+/page+/$slug+/edit/functions/... |
Renamed and improved functions for creating/updating pages and source texts, emphasizing transactional integrity and efficiency. |
web/app/routes/$userName+/page+/$slug+/edit/types.ts |
Introduced sourceTextId property to NumberedElement , enhancing data structure capabilities. |
web/app/routes/$userName+/page+/$slug+/utils/... |
New utility functions for content processing, including addSourceTextIdToContent and removeSourceTextIdDuplicates , improving HTML content integrity. |
web/routes/resources+/gemini-api-key-dialog.tsx |
Simplified user data handling in the action function, improving performance by using authenticated user info directly. |
web/prisma/migrations/... |
Multiple migrations to drop and create indexes for optimizing database performance. |
web/prisma/schema.prisma |
Adjusted indexing and unique constraints in models, impacting query efficiency and data integrity strategies. |
sequenceDiagram
participant User
participant Editor
participant Backend
participant Database
User->>Editor: Submit Content
Editor->>Backend: Process Content with Translations
Backend->>Database: Add/Update Source Texts
Database-->>Backend: Confirmation
Backend-->>Editor: Return Success
Editor-->>User: Show Updated Content
🐰 In the meadow where bunnies hop,
Changes bloom, and we won't stop!
With IDs new and translations bright,
Our content dances in the light.
Hooray for updates, let’s cheer and play,
A better world for us today! ✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes #171
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores