-
Notifications
You must be signed in to change notification settings - Fork 87
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
Do not force line break spacing on the user #2761
Comments
Okay I see that now. I did not know this. Nor is this provided in the Formatting help pop-up. What about in mobile, how do you type without page break spacing? |
Would be interesting to see if any other mobile editors handle the different linebreaks during input. I think for desktop that is quite common, but at least I'm not aware of a general pattern for this on mobile. |
Most I know only support new paragraphs on mobile. But I think of some input rule like hitting enter one time will trigger a newline and hitting it two times triggers a new paragraph. |
Since this is a matter of formatting, I think the most straightforward and most consistent way to do this is to put an icon in the formatting tray with all the other formatting icons. When the icon is active, hitting enter results in line break spacing (same behavior as what is now Shift + Enter on web). When the icon is not active, hitting enter behaves like normal enter. This also allows the matter to be resolved in mobile as well.
|
I guess that icon would be pretty confusing, as it looks like adjusting the line height (or line spacing) in most office apps. |
I get what you mean, it is actually a full double line break instead of space in between two line breaks. Then I think there are two possible solutions that would solve the problem the easiest:
Both solutions also solve the problem on mobile. |
It looks like this functionality needs to be fixed anyways, because as you can see in the video below, when entering a new line break via a single line each (Shift+Enter), it carries over the Heading formatting to the previous line. This does not happen when entering a new page break via double line. So I recommend we fix the logic based on Option 1 or 2 as mentioned above, and in doing so we fix the problem as I have shown. If agreed, I am willing to contribute. Nextcloud.Text.Single.Line.Formatting.Issue.webm |
I disagree on those points. In general there are no things as double links break, they are semantically different. One is a paragraph break and the other a line break and both office suites (MS Office, Libreoffice, as well as rich editors (like Notion) handle this separation by using Enter for a paragraph break and Shift+Enter for a line break.
This is expected behavior, as the newline will then be part of the heading block. Heading can only be ended by starting a paragraph, which adds spacing but not due to double newlines but due to the styling that we apply. cc also @nimishavijay / @jancborchardt for the UX bits :) |
Okay, I see what you mean by the functional difference between line break and paragraph break and I do recognize the importance of this distinction. But it does not change the core issue I've been trying to address, which is that in all those examples you mentioned, "MS Office, Libreoffice, as well as rich editors (like Notion)," a paragraph break does not have double spacing styling by default -- but it does in Nextcloud Text. Perhaps there is a visual workaround on Web by using line breaks instead of paragraph breaks (which has some functional limitations as I have shown in the video), but that still leaves the problem that double spacing cannot be avoided on mobile. Might I just ask the same question again, but using the correct syntax to avoid confusion: Wouldn't this all be avoidable if paragraph breaks didn't have double line spacing? The user who wants double spacing just needs to hit Enter twice (virtually no inconvenience added and is common behavior), and the user who doesn't want it now has the choice. StackEdit is a nice example of a smooth markdown editor that gives the user full control when editing and does not force this kind of formatting on the user. |
The common Office suits do use spaces before/after paragraphs. Also depending on the textformatting you use. Of course the Office suits are way more complex than just a markdown editor. I would vote to keep a default spacing between paragraphs. But I'm also missing the possibility to use Shift+Enter on mobile. Maybe it would be possible to convert a backslash at the end of a line to a hard line break? EDIT: just adding the link to the hard line breaks of the commonmark spec... also double spaces at the end of a line seems to be used. |
Very interesting issue. I would say we don't need any toggles as it would be confusing. Even in the Google Docs video, the icon used is to indicate line height, only in the additional options is there any mention of line breaks. Pretty much every other editing tool allows you to use
I agree. On mobile there is no way to have a line break. Many markdown guides explicitly mention that a double space or a backslash ( \ ) at the end of a line indicates a line break. We could have support for both and convert it to a |
Regarding the Jetbrains source mentioned, the guidance there seems perfectly clear on new paragraphs: "To start a new paragraph, leave a blank line between lines of text." Wouldn't the simplest solution to this be to not try to mess with the user's spacing at all? Just take a literal interpretation. If they hit enter key once, that translates to a line break (no need to worry about trailing spaces or This solution works on mobile too. Why complicate it with anything further? |
Those are two different things. As text is primarily a rich text editor (which only uses markdown in the background) this only partly applies. As the scope of text is rich editing we will always focus on the visual representation where as mentioned above we follow the common pattern of using a paragraph break on simple enter.
A single line break (as entered with shift enter), will in the backend be converted to a markdown newline. Using a \ as trigger for that newline on mobile will not work as then there would be no way keep it if you actually want to enter a backslash. I'd say we there is a reasonable idea how to trigger that without conflicting other behaviour or adding an extra button, we could add this. Otherwise I'd consider this a not too common use case. |
Note we could also trigger it by two spaces, but most mobile keyboards will change this to |
I did a little research online about how other editors are doing this for mobile. A keyboard solution that was mentioned: Hit Enter (new paragraph) and then hit Backspace to make it a single line break. Alternatively (one I just thought of), starting a new line with a space could move it back to a single line break. It's similar in concept to ending the previous line with two spaces, but won't have the auto |
Good points, so as usual let’s compare with other solutions:
So we are visually closer to Notion, but maybe we should change it to behave like in the established solutions like Google Docs etc. What do you think @juliushaertl @nimishavijay? (Nimisha you mentioned "pretty much any other editing tool, which ones did you look at?) I think we should not have it behave differently on mobile though. |
@jancborchardt The short cut we discussed above would be shift+Enter. Ctrl+Enter would be a new one, but also not possible on mobile. In this issue are actually two questions:
I think the backspace might indeed be a nice solution, but only if it works on both Desktop and mobile to avoid confusion. Then it would solve both issues IMHO. What do you think @jancborchardt @nimishavijay ? |
Agreed! We should preserve the behaviour of
We could add it to the formatting help modal, since there are a bunch of keyboard shortcuts there anyway :) cc @jancborchardt on this when he's back |
I realize that this thread is old, but the |
Works for me: Bildschirmaufzeichnung.vom.01.08.2023.08.57.43.webmIs that also what happens to you? If not could you specify which version you are using and record what you are seeing? |
While it does create a new line without double line spacing, it does not allow you to create a new bullet point without double line spacing. As an example, Github renders each bullet point of the README for this project without double line spacing, however NextCloud adds the equivalent of double line spacing between each list item when rendering lists. I'd expect to be able to be able to create list items without the excessive spacing using the same mechanism as paragraphs. |
@syzdek Ah... I see. The line hight was too big due to a bug. We just landed a fix for this recently. It will change the space between list items from 1em to .5em. - which has the same effect as the line hight of 1.5em that github uses here:
Fix will be released with the upcoming maintenance releases. |
Is your feature request related to a problem? Please describe.
Two of the greatest advantages of markdown editors are 1) simplicity and 2) control. Nextcloud Text misses Point 2 when it FORCES line break spacing on the user. There are many times I don't want spacing in line breaks when taking notes -- such as if I am just jotting loose ideas, or I want to cluster concepts together. But with forced line break spacing the file becomes long and spaced out, with no discernible idea clusters. Furthermore, when downloading to markdown, those spaces turn into full line breaks of their own, which makes the document even more spaced out. Most of the major rich-text notetaking apps are not forcing line break spacing, such as Evernote, OneNote, Google Keep, etc, and I think that's for good reason -- they recognize the user doesn't always want this.
Describe the solution you'd like
Option A: Get rid of line break spacing entirely. If the user wants space after a line break, they can do it manually with their keyboard (just hit 'enter' one more time). A tried and true method that dates back to the typewriter 😉.
Option B: If we must keep some iteration of this feature, then give the user the OPTION to turn this on or off with a button in the feature tray. Line break spacing would be attributed to a block of text (i.e. the text in between line breaks). If it is turned on for the block, then there is spacing underneath. If it is turned off then there is no spacing.
Additional context
Google Docs Line Break Spacing Example.webm
The text was updated successfully, but these errors were encountered: