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

Automatically scroll to the first heading when editing a page #222

Closed
lahwaacz opened this issue Sep 20, 2015 · 5 comments
Closed

Automatically scroll to the first heading when editing a page #222

lahwaacz opened this issue Sep 20, 2015 · 5 comments

Comments

@lahwaacz
Copy link
Contributor

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:

  1. modifying all links on all pages appropriately to include the anchor,
  2. 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.)

@kynikos kynikos added this to the 2.1.0 milestone Sep 21, 2015
kynikos added a commit that referenced this issue Sep 21, 2015
@kynikos
Copy link
Owner

kynikos commented Sep 21, 2015

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.

@kynikos kynikos closed this as completed Sep 21, 2015
@lahwaacz
Copy link
Contributor Author

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.

@kynikos
Copy link
Owner

kynikos commented Sep 21, 2015

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?

@lahwaacz
Copy link
Contributor Author

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.

@kynikos
Copy link
Owner

kynikos commented Sep 21, 2015

Yep, thanks for the update :)

@kynikos kynikos modified the milestones: 2.1.0, 2.0.5 Jan 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants