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

Outline view #2688

Conversation

vinicius73
Copy link
Member

@vinicius73 vinicius73 commented Jul 8, 2022

Summary

Add Outline view to display Table of Contents

image

image

image

Peek.2022-08-16.16-18.mp4

@vinicius73 vinicius73 added enhancement New feature or request design Experience, interaction, interface, … 3. to review labels Jul 8, 2022
@vinicius73 vinicius73 force-pushed the 107-outline-view-of-headings-for-quick-navigation-table-of-contents branch from 125741a to fbb3dc6 Compare July 8, 2022 21:02
@vinicius73 vinicius73 marked this pull request as ready for review July 8, 2022 21:27
@max-nextcloud
Copy link
Collaborator

This looks really great! 👏

@mejo-
Copy link
Member

mejo- commented Jul 9, 2022

Wow, this looks super nice @vinicius73 😍

How does it look like on mobile, did you find a good solution there already? Also, what happens if your window is not wide enough to display the outline? Text width is 670px, so e.g. when you're on a tablet with 800px.

@susnux
Copy link
Contributor

susnux commented Jul 9, 2022

This looks awesome! 😍

One note: I think the ID generation is better suited within the Heading node, like introduced in #2520, so maybe first get the anchors?


Also, what happens if your window is not wide enough to display the outline? Text width is 670px, so e.g. when you're on a tablet with 800px.

at 800px

It is possible to use it, but not that nice. It works perfect starting with ~900 - 1000px.

On some other application this is solved by providing a button, something like , floating on the left side that enables some kind of drawer functionality. So the toc is faded in from the left side.

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice nice! :) Some first feedback:

  • The line below "Outline" is not necessary
  • The text "Outline" is a bit too present. You can reduce the size to be the same size
  • The text "Outline" should be left-aligned with the h1 titles below, currently it is a bit off to the left
  • Currently the outline section doesn’t seem to be vertically aligned with anything. Could you align it so that when the Text app contains normal text in the first line, the text "Outline" and that text in the first line vertically aligns?
  • When clicking to navigate to a section, currently it immediately jumps. Could this be done with an ever-so-quick animation? Just like 100-250ms, so really not long, but an animation to give some feedback would be great.
  • When there are no headings, I assume the whole outline box just vanishes? (Didn’t test yet)
  • Possibly unrelated, but that blue border around the text content is not going to stay, right?

On some other application this is solved by providing a button, something like ➤, floating on the left side that enables some kind of drawer functionality. So the toc is faded in from the left side.

Yep, agree that would be nice. :)

@vinicius73 vinicius73 force-pushed the 107-outline-view-of-headings-for-quick-navigation-table-of-contents branch from fbb3dc6 to 99361e3 Compare July 12, 2022 16:52
@vinicius73
Copy link
Member Author

@jancborchardt

Possibly unrelated, but that blue border around the text content is not going to stay, right?

It is from /core/css/inputs.scss

/core/css/inputs.scss

@vinicius73
Copy link
Member Author

@jancborchardt

When there are no headings, I assume the whole outline box just vanishes? (Didn’t test yet)

Not now.
The title (outline) and the content (table of contents) are two different components.

The idea is to use outline to wrap "metadata" like table of contents and word counter #2664 (comment) and other possible tools.

@vinicius73
Copy link
Member Author

@jancborchardt

When clicking to navigate to a section, currently it immediately jumps. Could this be done with an ever-so-quick animation? Just like 100-250ms, so really not long, but an animation to give some feedback would be great.

I agree, but unfortunately it will be a hard task for now.
The scroll is handled by prosemirror.scrollIntoView() this method is not able do it.
We must find another way.

Can we postpone it to other issue?

@mejo-
Copy link
Member

mejo- commented Jul 13, 2022

@vinicius73 this will also fix #299, right?

@susnux
Copy link
Contributor

susnux commented Jul 14, 2022

The idea is to use outline to wrap "metadata" like table of contents and word counter #2664 (comment) and other possible tools.

And maybe also for #145 (?)

@jancborchardt
Copy link
Member

The idea is to use outline to wrap "metadata" like table of contents and word counter #2664 (comment) and other possible tools.

Word count can go in the 3-dot menu as a last entry, that’s a much cleaner place for it. Let’s keep outline for outline. :)

The scroll is handled by prosemirror.scrollIntoView() this method is not able do it. We must find another way.
Can we postpone it to other issue?

Yes absolutely, this is not critical to this issue.

@vinicius73
Copy link
Member Author

@susnux

And maybe also for #145 (?)

Yes, it is a possibility.

@vinicius73
Copy link
Member Author

@jancborchardt

Word count can go in the 3-dot menu as a last entry, that’s a much cleaner place for it. Let’s keep outline for outline. :)

And about other stuffs like #145 #3 #2142 ?

@vinicius73
Copy link
Member Author

@mejo-

@vinicius73 this will also fix #299, right?

It is related, but this PR no dot resolver this issues yet.
@susnux's PR is directly related #2520, although we need to discuss more about the better way to do it.

@juliushaertl
Copy link
Member

@jancborchardt

Word count can go in the 3-dot menu as a last entry, that’s a much cleaner place for it. Let’s keep outline for outline. :)

And about other stuffs like #145 #3 #2142 ?

As discussed lets keep those discussions separate and start off with the outline view only.

@vinicius73 vinicius73 force-pushed the 107-outline-view-of-headings-for-quick-navigation-table-of-contents branch 2 times, most recently from d061455 to 6c96aab Compare July 22, 2022 19:01
@juliushaertl
Copy link
Member

Very nice, just a few additional comments from my side:

  • The animation is nice but feels a bit slow, also it does slide in every time you change the headline, maybe we can only do that on the initial adding and speed it up a bit
  • I think the outline should probably be hidden by default and then we can have a button to show/hide it
    • Not sure where to position it, but maybe we can put it to the top left as the app navigation toggle would be on other apps
    • We could store the state if open or closed in the browser local storage to remember the user preference at least locally
    • On mobile we could hide it in the right popover menu next to the author colors

What do you think?

@vinicius73
Copy link
Member Author

/compile

@vinicius73 vinicius73 force-pushed the 107-outline-view-of-headings-for-quick-navigation-table-of-contents branch from 3c3364d to 29b5ceb Compare August 16, 2022 19:30
@vinicius73
Copy link
Member Author

Ready to review

@juliushaertl
Copy link
Member

@vinicius73 Can you make sure every commit message has a signed off message and rebase to latest master? :)

Cypress failure looked unrelated so I restarted that.

Vinicius Reis and others added 12 commits August 17, 2022 11:31
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
@vinicius73 vinicius73 force-pushed the 107-outline-view-of-headings-for-quick-navigation-table-of-contents branch from 29b5ceb to 67355fb Compare August 17, 2022 14:44
@juliushaertl
Copy link
Member

/compile

nextcloud-command and others added 2 commits August 18, 2022 08:25
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliushaertl juliushaertl merged commit 4c7badd into master Aug 18, 2022
@delete-merged-branch delete-merged-branch bot deleted the 107-outline-view-of-headings-for-quick-navigation-table-of-contents branch August 18, 2022 12:35
@mirisbowring
Copy link

When will this be available in Nextcloud? Everything is up to date on my installation.

@susnux
Copy link
Contributor

susnux commented Oct 16, 2022

When will this be available in Nextcloud? Everything is up to date on my installation.

With nextcloud 25, scheduled for end of October (afaik)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review design Experience, interaction, interface, … enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outline view of headings for quick navigation (table of contents)
9 participants