Closed dominikegert closed 1 month ago
This is likely an issue in the framework we use Electron. I'm not able to reproduce the issue likely because of OS differences. But if you wanted to report it back to Electron, the first step would be to see if you can reproduce it more minimally.
You can download the Electron Fiddle app and load this fiddle I've started for you: https://gist.github.com/beb77598fa7c7f3ad843fa32b359fa73. If you click "Run" you can see how the app behaves on your operating system.
I'm going to close this since I can't reproduce it
FYI I can repro this on Kubuntu 24.04. @jamiebuilds-signal, what distro are you using?
Here my details:
Operating System: Arch Linux KDE Plasma Version: 6.2.1 KDE Frameworks Version: 6.7.0 Qt Version: 6.8.0 Kernel Version: 6.9.8-1-clear (64-bit) Graphics Platform: Wayland Processors: 20 × 12th Gen Intel® Core™ i7-12700K Memory: 15,4 GiB of RAM Graphics Processor: AMD Radeon RX 7900 XT Manufacturer: Gigabyte Technology Co., Ltd. Product Name: Z790 UD
If I understand this correctly, your posted fiddle opens a dialog to select a file. - But how is this the same as if I would want to save a file, and want the dialog to receive that filename, which was given in the message from signal-chat?
What would I report to electron project, can you point me into the correct direction here, maybe?
This is likely an issue in the framework we use Electron. I'm not able to reproduce the issue likely because of OS differences. But if you wanted to report it back to Electron, the first step would be to see if you can reproduce it more minimally.
You can download the Electron Fiddle app and load this fiddle I've started for you: https://gist.github.com/beb77598fa7c7f3ad843fa32b359fa73. If you click "Run" you can see how the app behaves on your operating system.
I'm going to close this since I can't reproduce it
I have fiddled a bit with what you have provided and I come up to the conclusion, it should be something along these lines, or am I off charts here??
async function main() {
// Wait until the app is ready
await app.whenReady()
**const options = {
defaultPath: app.getPath('documents') + '/electron-tutorial-app.pdf',
}
// Show a dialog to select a file
const opened = await dialog.showSaveDialog(null, options, (path) => {console.log(Path);})**
// Stop the dialog was closed without selecting a file
if (opened.canceled) return
// Get the selected file path
const [filePath] = opened.filePaths
// Get the selected file name ("/path/to/file.txt" -> "file.txt")
const fileName = path.basename(filePath)
// Show a dialog to save
await dialog.showSaveDialog({ defaultPath: fileName })
// Goodbye
app.quit()
}
@dominikegert Sorry yes it seems like you could simplify the code even more then:
const { app, BrowserWindow, dialog } = require('electron')
async function main() {
// Wait until the app is ready
await app.whenReady()
// Create a new window
const window = new BrowserWindow()
// Show a dialog to save a file
await dialog.showSaveDialog(window, { defaultPath: 'example.pdf' })
// Goodbye
app.quit()
}
main()
Fiddle: https://gist.github.com/b4798bed4fa77f0c62947534c7738fab
This is a screenshot from macOS (Not at my other computer for the moment):
When you open this updated fiddle are you not seeing "example.pdf" in the default file name?
Actually I am not...
Take a look:
I have reported a bug on electron project https://github.com/electron/electron/issues/44390
Using a supported version?
Overall summary
When receiving a file, iE a pdf. - Clicking on it will open the "Save" dialog, but neither file extension, nor filename are carried over. - I have to type the name myself.
Steps to reproduce
Expected result
The filename should be carried over to the "Save" dialog
Actual result
The filename is not being carried over.
Screenshots
No response
Signal version
7.29.0
Operating system
Arch Linux 64-bit
Version of Signal on your phone
7.19.2
Link to debug log
https://debuglogs.org/desktop/7.29.0/b45b947b773745410a446c978eb04da293b89fc39302d596420bb52b4d6ba480.gz