fix: replace filename truncation with user warning#3180
Closed
Diksha-MukherjeeAgarwal wants to merge 5 commits into
Closed
fix: replace filename truncation with user warning#3180Diksha-MukherjeeAgarwal wants to merge 5 commits into
Diksha-MukherjeeAgarwal wants to merge 5 commits into
Conversation
Added validation to prevent users from saving filenames longer than 200 characters and surfacing a warning via Snackbar instead of silently truncating the input.
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds filename length validation when saving recordings, warning the user via a Snackbar and preventing silent truncation, while normalizing the saved filename text. Sequence diagram for filename save validation and Snackbar warningsequenceDiagram
actor User
participant SoundMeterScreenState
participant AlertDialog
participant ScaffoldMessenger
participant SnackBar
participant CsvService
User->>SoundMeterScreenState: tapSaveRecording()
SoundMeterScreenState->>AlertDialog: showSaveRecordingDialog(maxLength 200)
User->>AlertDialog: enterFilename()
User->>AlertDialog: pressSave()
AlertDialog->>SoundMeterScreenState: onSavePressed(filenameController.text.trim())
alt filename length > 200
SoundMeterScreenState->>ScaffoldMessenger: showSnackBar()
ScaffoldMessenger->>SnackBar: construct(message "File name must be less than 200 characters.")
SnackBar-->>User: displayWarning()
SoundMeterScreenState-->>AlertDialog: keepDialogOpen()
else filename length <= 200
SoundMeterScreenState->>AlertDialog: Navigator.pop(context, text)
AlertDialog-->>SoundMeterScreenState: returnFileName(text)
SoundMeterScreenState->>CsvService: writeMetaData(fileName)
CsvService-->>SoundMeterScreenState: metaDataWritten()
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Build StatusBuild successful. APKs to test: https://github.com/fossasia/pslab-app/actions/runs/24446765001/artifacts/6447325389. Screenshots |
Contributor
Author
|
Closing this duplicate PR. All of these changes have been added to the original PR #3177 to keep the commit history and conversation in one place. |
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.







-1_instruments_screen.png?raw=true)
-2_nav_drawer.png?raw=true)
-3_accelerometer.png?raw=true)
-4_power_source.png?raw=true)
-5_multimeter.png?raw=true)
-6_wave_generator.png?raw=true)
-7_oscilloscope.png?raw=true)
Added validation to prevent users from saving filenames longer than 200 characters and surfacing a warning via Snackbar instead of silently truncating the input.
Summary by Sourcery
Bug Fixes: