4 commits
feat(magnetron): enhance loading experience with document status updates
Why: The loading experience for documents lacked user feedback on the current processing status, which could lead to confusion during longer operations. Users benefit from visibility on what the application is currently doing.
What: Introduced detailed status messages and a visual representation of illustrations being processed. The loader now communicates different stages of document handling, including "Processing Source Files", "Processing Slides", and "Processing Illustrations".
How:
documentStatus was added to track the current processing status of the document.getStatusMessage that returns corresponding titles and subtitles based on the document status.IllustrationGrid component that displays illustrations being processed when the status is "PROCESSING_ILLUSTRATIONS".ProcessMagnetronDocumentUseCase to set different processing statuses during the execution of document processing. This includes calls to the new updateStatus method which updates the document's status in the database after certain processing stages.This comprehensive enhancement provides an improved user experience by clearly indicating document processing stages and showcasing relevant visual elements.
refactor(tts): remove redundant logging in ChirpTTS service
Why: The previous implementation of the ChirpTTS service included verbose logging for each response and the final result. This information was not essential for the core functionality, leading to unnecessary console noise during execution.
What: This commit simplifies the logging within the ChirpTTS class by removing logs that output the URL, duration, and hash for each audio chunk as well as for the final result. It preserves the total duration log for the operation, providing a concise overview.
How: Specific lines were removed from the response logging sections within the forEach and success handling statements. By doing this, we maintain a clean console output while still allowing developers to track the total duration of audio generation.
feat(audio): enhance audio loading and playback management in SceneEditor
Why: To ensure smoother audio playback experience and better error handling when loading generated audio files in the SceneEditor component.
What: Added logic to create a new audio element upon successfully generating audio. Included event listeners for managing the loading state, handling playback end events, and catching errors during audio loading.
How:
canplaythrough event for confirming audio readiness and the error event for any audio loading issues.feat(text-to-speech): implement text-to-speech functionality in audio editor
Why: The goal is to enhance the audio editing capabilities within the Magnetron application by integrating a text-to-speech (TTS) feature, allowing users to generate audio from written text. This adds value by making content creation easier and more accessible.
What:
TextToSpeechController to handle TTS requests and responses.TextToSpeechUseCase to encapsulate the logic for generating audio from text using the specified voice.BrowserApiClient with a method to interact with the TTS API.SceneEditor component to trigger audio generation when audio files are unavailable or have changed.ITextToSpeechRequest and ITextToSpeechResponse) that define the structure for TTS operations.How:
SceneEditor now checks if audio needs to be generated based on narration text and voice. If so, it calls the TTS API asynchronously and updates the scene's audio properties upon successful generation.Chirp3TextToSpeechUseCase for the underlying TTS logic, including error handling to ensure proper feedback to users if audio generation fails.userRouter to direct TTS requests to the new controller, encapsulating the functionality behind a clear API endpoint.This commit significantly expands the capabilities of the audio editor, enhancing user experience in content creation within the Magnetron application.
6 commits
fix(contact): change redirect method to hard refresh for LinkedIn requests
Why: The previous implementation used router.push() for navigating to the next LinkedIn contact. This method may not trigger a full page reload, potentially leading to issues with the updated contact status not reflecting as expected.
What: Updated the redirect logic to use window.location.href instead of router.push(). This ensures that the application performs a hard refresh when navigating to the next contact, helping to clear the previous state and load the new contact information.
How: Replaced instances of router.push('/admin/contacts/ready/next/linkedin') with window.location.href = '/admin/contacts/ready/next/linkedin' in the specified file. This change ensures that users are redirected correctly after updating the contact status, which improves overall user experience.
setup domains
cleanup
cleanup
cleanup
feat(magnetron): refactor scene population to separate service
Why: The previous implementation for populating scenes from slides was tightly coupled within the MagnetronRouter component, making it difficult to maintain and test. It also resulted in code duplication and increased complexity in handling different slide types.
What: This commit introduces a new ScenePopulationService that centralizes the logic for converting slides into scenes. The MagnetronRouter now relies on this service to handle scene population, simplifying its implementation. Additionally, the ProduceMagnetronDocumentForContactUseCase has been updated to utilize the ScenePopulationService, ensuring scenes are correctly populated when no existing scenes are present.
How: The ScenePopulationService contains a method populateScenesFromSlides which encapsulates the logic for creating scenes based on slide types. It handles errors gracefully by returning a structured result that indicates success or failure. The MagnetronRouter has been updated to call this method and handle potential errors accordingly. This refactoring improves code readability and supports better unit testing by isolating the scene creation logic from UI components.
1 commit
feat(render): enhance progress logging in video rendering service
Why: It is important for users and developers to have clear visibility into the rendering process, especially in production environments. Improved logging will help in tracking the loading of documents and the preparation of scenes, making debugging easier.
What: Added two new progress log entries that notify when a document is successfully loaded and when the rendering of scenes is about to commence.
How: Implemented asynchronous logging calls within the MagnetronVideoRenderService to output messages regarding the successful loading of document scenes and the current environment state. These logs will be triggered sequentially after scenes are populated, providing relevant context to users regarding the rendering process.
4 commits
feat(docker): add service to produce magnetron for contacts
Why: To enhance the functionality of the magnetron service by enabling the production of magnetron documents specifically tailored for contacts. This addition supports future integrations and improves the data handling capabilities in the application.
What: Introduced a new service named produce-magnetron-for-contacts in the docker-compose.yml. This service leverages the existing Dockerfile to build an environment configured for production. Additionally, a new script entry "produce-magnetron-for-contacts" was added to package.json to facilitate the execution of the relevant process.
How: The new Docker service runs the command npm run produce-magnetron-for-contacts within a production environment, using the shared volume magnetron-data to access necessary data files. The service is set to restart unless stopped, ensuring reliability in long-running operations.
feat(contacts): improve rendering and styling in ContactsReady component
Why: The rendering of contact data needed refinement to improve readability and ensure proper handling of complex video data structures, including checks for null values and object types.
What:
How:
typeof checks and null checks on contact.videoData.renderedVideoFile and related fields to prevent runtime errors.getServerSideProps function to include clearer console logs for debugging and validation of audio-visual components within the page data.feat(contacts): highlight contact statuses with background colors
Why: To improve the user experience by visually distinguishing contacts based on their status. This helps users quickly identify the current state of each contact, enhancing the overall usability of the contacts page.
What: Added conditional background colors for contact items based on their status. Contacts with statuses indicating progression (e.g., "SELECTED_FOR_MAGNETRON_GENERATION") are highlighted in green, while those with rejection statuses (e.g., "INCORRECT_BLOG") are marked in red.
How: Implemented logic within the .map function to assign a specific background color class to each contact based on its status. This makes use of template literals to dynamically apply the appropriate classes directly in the JSX markup. The changes enhance the visual layout without altering the underlying contact data structure.
feat(contacts): add magnetron document creation and status management
Why: To enable management of contacts that require magnetron documents, including the creation, updating, and viewing of related contacts and their status. This is part of enhancing our system's capability to handle document generation workflows.
What:
Contact model to include magnetronDocumentEid and magnetronDocumentVersionEid fields in the database schema.How:
ProduceMagnetronDocumentForContactUseCase, to manage document creation and processing.ContactRepo for saving and retrieving contacts with their latest document status.UpdateContactStatusUseCase to handle new statuses related to magnetron document processing.This commit significantly enhances the functionality surrounding document generation, making it easier for users to process and keep track of their contacts and associated documents.
3 commits
feat(blog): add service for selecting contacts for blog recommendations
Why: To enhance the functionality of the Magnetron application by enabling the selection of contacts specifically for blog recommendations. This feature aims to improve user engagement and content personalization.
What:
docker-compose.yml named select-contact-for-blog-recommendation.package.json for performing the contact selection task.How:
docker-compose.yml is set to use the production environment. It shares a volume with the existing services to ensure data persistence.SelectContactForBlogRecommendationUseCase, which is implemented in the application to handle the selection logic efficiently.feat(api): clean up imports in BrowserApiClient and update dependencies
Why: The BrowserApiClient.ts file had unnecessary imports which cluttered the code and made maintenance harder. Additionally, dependency versions in package.json were updated to lock their versions for consistency across different environments.
What:
BrowserApiClient.ts.IImportApolloCSVRequest, IImportApolloCSVResponse, and ISaveMagnetronDocumentResponse that were missing.posthog-js and posthog-node in package.json to specific versions to prevent unintended upgrades.How: The cleaning of imports involved manually reviewing the import statements and ensuring only the required ones remained. The package.json changes were made to provide more predictable behavior in builds by specifying exact versions of critically relied-on packages.
trigger build
4 commits
refactor(importApolloCSV): replace ErrorCodes enum with string literals
Why: The previous implementation relied on an ErrorCodes enum which made the code dependent on an external structure, complicating error handling and making it less straightforward to identify errors in the application logic.
What: This commit replaces the ErrorCodes enum with direct string literals for error codes throughout the ImportApolloCSVUseCase. This change simplifies error handling and enhances readability by removing the indirection provided by the enum.
How: Each instance where an error code was being generated (e.g., ErrorCodes.VALIDATION_ERROR, ErrorCodes.API_ERROR, etc.) has been updated to use the corresponding string literal (e.g., "VALIDATION_ERROR"). This simplifies the process of defining and identifying errors and ensures that error message management remains fluid without requiring additional dependencies.
feat(admin): add CSV import functionality for contacts management
Why: The need to streamline the process of importing contacts from Apollo.io into our system has been identified. This feature allows users to upload CSV files containing contact data, improving efficiency and data management.
What:
/contacts/import-csv).ImportApolloCSVController) to handle requests, which utilizes a use case (ImportApolloCSVUseCase) for processing the uploaded CSV files.How:
BrowserApiClient was modified to include the importApolloCSV method for handling import requests.ImportApolloCSVUseCase includes logic for validating input, downloading remote CSV files if necessary, processing the data, and handling errors during the import process.Overall, this commit enhances the admin interface for contact management, making it more user-friendly and efficient for users engaging with the contact data.
devops
feat(ui): enhance login page with new design and user prompts
Why: The previous login page lacked visual appeal and effective calls to action, which could lead to a suboptimal user experience. A refreshed design aims to engage users better and encourage account creation for new visitors.
What: Redesigned the login page to include a welcoming header, a streamlined login form, and additional features displayed to attract user interest. Added a clear call to action for users who do not have an account.
How:
1 commit
trigger build
3 commits
feat(runner): remove TestWebCrawlMagnetron runner functionality
Why: The TestWebCrawlMagnetron runner was deemed unnecessary for the current functionality of the application. Removing it simplifies the code base and reduces potential points of failure.
What: This commit removes the TestWebCrawlMagnetron runner. The corresponding import statement is deleted from run.ts, and the entire functionality of this runner has been removed, including the related logic for document creation via web crawling.
How: The implementation details included the removal of imports and definitions that were specific to TestWebCrawlMagnetron. The runner's logic, including web URL handling, user retrieval, and document creation processes, has been deleted to streamline the application and prevent unused code from affecting future maintenance.
feat(magnetron): add web URL input for document creation
Why: Users need the ability to provide a web URL as a content source when creating magnetron documents. This enhances the flexibility and utility of the document creation feature, allowing users to summarize and create presentations based on web content.
What:
CreateMagnetron component.TestWebCrawlMagnetron, to facilitate testing of the web crawling functionality.How:
CreateMagnetron component to maintain webUrl and showUrlInput states, and included UI elements to input and manage URL data.CreateMagnetronDocumentUseCase to check if at least one content source (prompt, files, or web URL) is provided. If a URL is submitted, it retrieves web page content and augments the document creation prompt accordingly.GetWebPageUseCase to fetch and parse web content, ensuring any fetched text is manageable within token limits. Error handling was added to maintain functionality even if fetching fails.feat(video-generation): implement Sora2 video generation use case
Why: To support video generation using the Sora 2 model from OpenAI, we need a new use case that handles the creation and retrieval of video jobs based on user-defined prompts and images.
What: Introduced the Sora2VideoGenerationUseCase, which defines two interfaces (ISora2VideoGenerationRequest and ISora2VideoGenerationResponse) for input and output. Implemented logic for image downloading, video generation, and uploading to Google Cloud Storage. Added Sora2VideoGeneration and RetrieveSoraVideo runners to facilitate user interaction and job status checking.
How: The use case leverages axios for API communication and fs/promises for file handling, utilizing FormData for multipart uploads. The video generation process includes downloading the input images, making an API call to OpenAI's Sora 2 endpoint, and handling the job status through polling. Runners have been provided to orchestrate the video generation and retrieval process, offering clear console outputs and error handling.
3 commits
devops management
cleanup
feat(update): rename instances of HelloSketch to Magnetron
Why: The project name has been updated from HelloSketch to Magnetron, necessitating changes in various components to maintain consistency across the codebase.
What:
CreateMagnetron component to reflect the new project name.IntroSlideSceneProvider service to improve visual consistency, changing it from 700 to 400.ChirpTTS service to incorporate the new project name.How:
CreateMagnetron component was amended to replace "HelloSketch" with "Magnetron".IntroSlideSceneProvider were updated to reduce the weight, ensuring text appears appropriately styled.runTest method in the ChirpTTS class was updated to reflect the new branding in the test output string.1 commit
fix(generateChangeLog): update branch reference to main for commits
Why: The previous branch reference was set to "hellosketch," which may have been outdated or incorrect. This could lead to fetching the wrong set of commits when generating the changelog.
What: Updated the branch reference from "hellosketch" to "main" in the GenerateChangeLogUseCase.ts file. This change ensures that the application fetches commits from the currently active main branch.
How: The modification was made in the section of code responsible for defining GitHub repository details. By changing the string value assigned to the branch variable, the code now correctly points to the main branch for fetching commit data.
9 commits
feat(editor): add drag-and-drop functionality for scene reordering
Why: Enhancing user experience by allowing users to reorder scenes via drag-and-drop increases the flexibility of the editor. Previously, users could not change the order of scenes intuitively, which could hinder workflow efficiency.
What: Integrated the react-beautiful-dnd library to implement drag-and-drop functionality in the EditorShell component. Users can now reorder scenes directly within the table of contents, which automatically updates the state and saves changes without manual intervention.
How:
DragDropContext and utilized Droppable and Draggable components to manage drag-and-drop operations.handleDragEnd function to handle the reordering logic, updating the magnetron document's scenes array and saving the updated document automatically after a drag operation.This change significantly improves the interactivity of the editor and provides a more dynamic way for users to manage their scenes.
fix(changelog): correct spelling in publish-changelog script
Why: The existing script name for generating the changelog contained a typo, which could lead to confusion and potential errors when attempting to execute the command.
What: Updated the key command in the package.json from GenerateChangeLog to GenerateChangelog for consistency.
How: This change only modified the string in the publish-changelog script section, ensuring that it correctly references the intended function as it is defined in the codebase.
feat(changelog): enhance changelog management and UI updates
Why: To improve the functionality of the changelog generation process and enhance the user experience by providing a clearer distinction for current and past months in the UI.
What:
publish-changelog to automate changelog generation in the build process.How:
Dockerfile to include the new publish-changelog script execution during the build process.isCurrentMonth in [month-year].tsx that checks if the changelog displayed is for the current month, modifying the heading accordingly to improve user clarity.GenerateChangelog.ts script to set the default date range for changelog generation, dynamically calculated to focus on recent changes rather than a broader historical range.chore(docker): remove unnecessary network configurations from services
Why: The previous configuration included a dedicated network for the services which was unnecessary as the default bridge network suffices for container communication. This simplification helps streamline the Docker setup.
What:
networks section for each service in the docker-compose.yml file.magnetron-network definition from the networks section since it was no longer being used.How: Adjusted the docker-compose.yml file by deleting the relevant lines related to the custom network, ensuring that the services continue to operate under the default Docker networking settings. This change reduces complexity and improves maintainability of the Docker configuration.
feat(sitemap): streamline sitemap generation with changelog integration
Why: The previous implementation generated a sitemap based on questions and markdown services, which limited the site's visibility for static pages and changelog entries. We needed to enhance the sitemap by including relevant URLs for improved SEO and user accessibility.
What: This update refactors the GenerateSitemapUseCase to focus on generating a sitemap that includes static pages and changelog URLs. The QuestionRepo and MarkdownService dependencies were removed in favor of the ChangeLogRepo, simplifying the use case's responsibility.
How:
ChangeLogRepo retrieves unique changelog months, allowing the addition of URLs for both the main changelog page and individual month pages.feat(changelog): improve commits handling and safety checks
Why: Previously, the code did not robustly handle cases where the commits array might not exist or be of an unexpected type, potentially leading to errors when rendering the changelog.
What: Introduced a helper function getCommitsArray to ensure safe access to the commits array. This function returns an empty array if the provided commits is not an array, thus preventing runtime errors during display.
How: The function is used throughout the ChangelogMonth component to safeguard against undefined or non-array commits when calculating lengths and mapping through commits. Additionally, the changes in GetChangelogsByMonthUseCase ensure that the commits are always an array, improving reliability in how changelogs are processed and displayed.
feat(changelog): enhance commit display with improved styling and structure
Why: To improve the user experience when viewing the changelog by providing better visual separation and clarity for each commit entry.
What: This update includes adjustments to the spacing between commit entries, the addition of commit index labels, and a visual separator for better organization. The changes make the commit list more readable and visually appealing.
How:
space-y-4 to space-y-6 for greater separation.feat(changelog): implement automated changelog generation, storage, and display functionality with monthly overview and commit details.
feat(changelog): add automated changelog generation and storage
Why: To enhance our project’s documentation and tracking of changes, we needed a systematic way to generate changelogs. Manual updates were prone to errors and missed details, so an automated solution is essential for accuracy and efficiency.
What: Implemented a comprehensive changelog feature that captures commits within a specified date range. This includes:
How: Developed a new GenerateChangeLogUseCase class that:
ChangeLog aggregate root and associated mapper and repo for handling database interactions.GenerateChangelog runner class.3 commits
feat(admin): implement FlyWheels management page and database changes
Why: To provide a user interface for managing Fly Wheels and their configurations, including the ability to view and edit Fly Wheel properties. This change addresses the need for a frontend component to handle Fly Wheel records effectively.
What:
pages/admin/fly-wheels.tsx) for displaying Fly Wheels, handling loading states, and displaying error messages.slug column to the FlyWheel table.ChangeLog table for tracking changes.FlyWheel model in schema.prisma to include the new slug field.FlyWheelRepo to replace the findByAdminOrCreate method with findBySlugOrCreate to align with the new data structure.GetAllFlyWheelsUseCase to retrieve all Fly Wheel records and format them for the frontend.How:
Risks/Trade-offs:
slug field may require existing Fly Wheel records to be updated to avoid null constraint violations. Migration scripts were carefully crafted to ensure table integrity.ChangeLog table adds complexity but supports future auditing needs.Testing:
Add FlyWheel aggregate, mapper, and repository implementation.
Add FlyWheel model and corresponding migration SQL script to the Prisma schema.