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

Can't navigate back to currently open document from outline view #1291

Closed
protostork opened this issue Dec 12, 2022 · 12 comments · Fixed by #1306
Closed

Can't navigate back to currently open document from outline view #1291

protostork opened this issue Dec 12, 2022 · 12 comments · Fixed by #1306
Assignees
Labels
usability Issue: Could do with some improvement user interface Component: General user interface
Milestone

Comments

@protostork
Copy link

protostork commented Dec 12, 2022

Hi, the new version is great, some superb improvements and codebase clean-up! ✊ Sharing a small UX bug / unexpected behaviour in the Outline view.

Steps to Reproduce

  1. Start a new example project (or use an existing one).
  2. Go to outline view, double click on 'Making a scene': it takes you to the 'Chapter One' document's sub-document 'Making a scene' in the normal editor view.
  3. Go to outline view again, and double click / ctrl+o on 'So it begins', or any of its sub-sections.
  4. Nothing happens.
  5. If you click on a sub-section contained in a different actual document file from the outline, it does take you there, but if selecting within the same document it does not react.

Expected behaviour

You would expect a double-click or ctrl+o to always return you to the editor view and the same document and the appropriate sub-section. This is also the standard behaviour in the Novel Tree sidepane view.

Background: My use case

I am currently using Novelwriter without very many sub-documents, but as basically one long novel document with headers as subsections and chapters. The outline view and the 'novel' view display all the hierarchy and notes fantastically, but the outline view becomes almost unusable when you can't jump back to the right place in the editor view from it.

@protostork protostork added the bug Issue: Something isn't working label Dec 12, 2022
@vkbo
Copy link
Owner

vkbo commented Dec 12, 2022

This is not a bug. The reason a new "open document" call isn't processed any more is that doing so would reset the undo buffer of the editor. This could be annoying in some cases, so the action is blocked. The navigation from the novel view and outline view use the same code, but for the novel view it doesn't matter since the editor is already visible.

What would make sense still is that the the view is shifted to show the editor again, even if a new document isn't loaded. I can make that change. It is more consistent with how it used to be before when it would reload a document regardless of whether it was open or not.

@vkbo vkbo self-assigned this Dec 12, 2022
@vkbo vkbo added this to the Release 2.0.3 milestone Dec 12, 2022
@vkbo vkbo added enhancement Request: New feature or improvement user interface Component: General user interface not a bug Invalid: Feature, not a bug usability Issue: Could do with some improvement and removed bug Issue: Something isn't working enhancement Request: New feature or improvement labels Dec 12, 2022
@vkbo
Copy link
Owner

vkbo commented Dec 12, 2022

I am currently using Novelwriter without very many sub-documents, but as basically one long novel document with headers as subsections and chapters. The outline view and the 'novel' view display all the hierarchy and notes fantastically, but the outline view becomes almost unusable when you can't jump back to the right place in the editor view from it.

On a sidenote, if you have any suggestions for the novel view, feel free to add feature requests, The feature was completely rewritten for 2.0, and is still a bit of a work in progress.

I prefer to outline the structure of my stories, so I start with one document per act that I break down in steps as I add a synopsis, then excerpt, then text to each scene. I rewrote the novel view with this in mind, and I usually use it when writing as well.

Also, keep in mind that the novelWriter text editor becomes a bit sluggish on very large documents, so you may want to break it up in at least a few docs when you get into the 200k word area, if that's where you end up.

@protostork
Copy link
Author

This is not a bug. The reason a new "open document" call isn't processed any more is that doing so would reset the undo buffer of the editor.

Ah, that makes sense, wasn't aware of that.

What would make sense still is that the the view is shifted to show the editor again, even if a new document isn't loaded. I can make that change. It is more consistent with how it used to be before when it would reload a document regardless of whether it was open or not.

Yes, that would be great already - at the moment it's a little confusing, as clicks in the outline view sometimes do something, and sometimes do nothing.

It would be great if it could also scroll to the correct h3 scene / h2 heading / etc that's been clicked, if a sub-heading is clicked (i.e., the same as in the novel tree view).

@vkbo
Copy link
Owner

vkbo commented Dec 12, 2022

It would be great if it could also scroll to the correct h3 scene / h2 heading / etc that's been clicked, if a sub-heading is clicked (i.e., the same as in the novel tree view).

It already does that actually. It works the same way as double-clicking in the novel view. The only thing that needs to be added is that it shifts the editor into view.

@protostork
Copy link
Author

On a sidenote, if you have any suggestions for the novel view, feel free to add feature requests, The feature was completely rewritten for 2.0, and is still a bit of a work in progress.

Thanks! I think the new novel tree view is a huge improvement already, as it really helps with certain workflows, like when planning a plot and you just want to sequentially hammer out chapter and scene headings. Having to manage separate documents can become a bit cumbersome and needs a lot of clicks and drags if you want to re-order things.

I have a couple of suggestions, am happy to open separate issues in more detail for each of these if that would be helpful:

  • there are no right-click context menu options at all in the novel tree / outline view. One useful ones to consider (as in the project view) might be 'View Document', though that currently does not jump to the sub-section in the Preview pane (I understand that 'toggle active', 'set label', 'move to trash', etc, might not make as much sense there though)
  • drag and drop moving of sections, agnostically of which 'files' they live in, would be great, though again I understand that this could be tricky in the current filesystem architecture and requirements.
  • a hotkey for project and novel tree view (or switching between these) would be useful - right now it's a little cumbersome to switch between both. However, Alt-1 to 4 are already taken, so not sure what a good candidate would be. Alt+1 could be a toggle between project and novel, or Alt+5 could work for novel tree (but is not the best either).

Also, keep in mind that the novelWriter text editor becomes a bit sluggish on very large documents, so you may want to break it up in at least a few docs when you get into the 200k word area, if that's where you end up.

Thank you, will bear that in mind once I hit 200k / it gets sluggish. In any case, I think once a novel has progressed sufficiently, it makes sense splitting a long document into sub-documents / parts / chapters (and is easy to do with the split into documents function), but in the early stages of a draft it can be a bit cumbersome managing the document 'files' separately from the markdown headers, particularly if you are renaming and juggling them a lot or moving things between sections, etc.

@protostork
Copy link
Author

It already does that actually. It works the same way as double-clicking in the novel view. The only thing that needs to be added is that it shifts the editor into view.

Oh, fantastic, I hadn't noticed that! Yes, then just a shift of focus is all that is perhaps expected.

@vkbo
Copy link
Owner

vkbo commented Dec 12, 2022

Thanks! I think the new novel tree view is a huge improvement already, as it really helps with certain workflows, like when planning a plot and you just want to sequentially hammer out chapter and scene headings. Having to manage separate documents can become a bit cumbersome and needs a lot of clicks and drags if you want to re-order things.

It seems like we have a very similar workflow. This is also why I made it so you can split on specific header levels, so you can do it in multiple steps as the text grows. My workflow isn't exactly the snowflake method, but it is a personalised version of it.

I have a couple of suggestions, am happy to open separate issues in more detail for each of these if that would be helpful:

  • there are no right-click context menu options at all in the novel tree / outline view. One useful ones to consider (as in the project view) might be 'View Document', though that currently does not jump to the sub-section in the Preview pane (I understand that 'toggle active', 'set label', 'move to trash', etc, might not make as much sense there though)

Yeah, I can see the need for that. The middle mouse button click opens in the view panel in both the project tree and novel view, but that's only useful if you have an actual middle button on your mouse. It's no problem adding a context menu, but I would like to have more options to add to it before I do so. Perhaps I could add an alternate "middle click" feature with Ctrl + mouse click.

Feel free to add a feature request for a more universal way to open docs in the viewer from the novel view. That's definitely something I can look into.

  • drag and drop moving of sections, agnostically of which 'files' they live in, would be great, though again I understand that this could be tricky in the current filesystem architecture and requirements.

This has been requested before and I've decided against it primarily because it would involve rewriting the content of your text documents. As it is now, the app never modifies the text you've written. Even the split and merge tools do their thing on new documents, not the original.

I can absolutely see how it would be a useful feature, and I wouldn't mind having it myself. I have considered making it possible to do this internally in a document. However, allowing to drag'n'drop a heading that represents a whole document from the novel view would run into the problem of knowing where in the file structure to drop it. This structure isn't visible from the novel view, and the drop point could be ambiguous.

  • a hotkey for project and novel tree view (or switching between these) would be useful - right now it's a little cumbersome to switch between both. However, Alt-1 to 4 are already taken, so not sure what a good candidate would be. Alt+1 could be a toggle between project and novel, or Alt+5 could work for novel tree (but is not the best either).

I've thought about this too. Because the Alt+num ones are already sort of used up, I've considered adding a new key combo that isn't numeric so therefore not drifting out of order if I add more views. A double key combo could work. Something like:

  • Ctrl+M, P for Project Tree
  • Ctrl+M, N for Novel View
  • Ctrl+M, O for Outline View
  • Ctrl+M, E for Editor
  • Ctrl+M, V for Viewer

... and so on. Doesn't have to be Ctrl+M either. But there aren't many easy combos available. Feel free to add a feature request for a shortcut for the novel view, and I'll see if I can figure out a good solution.

@vkbo vkbo removed the not a bug Invalid: Feature, not a bug label Dec 13, 2022
@protostork
Copy link
Author

Thanks for your responses, those are all valid and reasonable points and concerns.

Feel free to add a feature request for a more universal way to open docs in the viewer from the novel view. That's definitely something I can look into.

Oh, I didn't know about the middle mouse-button, that's cool and works really well in the novel tree! In that case, a quick fix might be allowing the middle button and Ctrl+R shortcuts also in the Outline view, that would make the View Document option a bit more consistent between views.

A double key combo could work. Something like:
[...]

Yes, that could work, though I'm personally not a huge fan of double key combinations for shortcuts you might want to press repeatedly in rapid succession (such as quickly cycling between Project / Novel and/or Outline view, and back again, for instance).

Just brainstorming / potential inspiration, another option could be to 'combine' both Project and Novel tree view under Alt+1 (since they're substantially similar layouts), and make it possible to switch between both with a separate toggle, like ctrl+tab or ctrl+t or another unused combination (and have it remember the last view you were in, when you next press alt+1). However, for consistency, that might require a slight rework of the UI.

Another option more consistent with the current GUI could be (if backwards compatibility of keyboard shortcuts is not the highest priority), a slight refactor of the alt+number hotkeys to correspond directly to the icons in the left-hand bar, e.g. alt+1 = Project view, alt+2 = Novel View, 3 = Outline (and optionally, for consistency, though separate hotkeys already exist, alt+4 = Build, 5 = Details, 6 = Stats, 7 = Settings).

The focus 'go to document editor' / 'document viewer' hotkeys (currently at alt+2 / 3) could then simply be a ctrl+tab or other hotkey toggle to jump focus between side-pane and any open editor panes (since those two views are effectively linked / only visible once you're in the project or novel view anyway) / or ctrl+e seems semi-available (other than going to the end of a line in the editor, emacs style).

@vkbo
Copy link
Owner

vkbo commented Dec 13, 2022

Oh, I didn't know about the middle mouse-button, that's cool and works really well in the novel tree! In that case, a quick fix might be allowing the middle button and Ctrl+R shortcuts also in the Outline view, that would make the View Document option a bit more consistent between views.

Good idea. I'll fix that.

Another option more consistent with the current GUI could be (if backwards compatibility of keyboard shortcuts is not the highest priority), a slight refactor of the alt+number hotkeys to correspond directly to the icons in the left-hand bar, e.g. alt+1 = Project view, alt+2 = Novel View, 3 = Outline (and optionally, for consistency, though separate hotkeys already exist, alt+4 = Build, 5 = Details, 6 = Stats, 7 = Settings).

I don't like to disrupt people's habits. I've done it from time to time, but the Alt+Num keys are actually to switch focus, not view, so I could just leave them as they are and instead add new keys for views and focus. Ctrl+E has been freed up a while back, and could be used to jump to the editor. The Build Tool is already connected to F5, so I could use F4 to toggle between the project and novel views. F10 used to be associated with functionality on the outline view which has been removed, so I can add it as a key to activate the view. I plan to add more views, but F10 could cycle them.

See Keyboard Shortcuts for a reference of used shrotcuts.

@protostork
Copy link
Author

protostork commented Dec 14, 2022

I don't like to disrupt people's habits.

That sounds fair enough :)

I've done it from time to time, but the Alt+Num keys are actually to switch focus, not view, so I could just leave them as they are and instead add new keys for views and focus.

Thanks for explaining, that makes sense!

Ctrl+E has been freed up a while back, and could be used to jump to the editor. The Build Tool is already connected to F5, so I could use F4 to toggle between the project and novel views. F10 used to be associated with functionality on the outline view which has been removed, so I can add it as a key to activate the view. I plan to add more views, but F10 could cycle them.

Maybe Ctrl+T could also be a good candidate to toggle Project and Novel views: it seems to be available, could stand for Toggle or Tree (view toggle), and is maybe less confusing / technical than an F[number] key, most of which seem to currently be bound to Tools menu functions (other than the somewhat standardised F8 and F11 View mode hotkeys).

@vkbo
Copy link
Owner

vkbo commented Dec 14, 2022

Maybe Ctrl+T could also be a good candidate to toggle Project and Novel views: it seems to be available, could stand for Toggle or Tree (view toggle), and is maybe less confusing / technical than an F[number] key, most of which seem to currently be bound to Tools menu functions (other than the somewhat standardised F8 and F11 View mode hotkeys).

You're right. The F keys are mostly for tools, aside from the standard ones that are not (F1, F2, F3, F7, F8 and F11, oh wait, that's most of them 😆)

But sure, Ctrl+T makes sense too. At least as it's next to Ctrl+E for editor (soon) and Ctrl+R for viewer, so Ctrl+T for tree makes a lot of sense. At least in English, and on the QWERTY layout. Ctrl+W also closes the edtior, and Ctrl+Q closes the app.

@vkbo
Copy link
Owner

vkbo commented Jan 8, 2023

The issue has been fixed, and I referenced the other points in #1310. Feel free to add more info there. I'm closing this one now.

@vkbo vkbo closed this as completed Jan 8, 2023
@vkbo vkbo mentioned this issue Nov 10, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Issue: Could do with some improvement user interface Component: General user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants