Feature/v2 1#152
Merged
Merged
Conversation
…thods and add regression test for concurrent access
…ronizing access to amplitudesBuffer
- Implement EditDescriptionDialog for adding/editing descriptions directly from the records list. - Update RecordInfoScreen to include a description editor with a dialog for editing. - Modify RecordsDataSource to persist descriptions in the database and audio file metadata. - Enhance UI components to display descriptions and allow interaction for editing.
- Implement a checkbox in the EditDescriptionDialog to allow users to choose whether to embed the description as a COMMENT tag in the audio file. - Update relevant functions and data models to handle the new writeToFile parameter. - Ensure compatibility with formats that do not support comment metadata (e.g., 3GP). - Persist the user's choice for future use.
… reflect character count. Fixed remove tag comment from audio file.
There was a problem hiding this comment.
Pull request overview
This PR targets the app’s V2 codebase by addressing Crashlytics-reported recorder concurrency/startup issues and introducing user-editable record descriptions (notes) with optional embedding into audio-file metadata, along with related UI and localization updates.
Changes:
- Added record description editing flows across Home/Records/Info screens, including a persisted “save to audio file” preference and COMMENT-tag writing.
- Improved recorder robustness (thread-safety around amplitude buffers; releasing MediaRecorder on start failures) and added regression tests for concurrent access.
- UI polish (playback/time panels), phone portrait-orientation enforcement, and expanded translations (including Korean).
Reviewed changes
Copilot reviewed 54 out of 54 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/test/java/com/dimowner/audiorecorder/v2/data/RecordsDataSourceImplTest.kt | Adds unit tests for updating record descriptions and COMMENT-tag behavior. |
| app/src/test/java/com/dimowner/audiorecorder/v2/data/MappersTest.kt | Updates mapper test to include new description field. |
| app/src/test/java/com/dimowner/audiorecorder/v2/data/extensions/DataExtensionsTest.kt | Updates extension tests to include description. |
| app/src/test/java/com/dimowner/audiorecorder/v2/audio/RecordTagWriterTest.kt | New unit tests for writing/removing COMMENT tags. |
| app/src/test/java/com/dimowner/audiorecorder/v2/audio/RecordingWaveformBufferTest.kt | Adds concurrency regression test for waveform buffer. |
| app/src/test/java/com/dimowner/audiorecorder/v2/app/AppExtensionsTest.kt | New tests for format support of description embedding. |
| app/src/main/res/values/strings.xml | Adds/updates base strings for description editing and metadata options. |
| app/src/main/res/values-zh/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-zh-rTW/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-uk/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-tr/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-ru/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-pt-rPT/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-pt-rBR/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-pl/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-ko/strings.xml | Adds Korean translations. |
| app/src/main/res/values-ja/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-it/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-fr/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-es/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-de/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-ca/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/values-bg/strings.xml | Localization updates for new strings (and filter strings). |
| app/src/main/res/drawable/ic_description.xml | Adds description icon asset. |
| app/src/main/java/com/dimowner/audiorecorder/v2/navigation/RecorerNavigationGraph.kt | Wires “save description” parameters through navigation to RecordInfo. |
| app/src/main/java/com/dimowner/audiorecorder/v2/DefaultValues.kt | Adds default for “save description to file” preference. |
| app/src/main/java/com/dimowner/audiorecorder/v2/data/RecordsDataSourceImpl.kt | Implements updateRecordDescription() and COMMENT-tag writing integration. |
| app/src/main/java/com/dimowner/audiorecorder/v2/data/RecordsDataSource.kt | Adds datasource API contract for description + optional file embedding. |
| app/src/main/java/com/dimowner/audiorecorder/v2/data/PrefsV2Impl.kt | Persists “save description to file” preference. |
| app/src/main/java/com/dimowner/audiorecorder/v2/data/PrefsV2.kt | Exposes new preference on the Prefs interface. |
| app/src/main/java/com/dimowner/audiorecorder/v2/data/model/Record.kt | Adds/adjusts description on the domain model. |
| app/src/main/java/com/dimowner/audiorecorder/v2/audio/WavRecorderV2.kt | Synchronizes access to amplitude buffer when recording/progressing/stopping. |
| app/src/main/java/com/dimowner/audiorecorder/v2/audio/RecordTagWriter.kt | Updates COMMENT-tag handling to support delete vs set. |
| app/src/main/java/com/dimowner/audiorecorder/v2/audio/RecordingWaveformBuffer.kt | Makes key operations synchronized for thread-safety. |
| app/src/main/java/com/dimowner/audiorecorder/v2/audio/MediaRecorderBase.kt | Releases MediaRecorder on start failures; synchronizes amplitude buffer. |
| app/src/main/java/com/dimowner/audiorecorder/v2/audio/AudioRecordingService.kt | Ensures new records include a default description value. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/records/RecordsViewModel.kt | Adds state/actions for editing descriptions from records list + preference persistence. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/records/RecordsScreen.kt | Adds edit-description dialog flow from list UI. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/records/RecordsExtensions.kt | Adds “Description” item to record dropdown menu. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/records/RecordsComponents.kt | Renders description snippet in list items and adds click affordance. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/records/models/RecordDropDownMenuItemId.kt | Adds DESCRIPTION enum value. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/info/RecordInfoViewModel.kt | Routes description saving through datasource; persists checkbox preference. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/info/RecordInfoScreen.kt | Reworks description UI to open a dialog and optionally embed metadata. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/HomeActivity.kt | Locks orientation to portrait on phones (by smallest width). |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/home/HomeViewModel.kt | Adds active-record description state + actions for editing and “rename+description” flow. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/home/HomeScreen.kt | Adds description actions/dialog; replaces rename-after-recording dialog with name+description dialog. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/home/HomeExtensions.kt | Adds “Description” item to Home dropdown menu. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/home/HomeDropDownMenuItemId.kt | Adds DESCRIPTION enum value. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/home/HomeComponents.kt | Displays description in the time panel and exposes click callback. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/components/RecordPlaybackPanel.kt | Adjusts waveform height and padding for playback panel. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/AppExtensions.kt | Adds isDescriptionFileWriteSupported() format helper. |
| app/src/main/java/com/dimowner/audiorecorder/v2/app/AppComponents.kt | Adds dialogs for editing description and updating name+description together. |
| app/src/main/java/com/dimowner/audiorecorder/AppConstantsV2.kt | Adds max description length constant. |
| app/src/androidTest/java/com/dimowner/audiorecorder/v2/data/PrefsV2ImplTest.kt | Adds instrumentation tests for the new preference default and persistence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address Crashlytics crashes:
Enhance thread-safety in RecordingWaveformBuffer with synchronized methods and add regression test for concurrent access
Enhance thread-safety in MediaRecorderBase and WavRecorderV2 by synchronizing access to amplitudesBuffer
Release media recorder when exception happens on start recording.
Also, this pull request introduces a new feature allowing users to add or edit audio record descriptions (notes) and choose whether to embed these descriptions as metadata in the audio file. It also includes UI improvements for the playback and time panels, and enforces portrait orientation on phones. The most significant changes are grouped below.
Feature: Description Editing and Metadata Embedding
EditDescriptionDialogcomposable for editing a record's description, with a checkbox to control saving the description as a COMMENT tag in the audio file. The dialog adapts based on file format support. (app/src/main/java/com/dimowner/audiorecorder/v2/app/AppComponents.kt)RecordInfoScreen) to use the new dialog and pass the "save to file" flag through, including logic to determine if the file format supports embedding the description. (app/src/main/java/com/dimowner/audiorecorder/v2/app/info/RecordInfoScreen.kt,app/src/main/java/com/dimowner/audiorecorder/v2/app/AppExtensions.kt) [1] [2] [3] [4]IS_SAVE_DESCRIPTION_TO_FILE) and a new constant for the maximum description length (RECORD_DESCRIPTION_MAX_LENGTH). (app/src/main/java/com/dimowner/audiorecorder/v2/DefaultValues.kt,app/src/main/java/com/dimowner/audiorecorder/AppConstantsV2.kt) [1] [2]app/src/androidTest/java/com/dimowner/audiorecorder/v2/data/PrefsV2ImplTest.kt)UI/UX Improvements
app/src/main/java/com/dimowner/audiorecorder/v2/app/components/RecordPlaybackPanel.kt) [1] [2]app/src/main/java/com/dimowner/audiorecorder/v2/app/home/HomeComponents.kt) [1] [2]Device Orientation Handling
app/src/main/java/com/dimowner/audiorecorder/v2/app/HomeActivity.kt) [1] [2]These changes collectively enhance the app's usability by providing users with more control over record metadata, improving the visual design, and ensuring a consistent experience across device types.
Added Korean language support.