Skip to content

Feature/v2 1#152

Merged
Dimowner merged 17 commits into
masterfrom
feature/v2_1
Jun 20, 2026
Merged

Feature/v2 1#152
Dimowner merged 17 commits into
masterfrom
feature/v2_1

Conversation

@Dimowner

Copy link
Copy Markdown
Owner

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

  • Added a new EditDescriptionDialog composable 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)
  • Updated the info screen (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]
  • Introduced a new default value (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]
  • Added tests to verify correct storage and default value of the "save description to file" preference. (app/src/androidTest/java/com/dimowner/audiorecorder/v2/data/PrefsV2ImplTest.kt)

UI/UX Improvements

  • Adjusted the height of the waveform in the playback panel and padding for better visual balance. (app/src/main/java/com/dimowner/audiorecorder/v2/app/components/RecordPlaybackPanel.kt) [1] [2]
  • Improved padding for the time panel's start and end time texts for better alignment. (app/src/main/java/com/dimowner/audiorecorder/v2/app/home/HomeComponents.kt) [1] [2]

Device Orientation Handling

  • Enforced portrait orientation on devices classified as phones (based on screen width), while allowing tablets and large screens to remain flexible. (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.

Dimowner added 10 commits June 12, 2026 20:05
…thods and add regression test for concurrent access
- 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread app/src/main/java/com/dimowner/audiorecorder/v2/audio/RecordTagWriter.kt Outdated
Comment thread app/src/test/java/com/dimowner/audiorecorder/v2/data/RecordsDataSourceImplTest.kt Outdated
@Dimowner
Dimowner merged commit 8bfce1f into master Jun 20, 2026
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.

2 participants