pjeby / pane-relief

Obsidian plugin for per-pane history, pane movement/navigation hotkeys, and more
223 stars 6 forks source link

Visual list of each pane's history #3

Closed classicrob closed 2 years ago

classicrob commented 3 years ago

It is amazing to be able to navigate each pane's history, but sometimes I just want to see where I've been. This would reduce a lot of mental friction to switching files for me.

I'm imagining hovering over the title of a note and seeing a list of pages that were open in that pane, ordered top to bottom with most recent to oldest. However, there might be a better spot for it.

pjeby commented 3 years ago

Well, the title bar has forward and back arrows, and right-clicking them to show the possible forward/back targets would match the behavior of a browser, so perhaps that'd be a good way to do it. Maybe style them according to whether there is a forward or back available, so there's a hint that you can do that.

(Of course, that wouldn't work for views in the sidebars.)

classicrob commented 3 years ago

I think that would work! Would that work on an individual pane basis? I only see one forward-back arrow... or is the idea that it would change dynamically in response to which pane you're in?

pjeby commented 3 years ago

Dynamically, just like in the browser. I'm thinking of maybe adding numbers to show how many things are in that direction, and maybe also adding a pair of arrows to the status bar, where they and the numbers would be more visible. Maybe a command to pop the menus, maybe have the menus support preview hover, too.

(Not sure when I'll get around to any of this, though.)

Ampa commented 3 years ago

I like this new functionality, but find the location of the forward / backward arrows to be very tucked away and distant from my focus on the note.

Would it be possible to have arrows per pane? In the title bar (filename bar)?

Or if you don't want to clutter the UI with additional icons, how about right click on the file icon shows the history drop-down as a single list (forward and back in one) with the current position highlighted.

Pane Relief

pjeby commented 3 years ago

I do intend to add keyboard nav to the menus, and once I have that, it'd be more feasible to select an item in the middle of a menu like that. (Keyboard nav meaning "open nav menus from keyboard" and "move/select within a menu using the keyboard").

I'm not sure about using a context menu on the pane icon, but it's not awful. It's certainly not a bad place to pop it up in response to a keyboard command, though.

ronrdev commented 2 years ago

The customizable-page-header-buttons plugin allows addition of forward/back buttons on the page/pane title bar. The individual panes have their own history from the pane-relief plugin, and the pane-relief hotkeys work.

But the right click functionality of the pain-relief plugin does not exist on the buttons added to the page header with customizable-page-header-buttons plugin. I made an enhancement request to see if this is feasible. If full compatibility is added, this could be a solution to the per pane request.

https://github.com/kometenstaub/customizable-page-header-buttons

pjeby commented 2 years ago

0.0.24 now supports right-clicking the history buttons added by that plugin. It also defines CSS variables to allow you to add the numbers to those buttons if you wish, using CSS like:

.view-action[class*="app:go-forward"]::after {
    content: var(--pane-relief-forward-count, "");
}
.view-action[class*="app:go-back"]::before {
    content: var(--pane-relief-backward-count, "");
}

(In practice, that CSS produces very ugly numbers and so you would probably want to adjust font, size, and margin or text position.)

ronrdev commented 2 years ago

Thank you for adding this. It's works great for me. Adding a bug report for your reference. Not another enhancement request.

Not working as expected: Must have the cursor in the pane if you want to use left click. Left click targets the active pane. So example if you have three panes open, all the forward buttons will change the active pane.

pjeby commented 2 years ago

Yes, that's a limitation of the way the other plugin works, as the buttons are triggering the keyboard commands for navigating forward and back, which apply to the currently-active pane.

ronrdev commented 2 years ago

Okay I'll add a comment over there as a reference also. Thanks again.

kometenstaub commented 2 years ago

Yes, that's a limitation of the way the other plugin works, as the buttons are triggering the keyboard commands for navigating forward and back, which apply to the currently-active pane.

I've added a timeout to the forward and back buttons, so that the click activates the pane and executes the command shortly after that.

pjeby commented 2 years ago

Also note that if your mouse has forward/back buttons of its own, you can just click with them anywhere in the pane and the correct navigation will happen.

pjeby commented 2 years ago

As of the current release of Pane Relief, it now has first-class support for the Customizable Page Headers plugin, so if you want per-pane navigation lists, you need to:

  1. Install and enable the plugin
  2. In its settings, enable "Show buttons on desktop" and "Pane Relief count"
  3. Add "navigate back" and "navigate forward" page header buttons
  4. Upgrade Pane Relief to the latest version

You will then have history buttons on each pane that work just like the window-level counterparts.