Automatically scroll to the first heading when editing a page
lahwaacz opened this issue · 5 comments
While working on my laptop, I find the layout of the editing page on the wiki to go in my way: the header above the editing window takes almost one quarter of the screen height and the editing window is either too small or the save and preview buttons are needlessly shifted down out of the screen, so that I need to scroll down before submitting. When I'm on the editing page, the header at the top is usually useless, so it would be much better if the editing page opened scrolled down to the first heading, "Editing Some page title". This could be achieved quite simply by adding the magic #firstHeading
anchor to all links leading to an edit page (URL containing action=edit
). I think there are two options:
- modifying all links on all pages appropriately to include the anchor,
- adding the anchor after the edit page is loaded using the same trick as MediaWiki to rewrite the URLs of redirect pages.
I have no idea which one is easier to implement, I'd only guess that the first option would allow a bit faster scrolling to the desired position. Could you look at this when the time allows?
(With my configuration, the preview is always rendered below the edit box, the optimal behaviour might be different with different settings.)
This was an easy fix, so I've already pushed it to develop
, you should see a scroll_to_first_heading
option under Mods > Editor
, just set it to true
because I'm leaving it false
by default.
However about the Save page buttons, I suggest you to learn the native shortcuts: the documentation is a bit lacking, honestly I learned them simply by hovering the mouse pointer over the various elements, and the shortcuts appear in the tooltip, e.g. focusing the summary is Shift+Alt+b
, saving is Shift+Alt+s
:) Apparently we are setting them as normal messages, but the docs aren't very consistent after a quick look.
Great, thanks for the fix!
About the native shortcuts, the problem is the modifier key: Alt
is my modifier in i3 and many Shift+Alt
shortcuts are already taken for certain type of actions. Getting used to the free ones is against the spirit of how I group different actions to different modifiers, so unless the modifier is configurable, native shortcuts are not an option. But the idea is great, I'll see if Pentadactyl is more flexible: so far I need the buttons to be visible on the screen to be caught by the hint mode.
Uh I see, the perfect solution would be #177, but currently I'm putting all my efforts on my day-extension machine, according to my calculations I should be already at +23 hours, but the problem is that after midnight the test monkey disappears and I can't communicate with it anymore... (and I'm running out of monkeys to make it worse) :(
By the way, did they fix the Enter event thing in Pentadactyl?
I don't think so, I haven't even reported it yet, because the workaround just works. On the other hand, I've been experiencing some issues also with other keys (e.g. backspace in search mode), so I will definitely include everything in a report when I get to proper investigation.
Yep, thanks for the update :)