Repository navigation
Give renamed exports their file type back - #420
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
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. |
SunkenInTime
force-pushed
the
t3/export-file-type
branch
from
November 1, 2026 14:19
26b5edc to
ff53046
Compare
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.
ci: test web
Three people lost the file type on an export. On Windows with file extensions hidden, which is the default, the save dialog offers
Retakeswith no.icashowing. Change the name and press Save, and the file is written with no extension at all. A screenshot saved that way won't open, and an .ica couldn't be picked in Import .ica until #426 let import read such files.I reproduced this in the real Windows save dialog on main. Typing a new name gave
renamed-icaandrenamed-shotwith no extension. Video kept its extension because it already hadensureMp4ExtensionandensureMovExtension.The cause is what the crosscheck read in the code. file_picker 9.2.3 never sets a default extension on
GetSaveFileNameW, so the dialog returns exactly what was typed. Screenshots had a second problem: file_picker writes the bytes itself, before Icarus sees the path.The fix
chooseExportPathinlib/services/export_save_path.dartopens the dialog and adds the extension if it's missing, taking the extension from the suggested file name. All six desktop exports go through it: .ica (local and cloud), folder backup, library backup, screenshot, MP4 and .mov. It replaces the two video helpers.saveExportBytespicks the path first and then writes the bytes, so a screenshot lands only under the corrected name. The browser still downloads through file_picker.The dialog only asks about replacing the name it returns. Typing
retakesover an existingretakes.icawould have overwritten that file with no prompt, and the video helpers did exactly that. So when the corrected name is taken, the dialog opens again in the same folder with that name, and Save brings up Windows' own replace prompt.Reopening the dialog felt better than adding an in-app prompt. The user stays in the save flow, can still pick another name, and sees the wording Windows always uses. It adds no new text to the app. The cost is a dialog that appears a second time, only in this one case.
How far this got
I ran driver builds of main and of this branch with the real dialogs up, not the driver's fake one. A script typed into the File name box and pressed Save.
renamed-icarenamed-icarenamed-ica.icarenamed-shotrenamed-shotrenamed-shot.pngrenamed-mov(renamed-videoon main)renamed-video.movrenamed-mov.movrenamed-mp4renamed-mp4.mp4renamed-libraryrenamed-library.ziprenamed-folderrenamed-folder.zipdots.dotsdots.icatrail.ica.trail.icatrail.icaspacespacespace.icaascent v1.2ascent v1.2ascent v1.2.icaUPPER.ICAUPPER.ICAWindows strips trailing dots and spaces itself, so nothing doubled and the code needs no handling for them.
The files are real: ffprobe reads the MP4 and the .mov, the PNG has a PNG header, and the three archives open as zips. In a fresh library, Import .ica brought
renamed-ica.icaback with its agent, and Import Backup restored both zips. Typingrenamed-icaover the existing file reopened the dialog in the same folder, Save brought up the prompt above, Yes replaced the file, and Cancel on a second try stopped the export.tool/drive/scripts/export-file-types.jsonrepeats the .ica, screenshot and .mov cases with the driver's fake dialog, which can now type a name ("as": "renamed"). That run was clean on this branch.After the rebase onto #426
The table above comes from the first build. I rebased onto main at
18306507and builtff530466. The only conflict was the driver's step list in a comment, and both sides are kept.On that build I repeated the real-dialog runs. All six exports kept the right extension and
UPPER.ICAstayed as typed. Typing a taken name reopened the dialog, Save brought up Windows' prompt, and Cancel on a second try stopped the export. ffprobe reads the MP4. In a library with a strategy in it, Import .ica brought backrenamed-ica.icaand Import Backup brought back the library zip.The two changes also work together. I copied that .ica and that zip to
old-exportandold-backup, with no extension, and imported them through the real Open dialogs. Import .ica addedold-exportand Import Backup restored the strategy inside the backup. Exports from now on get their extension, and files saved before this fix still import.Not covered
library_export_cloud_testpasses, but I didn't run it on a dev account.