-
Notifications
You must be signed in to change notification settings - Fork 19
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
When editing documents, clicking links will open a new Markdown editor #845
Comments
As a workaround I added the following custom CSS rule with CustomCSS, so links will not open when in editing mode:
However, since opening links may still be useful even with the editor (for example when opening files in the regular text editor which does not have a "view only" mode), it may be better to implement a different handling for editing mode:
Also having a context menu which contains the following menu items might be helpful:
|
I think we had a custom link handler implemented that would open the page in question in collectives. This probably broke with the last release. Interesting because we have a lot of tests for links these days. |
To avoid any misunderstanding: when clicking a link in editing mode, the link should not open at all - also not as page in Collectives - because while editing a document it makes no sense to open the link. The normal usecase when editing a document is to place the text cursor in a link by clicking it to be able to change or remove a link. If you want to open a link, you should leave the editing mode first. That's one of the reasons to have a "view" mode and an "editing" mode: one is to view the content which also includes opening links if needed and the other one is to edit content, which means links will not open but can only be edited. Just compare that with Nextcloud Office: when you insert a link to a text document there, the link will be visible as link, but it will not open automatically when clicking it: Instead when you click it, there will be a little popup which offers to open, edit or remove it: This makes much more sense then automatically opening the link and confusing people about what just happend. However in view mode it is ok to open links directly - this would be similar to have an Office document exported as PDF and viewing the PDF: |
To be honest, I'm not sure whether we want to change the current behaviour. Some collectives are configured to use the edit mode as default and people expect to be able to open links from the document in edit mode. I took a look at how other do it:
@nextcloud/designers what do you think? |
I understand the issue with "editing mode by default" - which is also the case for the text editor in Nextcloud outside Collectives. However in my opinion having a little popup to decide wether you want to open a link or edit it when in editing mode (similar to Google Docs or Collabora), would be the most logical solution. Otherwise it is nearly impossible to edit or remove a link in editing mode, since you can not click it without opening the link target. One has to manually move the cursor into the link using the keyboard arrow keys and then you can use the "Insert link" toolbar button to decide what to do with the link. Also keep in mind that not all devices have a keyboard, like tablets. With the current behaviour it is usually impossible to move the cursor into a link in editing mode without opening it. |
I also find it very cumbersome to first click next to the link and then run back into the text with the arrow keys. Sometimes I forget and then the link opens. ggrrrrrr...... |
Interesting problem! I also took a look at the behaviour of other products and almost all of them have a popup appear at some point. Notion has a popup appear on hover and Gdocs, Confluence and Collabora has one appear on click like @mejo- mentioned. This makes me think we could have better link management in general (Mail actually also has a popup that appears on click). However, previously I think we did have a popup for link management in Text and it had a lot of issues with positioning, responsiveness, etc (nextcloud/text#2211 (comment)). I am afraid introducing something like that again will be a regression. what do you think? @jancborchardt |
@nimishavijay previously we did not have a popover for this, but for inserting links – which we moved to the action bar. |
Describe the bug
When editing a document and clicking a link to another document in it to select the link, the link will open a new markdown editor for the document. This is very confusing.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Clicking links in edit mode will be ignored since it makes no sense at all to open a link while editing. One clicks a link to position the text cursor there but not to open it.
Screenshots
Page 1 with a link to page 2:
Now editing page 1:
And this happens, when you click the link while the edit mode is still active - page 2 will open in a markdown editor outside of collectives:
Client details:
Not relevant, happens with all tested clients (Windows, Linux, macOS, Chrome, Firefox, Safari).
Collectives app version: (see Nextcloud apps page)
2.7.0
Operating system:
Ubuntu 22.04
Web server:
Apache 2.4
Database:
MySQL
PHP version:
8.1
Nextcloud version: (see Nextcloud admin page)
27.0.2
Logs
Nextcloud log (data/nextcloud.log)
Browser log
The text was updated successfully, but these errors were encountered: