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

Configurable line-length for Editor #4024

Open
RoepLuke opened this issue Apr 4, 2023 · 12 comments
Open

Configurable line-length for Editor #4024

RoepLuke opened this issue Apr 4, 2023 · 12 comments
Labels
enhancement New feature or request needs info

Comments

@RoepLuke
Copy link

RoepLuke commented Apr 4, 2023

Hello there,

I have had a look through previous issues regarding the same broad topic, but as those are all currently closed, I'd like to open one here again. My Feature request is about the current Limit on the amount of characters/pixels in one Line in the Editor.

Related Issues I found: #24 #125

I can understand the Aspect of this setting currently being at about 80–120 characters (or is it now based on pixels?) because experts say that it should be, but not everyone wants to publish his/her work and reasonably might prefer to use more or less than (in my case) 1/3 of the screen width on a 15" Full-HD landscape display.

Describe the solution you'd like
I'd like to be able to set the line-length/padding either from the Admin Settings or by the User in the Personal Settings.
Alternatively, a Slider on the Bottom of the Editor View that defaults to the currently fixed amount of characters and could be dynamically adjusted would be great.

Describe alternatives you've considered
Setting my browser to 130% Zoom, which only solves the Issue of "wasted" horizontal space, but not the Issue of not being able to fit more Information in one line (for example in Tables with more than 4 columns).

Additional context
Default View (:root --text-editor-max-with: 670px) at 100% Zoom
Bildschirmfoto vom 2023-04-04 23-16-00-obfuscated

Default View (:root --text-editor-max-with: 670px) at 133% Zoom
Bildschirmfoto vom 2023-04-04 23-29-44-obfuscated

Modified View (:root --text-editor-max-with: 1200px) at 100% Zoom
Bildschirmfoto vom 2023-04-04 23-27-02-obfuscated

Thank you very much!

Post Edits:

  • Added physical Display Size
  • Changed wording from amount of chars to padding
  • crossed out "preferred" solution
@RoepLuke RoepLuke added the enhancement New feature or request label Apr 4, 2023
@juliushaertl
Copy link
Member

@nextcloud/designers This seems to be a reoccurring issue that bugs users. Not sure if we want to have a setting though.

Notion for example has two modes that can be toggled and are remembered per document:

Screenshot 2023-06-22 at 09 21 00

@marcoambrosini
Copy link
Member

I think it's ok to allow users to do that

@nimishavijay
Copy link
Member

@jancborchardt what are your thoughts here? In the past we have avoided going above a certain width for readability. Notion and Confluence also have this option and the point about Tables and images being cramped makes sense for big screens.

@arnowelzel
Copy link

Using CustomCSS you can apply the following rules to get a maximum width of 960px (or apply any value you prefer) - not perfect yet, since table of contents will not work correct then, but otherwise usable:

:root {
    --text-editor-max-width: 960px !important;
}

.page-title, div.editor {
    max-width: 960px !important;
    margin: 0 auto;
}

I also changed the default text size to be 16px which is also much easier to read for me.

@arnowelzel
Copy link

@jancborchardt what are your thoughts here? In the past we have avoided going above a certain width for readability. Notion and Confluence also have this option and the point about Tables and images being cramped makes sense for big screens.

The default size of 670px is roughly about 41em in standard text size of 16px - but the editor even uses a smaller default font size (14px), so it may be about 47em per line.

Also see https://baymard.com/blog/line-length-readability where a length of 50-75 characters per line is also acceptable. In many cases I find 960px for a 16px font also very usable. Since the line height in the editor is already 150%, this should not be major issue.

And when talking about "readbility": fonts for regular text should not be smaller than 16px. This is the default text size in most browsers for a good reason.

About tables: I know, there are technical limitations as well and that is not easy to implement - but I would prefer having tables without any width limitation at all and using the available width. Confluence for example has setting for that to display tables at 100% width even when the document itself is narrower to stay readable.

@juliushaertl
Copy link
Member

Apparently we use a standard font size of 15px, so having 14px in the editor is actually a bug. I remember some discussion to also increase it to 16px but cannot find the ticket in server for that.

@jancborchardt Could you have another look at the above discussions?

@arnowelzel
Copy link

Apparently we use a standard font size of 15px, so having 14px in the editor is actually a bug. I remember some discussion to also increase it to 16px but cannot find the ticket in server for that.

@jancborchardt Could you have another look at the above discussions?

I don't know exactly where the 14px come from, but I added some custom CSS to have 16px as default in the editor and 14px for code and preformatted sections, since this fits better to the regular text:

div.ProseMirror p,
div.ProseMirror th,
div.ProseMirror td {
  font-size: 16px;
}

div.ProseMirror code,
div.ProseMirror pre {
  font-size: 14px;
}

@juliushaertl
Copy link
Member

Pushed a small PR for this in #4644, so also changing it through the CSS variable is properly adapted for now :)

@juliushaertl
Copy link
Member

First iteration to bring this to collectives is in nextcloud/collectives#874

@mejo- Maybe this one is a good follow up then in text.

  • Needs decision if we persist it only in the browser or also in the file (e.g. frontmatter)
  • Make sure that state is shared between collectives/text

@evilJazz
Copy link

The following is what I am using in conjunction with the CustomCSS plugin for now. This also takes care of the outline to the left of the document (if enabled). Currently fixed to max width of 1600px. z-index Patch to get outline clickable again.
TODO: Using variables and making it pretty without the !important BS

.text-editor__content-wrapper {
  display: unset !important;
}

.editor__content {
  max-width: min(1600px, 100vw - 300px - 40px) !important;
  margin: 20px auto auto 300px !important;
  width: unset !important;
}

.text-editor__content-wrapper:not(.--show-outline) .editor__content {
  max-width: min(1600px, 100vw - 40px) !important;
  margin: 20px auto !important;
}

.editor--outline {
  z-index: 100000;
}

@modernNeo
Copy link

now that nextcloud/collectives#874 has been merged and nextcloud/collectives#242 has been closed, I was wondering what is left for https://github.com/nextcloud/notes to get the text-width feature toggle?

@juliushaertl
Copy link
Member

I've been discussing this today with @jancborchardt and we came to the agreement to:

  • Add a global setting for the default page width per user be either full page or the existing size
  • Allow to toggle the width per document overriding the user setting (which should be persisted in the markdown frontmatter)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs info
Projects
Status: 🧭 Planning evaluation (don't pick)
Development

No branches or pull requests

8 participants