Bug: Missing 'New Draw.io File' option in Favorites/Personal Files view since NC29 update
Problem Description
The option to create new Draw.io files (diagram/whiteboard) via "+ New" is missing in:
- Favorites view (regression since NC29.0.16 + Draw.io 26.2.15) - e.g. ".../apps/files/favorites?dir=/subdir_1/subdir_2"
- Personal Files view (pre-existing limitation, feature request) - e.g. ".../apps/files/personal?dir=/" Affected Versions:
- Nextcloud 29.0.16
- Draw.io App 26.2.15
Reproduction Steps
- Navigate to "Favorites" view in Nextcloud
- Click "+ New" button
- Expected menu: "New Draw.io Diagram"/"New Draw.io Whiteboard"
- Actual result: Missing Draw.io creation options
Expected Behavior
Consistent availability of Draw.io file creation across all file views, matching previous functionality (NC29.0.10 + Draw.io 26.2.13). It did work for Favorites view once, but not Personal Files view
User Impact:
Blocks quick diagram creation in frequently used workspaces. Screenshot comparison available upon request showing functional vs. broken states.
Works fine for me (see screenshots). Nextcloud 31.0.7 (with custom CSS to remove rounded corners around the main area). Maybe this only affects Nextcloud 29.0.16? But then it seems to be a problem with Nextcloud as well not only Draw.io.
Got similar problem. Draw.io 3.1.1 on Nextcloud 31.0.9.
The menu entries in the "New" menu are missing and .drawio files are downloaded instead of opened. BUT only if the the page is reloaded / loaded via the files app icon on the top. If I click any category on the left pane, any folder on the breadcrumb list or any folder in the files pane, the draw.io menu entries re-appear and files are opened with draw.io again.
Sometimes it helps to disable and enable the Draw.io. This fixed missing MIME type icons in my case after a Nextcloud update. Maybe this also helps with the menu?
@arnowelzel I already tried disable/enable, uninstall/reinstall ans the update-db / update-js occ commands without any changes.
after clicking any folder icon it also works, only the page is loaded (changed app to files) the menu items and file associations disappear. Unfortunately I can't provide any error message, because there is none, not in Browser console, not in the log. I use the current Firefox 144 as browser, there is no error in Chrome.
@arnowelzel I already tried disable/enable, uninstall/reinstall ans the update-db / update-js occ commands without any changes.
after clicking any folder icon it also works, only the page is loaded (changed app to files) the menu items and file associations disappear. Unfortunately I can't provide any error message, because there is none, not in Browser console, not in the log. I use the current Firefox 144 as browser, there is no error in Chrome.
I can confirm this behaviour with Firefox 144.0 - it also happens here in the same way. The items for Draw.io in the "New" menu don't show up first when entering the "Files" app showing the root folder. Even reloading the view does not help. Only when enter a folder, the items of Draw.io also appear.
However since there is no error message in the browser console and the Nextcloud "Files" app also also responsible to add these items, this may also be a bug in Nextcloud. Maybe it's worth reporting it there as well.
This is a bug of this app, not Nextcloud files.
The registerFileAction method must be called in an init script \OCP\Util::addInitScript which is then executed in front end initialization phase.
Otherwise its random if the action is added to the files frontend or not.
If you already know what the problem is - can you provide a PR for this? Or explaing, where \OCP\Util::addInitScript should be in the app? Thank you!
Edit: there is a documentation in https://docs.nextcloud.com/server/stable/developer_manual/basics/front-end/js.html
Unfortunately, I don't have a lot of time to work on this - but maybe some can pick this up?
We got also this issue. (Nextcloud 30 and 31). Draw.io files are randomly not displayed in 'New' menu. When it happens, .drawio files are not opened by draw.io app but downloaded locally instead.
Where are you with the patch ? I see that https://github.com/jgraph/drawio-nextcloud/pull/117 is closed but doesn't seems to be merged.
I'm sorry, I didn't know removing the cloned repository closes the PR.
I tested the application with the change in #117 (use \OCP\Util::addInitScript), but it did not fix the problem (the icons are still appearing randomly).
Doing it within a dedicated listener to OCA\Files\Event\LoadAdditionalScriptsEvent, as suggested in the official documentation, did not help either.
Maybe the problem is in the javascript ?
I tested the application with the change in #117 (use
\OCP\Util::addInitScript), but it did not fix the problem (the icons are still appearing randomly). Doing it within a dedicated listener toOCA\Files\Event\LoadAdditionalScriptsEvent, as suggested in the official documentation, did not help either. Maybe the problem is in the javascript ?
I tested Draw.io on my own Nextcloud instance with Firefox 144.0.2 in Windows 11 - so far I don't see any problem, even without any changes in the Draw.io app. It just works fine.
However: I also have a Nextcloud test instance - and there the problem is reproducable!
Opening Nextcloud in Firefox 144.0.2:
After entering a subfolder and returning to the previous page:
From that point on, it always works - until I leave Firefox and open it agin.
However in Vivaldi even the test instance works fine. But I don't know what the difference is between my production system and the test instance that makes Draw.io fail. If you like to, I can give you a test account to check it on my production system as well, just to verify, if it that works for you as well and to learn, if it is even possible to have a working setup for Firefox with Draw.io. See https://arnowelzel.de/en/about-me for contact (e-mail or Matrix).
Update:
I removed Draw.io on the test instance (not only disabling it, but remove it as well) and re-installed it. Now it also works in Firefox 144.0.2 as expected. So maybe the issue is not (only) a missing init script but also some issue when installing Draw.io. I also remember, that I had problems when upgrading Nextcloud from 32.0.0 to 32.0.1 since MIME type mappings for Draw.io got lost during the upgrade - this also required Draw.io to be removed and installed again to fix that.