Repository navigation
Keep the whole file name when exporting over an existing file - #11968
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The updated export-path handling preserves filenames with dots and does not introduce an identified extension-handling regression. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Warning Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for the PR! Behavior looks good to me. |
Picking an existing file to overwrite in the export dialog dropped everything
from the first dot onwards, so choosing
Community Roundup Spoken 9.45am 1.45pm.mp3
offered to export to "Community Roundup Spoken 9".
muse::io::FileInfo::baseName() cuts at the FIRST dot; completeBaseName() cuts
at the last, which is what "name without its extension" means here. Both places
the export dialog derives a name from a chosen path used the former.
It looks like a length limit in the report, because the truncation happens to
land 26 characters in, but the length is a coincidence - any name containing a
dot before the extension loses the rest, and names without one were never
affected.
Checked against muse's FileInfo directly, the two agree on every ordinary name
and differ only where they should:
Community Roundup Spoken 9.45am 1.45pm.mp3 -> ...9 | ...9.45am 1.45pm
song.mp3 -> song | song
no_extension -> no_extension | no_extension
archive.tar.gz -> archive | archive.tar
1a99955 to
4da9d8e
Compare
Keep the whole file name when exporting over an existing file (#11968)
Resolves: #11966
Picking an existing file to overwrite in the export dialog dropped everything
from the first dot onwards, so choosing
offered to export to
Community Roundup Spoken 9.Cause
muse::io::FileInfo::baseName()cuts at the first dot:completeBaseName()cuts at the last, which is what "the name without itsextension" means here. Both places
ExportPreferencesModelderives a name froma chosen path —
setFilePickerPath()andsetFileDialogPath()— used theformer. They are the only two
baseName()calls insrc/.It is not a length limit
The report reasonably reads this as a 26-character cap, because that is where
the truncation lands for this name. It is a coincidence: the cut is at the first
dot wherever that falls. Any name with a dot before its extension loses
everything after it, and names without one were never affected — which is why
short names looked fine.
Verification
Both functions run against
muse::io::FileInfodirectly. They agree on everyordinary name and differ only where they should:
baseName()completeBaseName()Community Roundup Spoken 9.45am 1.45pm.mp3Community Roundup Spoken 9Community Roundup Spoken 9.45am 1.45pmsong.mp3songsongno_extensionno_extensionno_extensionarchive.tar.gzarchivearchive.tar/my.folder/track.wavtracktrackThe last row matters: a dot in a directory name does not confuse
completeBaseName(), so paths like that are unaffected.Because the two agree for names without an interior dot, this cannot change
behaviour for any file name that was already correct.
Recommended:
QA: