Skip to content
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

drag'n'drop unreliable sometimes #3595

Open
r10s opened this issue Dec 19, 2023 · 6 comments
Open

drag'n'drop unreliable sometimes #3595

r10s opened this issue Dec 19, 2023 · 6 comments
Labels
bug Something isn't working OS: Mac Related to MacOS

Comments

@r10s
Copy link
Member

r10s commented Dec 19, 2023

sometimes, drag'n'drop is unreliable and is just not working, took me quite some time to make this reproducible.

but here is an approach on macos13.6 with deltachat1.42.0:

  1. have a fresh PDF-scan in the "Notes" app
  2. drag'n'drop from the "Notes" app to "Delta Chat" -> this does not work
  3. in the "Notes" app, right click the PDF and select "Save as"
  4. drag'n'drop from the "Notes" app to "Delta Chat" -> now same drag'n'drop works

testing with other apps (as "Apple Mail" or "Find") drag'n'drop works already at step 2. - and doing that once, this also enables things to work with "Delta Chat". "Thunderbird" has the same bug, btw

maybe the format drag'n'drop offers changes once the file is exported or otherwise used - and that "Delta Chat" only supports one format.

video showing steps 1. to 4.:

Screen.Recording.2023-12-19.at.14.52.25.mov
@r10s r10s added the bug Something isn't working label Dec 19, 2023
@Simon-Laux
Copy link
Member

Simon-Laux commented Jan 1, 2024

works for me in macOS 14, though I can not exactly reproduce the scanning part, maybe it is a special state?

BTW while testing it I noticed that drag and drop of selected text does not work, while it works in vscode and even from notes to vscode, so it seems possible, but out of scope for us for now.

@r10s
Copy link
Member Author

r10s commented Jan 5, 2024

though I can not exactly reproduce the scanning part

long-tap the "Notes" App icon on the ios homescreen and hit "Scan Document" - if you're using the same apple account on macos and ios, you get the scan on macos.

however, this was just one example i figured out to make the issue reproducible. i have seen that randomly before as well and there may be also other cases where it happens.

@Simon-Laux
Copy link
Member

Really seems to be sth when the file does not exist in apple's filesystem. not sure what the format then is, but I was not able to get the state yet, maybe I could get it when I connect the same Apple IDs on iPhone and macOS, but currently I don't want to do that.

@Simon-Laux Simon-Laux added the OS: Mac Related to MacOS label Feb 28, 2024
@Simon-Laux
Copy link
Member

please reopen if this is still an issue in new versions (macOS and deltachat desktop / electron).

@r10s
Copy link
Member Author

r10s commented Jul 31, 2024

i just retried on macos 14.5 with Delta Chat 1.46.1, it is still an issue and exactly reproducible in the same way as shown in the initial post.

maybe I could get it when I connect the same Apple IDs on iPhone and macOS, but currently I don't want to do that.

i think, this is needed for reproducing the way shown above.

there may be other ways for reproducing that do not require connection, but we do not know them (i expect the clipboard just to have some other format for a file that is not present in the filesystem yet)

however, if it is really only about the "Notes" app, it also seems fine to put that to resurrection and close it as "Not Fixed" - if we have a similar issue for other clipboard formats, we will remember

@Simon-Laux
Copy link
Member

I bet this is an electron issue. I guess you could add a log statement in the drop handler and inspect the dev console if there is anything useful in it, if not then we can close it as won't fix.

to test add a log statement (console.info('dropped something', e)) to log the drop event e here:

const onDrop = (e: React.DragEvent<any>) => {
if (chat === null) {
log.warn('dropped something, but no chat is selected')
return
}
e.preventDefault()
e.stopPropagation()
const sanitizedFileList: Pick<File, 'name' | 'path' | 'type'>[] = []
{
const fileList: FileList = (e.target as any).files || e.dataTransfer.files
// TODO maybe add a clause here for windows because that uses backslash instead of slash

then look at the log to check if there is sth useful in e and post it in this thread.

@Simon-Laux Simon-Laux reopened this Jul 31, 2024
Simon-Laux added a commit that referenced this issue Aug 11, 2024
this could have fixed the following issue #3595 as a side effect, if not then that issue is not fixable, altleast unless we start interacting with the OS Apis directly in a native module or by contributing to electron.
Simon-Laux added a commit that referenced this issue Aug 29, 2024
this could have fixed the following issue #3595 as a side effect, if not then that issue is not fixable, altleast unless we start interacting with the OS Apis directly in a native module or by contributing to electron.
Simon-Laux added a commit that referenced this issue Sep 8, 2024
this could have fixed the following issue #3595 as a side effect, if not then that issue is not fixable, altleast unless we start interacting with the OS Apis directly in a native module or by contributing to electron.
Simon-Laux added a commit that referenced this issue Sep 9, 2024
this could have fixed the following issue #3595 as a side effect, if not then that issue is not fixable, altleast unless we start interacting with the OS Apis directly in a native module or by contributing to electron.
Simon-Laux added a commit that referenced this issue Sep 9, 2024
* - convert project to use pnpm instead of npm
- docs: mark e2e testing section as "defect"
- remove vscode lint task

* remove unused file

* remove testcafe stuff

* move bulk of source files, does not work yet

* more progress like adjusting paths, making new packages and updating docs

* ts: change all targets to es2018

* set min pnpm and nodejs versions in package.json

* add check:types script

* use pnpm workspace catalogs for shared dependencies

* add scripts to change the core thats used

* fix fmt

* script to update/sync versions for targets

* replace remaining references to electron from runtime interface:
- `Electron.OpenDialogOptions` -> `RuntimeOpenDialogOptions`
- qelectron.app.getPath()` -> `RuntimeAppPath`

* fix lint of shared import in frontend

* disable drag and drop files for now

It is easier to fix later when we can test it

* on paste: remove usage of `File.path` which was not set in some of the cases.

* add missing debounce dependency to target-electron

* fix lint of shared import in target-electron

* global definition for electron-runtime

* fix fmt

* remove last direct usage of electron from frontend.
move Deltachat jsonrpc transport to runtime-interface implementation

* bundle backend code (targe-electron),
move most dependencies to dev dependencies because they are now bundled

* proper native sourcemap support during development for main process

* mention `NODE_OPTIONS=--enable-source-maps` in docs

* document `TEST_DIR`

* fix loading locales in electron main process for devleopment
Also add `DELTACHAT_LOCALE_DIR`env var to allow replacement of the localse folder. useful for debuging but you could also make a tool for users to live edit translations in a released version of deltachat together with the `--translation-watch` flag.

* fix fmt

* add the idea for end user translation tool to docs in a footnote

* make build info part of the runtime
and its generation part of the target-electron build script

* rm used yerpc import in backend-com

* move non shared types from shared to where they belong.
Also improved some comments.

* sort scripts by whether they work yet

* progress on making frontend build (ts and scss so far)

* fix path in comment

* - sort static files into to their projects
- new location for themes html-dist
- make build themes script a bit faster and simpler

* make copy fail with exit code 1 if dir is not found (unless it is started in watch mode)

* make it run again (styles are broken but basics and logic work)

* reintroduce dev script as alias to dev:electron

to make transition easier for devs

* fix blueprint import (bundle it)

* fix images and icons

* fix loading themes

* update theming docs

* remove dead code

* use correct log level when logging to console in main process

* make drag and drop work again

this could have fixed the following issue #3595 as a side effect, if not then that issue is not fixable, altleast unless we start interacting with the OS Apis directly in a native module or by contributing to electron.

* harden electron functions, only runtime can use them now

* harden runtime by deleting the reference on window (`window.r`) after the first use.
For development it is now accessible at `exp.runtime` but only in --devmode like `exp.rpc`

* update_core docs:  update the start command for electron

* fix eslint issues and fix formatting

* improve ./bin/test_for_missing_translations.sh script

it's now more correct, helpful and faster

* update ./bin/topEvil.sh script

* scripts to update and check package versions

* update prettierignore

* update ./bin/update_background_thumbnails.sh script

* fmt language list

* update theme builder script to use compileString instead of renderSync, because the latter is deprecated

* fix that composer was monospace font

* tests for packages/shared

* make migration test work

* add testing to ci

* add test-and-check script

* make watch scripts work

* docs: add hint about completion in terminal for pnpm

* make packaging work again

* update ci and docs

* make `check:log-conventions` part of checks

* update dev docs

* update more pnpm commands

* delete old package.json

* update file tree in docs

* ci: fix building preview

* update the versions (for/from main branch rebase)

* add changelog

* runtime: also use catalog: dependency on @deltachat/jsonrpc-client

to fix tests

* test building in ci and fix ci test

* ci: fix dev-builds

* add comment to `previewBuild` variable in gen-electron-builder-config.js

* update target versions

* fix preview build ci

* fix devbuild

* fix tray and app icon

* other appid for preview build on mac

* fix readme commands

* Fix if Contact has long bio, then shared chats are hidden (#4093)

* set min height for shared chats in profile view
fixes #4092

* more clear varname

* refactor styles a tiny bit to make status text scroll if there is little space

* remove workaround from #4068, can't reproduce the bug of it anymore

* fix that you can not click header button in dialog when they are on top of the navbar
also see #4018

* add changelog entries

* fix fmt

* update versions after rebase to match main branch:
- deltachat-core (stdio-server and jsonrpc-client) 1.142.10
- electron-notarize 2.4

* fix chatlist image thumbnails (#4101)

* fix chatlist image thumbnails

* changelog entry

* update core after rebase

* fix changelog
@WofWca WofWca changed the title drag'n'drop unreliable somtimes drag'n'drop unreliable sometimes Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OS: Mac Related to MacOS
Projects
None yet
Development

No branches or pull requests

2 participants