-
Notifications
You must be signed in to change notification settings - Fork 811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript rewrite: Exports window #1016
Conversation
@@ -1,10 +1,10 @@ | |||
import {UseConversionState} from 'hooks/editor/use-conversion'; | |||
|
|||
const ConversionDetails = ({conversion}: {conversion: UseConversionState}) => { | |||
const message = conversion?.message ?? 'Loading…'; | |||
const message = conversion?.message || 'Loading…'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because message
is initialized with ''
in the main process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a code comment so we don't try to revert to ??
in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But wouldn't it be better to not initialize it with ''
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's fair. Mostly I just didn't want to make it nullable. But I could also initialize it with 'Loading' since that's the value it's set to in the UI when it's empty
public readonly format: Format, | ||
public readonly options: ConversionOptions | ||
) { | ||
// eslint-disable-next-line constructor-super |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to silence a warning because of the TypedEmitter annotation. Couldn't find a way around it.
Warning said this doesn't need a super()
call, but obviously without one we get a compilation error
label: 'Retry', | ||
click: () => retry() | ||
}].filter(Boolean)); | ||
}, [canRetry, retry, openInEditor]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about text/order/dividers for this. It's the context menu in the Exports window. At the moment it can have one of three states:
Open Original
Open Original
Copy
Open Original
Retry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be:
Open Original
Copy
------
Open Original
Retry
------
Open Original
Probably not related to this PR, but I noticed there's no "Copy" button when converting to MP4, while there is when converting to GIF. |
I got this when choosing "Open original" in the export history:
|
Why is Babel transpiling async functions? Electron supports them natively. |
The "export completed" screen needs a way to show the file in Finder. In the export history, you can click the list item to do so. I also think the "export completed" screen should have a way to "Open original". The "export completed" screen should indicate what file format I just exported. I didn't remember whether it was GIF or MP4. The "export completed" screen should show the actual GIF instead of a static thumbnail. Drag and drop should also work from the "export completed" screen. |
// if (!this.browserWindow.isDestroyed()) { | ||
// callback(); | ||
// } | ||
// }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intention to leave it like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was throwing an error that it was unused but I wasn't sure if it'd get used in the future
label: 'Retry', | ||
click: () => retry() | ||
}].filter(Boolean)); | ||
}, [canRetry, retry, openInEditor]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be:
Open Original
Copy
------
Open Original
Retry
------
Open Original
Can we copy MP4? I thought you can only have gif and apng in your clipboard I'll look into that error and Babel The conversion preview is actually just the video element that plays in the editor state, but we just resize and pause it. Should I replace it with the actual result of the conversion (whatever format that may be) and have it play? |
Yes. We don't copy the animated GIF directly since the pasteboard doesn't support that. We copy a file URL to it. We can do the same with MP4. Kap/main/plugins/built-in/copy-to-clipboard-plugin.ts Lines 6 to 8 in eaf8193
|
Only if it's GIF, I would say. As we cannot play AV1, for example. It's GIF that is interesting to see a preview of, as you can then determine whether you need to re-export using different settings. |
@sindresorhus I think I addressed almost everything here. Only question, regarding:
In Exports, Open Original is opening the file back in the editor. What do you mean by this in the editor screen? We added showing the file in Editor, when you click the preview (dragging should also work now). Does that cover that request? The location is the temp file for most plugins, and the actual file for |
Yeah. You're right. It doesn't make sense there since you can just click the "Back" button to get the original in the editor. |
The new changes look good. |
I don't think it's clear enough to the user that they can drag and drop the thumbnail or that they can click it to show in Finder. Maybe we should have a popover the first time the export completed view is shown with a tip about drag and drop and click the thumbnail? Maybe we should also make the filename clickable (with underline) and make it "open in finder"? |
In the export history, I noticed that new entries are added to the end. Shouldn't the most recent export be first? |
Native dialog with some text? Or do we have a better idea for design?
Is the underline always there, or on hover?
We discussed this with @skllcrn , it was either ellipsis from the start or adding the full name on hover. Ended up going with the latter. So if you hover over you should see the extension. One more thing we could do is add it to the description: |
I don't think it should be a blocking dialog. It's just a tip, not important information. A tooltip or toast would be best. It should only be shown once. This is how I do it in Gifski: Maybe @skllcrn has opinions about this.
I would have it always there, but ask @skllcrn.
I would still make the default name template fit for all extensions. Just make the window a tiny bit wider.
I think the extension is better. |
Love the drag and drop tooltip! I don't think underlines are a common pattern on macOS, maybe we could add a way to open the directory from the File menu too? Regarding seeing the full file name including the extension, making the window slightly larger so that default filenames always fit seems reasonable. That said, a quick search tells me that macOS filenames can be up to 255 characters, so truncation is needed in any case, and hovering to see the full value is a nice affordance. |
You're right, it's not a common pattern, but I have seen it done sometimes. I cannot find an example right now. How about this instead; A hamburger menu next to the "Copy" button which would have a "Show in Finder" menu item? It would let us add other things there in the future too.
Sure, but most people just use the default template. |
Sounds good to me! |
I'll add the menu for those. And in the future, we can add the native share menu on that, and actions from the export plugins. What icon should I use for that? Also, does that mean we are removing the show in finder when you click on the preview? Or are we doing both |
Both |
@sindresorhus I implemented the things we mentioned. Not sure about the tooltip styling, just used react-tooltip for it |
I think the tooltip needs some work. It was not clear to me at first it was even a tooltip as it blended into the background. Here's what I would do:
And |
@karaggeorge Maybe we should just get this merged and then open an issue about the remaining stuff? The remaining stuff is not essential. |
It's been a while and I honestly don't remember what was left on this. If the state of the PR is working, and no major issues are there, we can merge/ maybe release? I keep seeing the AV1 issues which were fixed in the previous PR |
Works well for me. |
Rewrites main/renderer code for exports window. Also revisited some logic in the Conversion/Export classes created in the Editor rewrite. Fixed some small issues and added a few things: