Page MenuHomePhabricator

Preserve tab selection after submit in [[Special:Preferences]]
Closed, ResolvedPublic

Description

Bug 16013 (fixed in r81573) enabled to link the tabs (sections) in [[Special:Preferences]].

When I press Save the next page is http://en.wikipedia.org/w/index.php?title=Special:Preferences&success on the first tab.

It would be nice to continue on the same tab. When I am on the [[Special:Preferences#preftab-9]] the next page should be http://en.wikipedia.org/w/index.php?title=Special:Preferences&success#preftab-9


Version: unspecified
Severity: enhancement

Details

Reference
bz27559

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:24 PM
bzimport set Reference to bz27559.

The <form> element's action attribute could be given the hash value via JavaScript when submitting it,

ie.
<form action="http://en.wikipedia.org/wiki/Special:Preferences" method="post"

would become:
<form action="http://en.wikipedia.org/wiki/Special:Preferences#preftab-9" method="post"

However it is impossible to read the hash value from PHP, thus when PHP directs the client to &success or something it won't preserve the hash tag.

Marking as LATER, perhaps one day PHP will be able to do this.

Reopening this one.

Although PHP can't read it from the address, it could be submitted as a paramter:

would become:
<form action="http://en.wikipedia.org/wiki/Special:Preferences?hash=preftab-9" method="post"

Then php can take that and convert it internally (back) to #hash.

JavaScript would hook into submit-event and append:

<input type="hidden" name="hash" value=" (attribute escape!) window.location.hash "/>

and in PHP, where it redirects the client append (if not empty) '#' . $params['hash'].

A small note though:
One can change settings of multiple panels of the preferences (ie. changing something under Editing, then General, then Gadgets) and click save on Gadgets will save them all.

(In reply to comment #2)

A small note though:
One can change settings of multiple panels of the preferences (ie. changing
something under Editing, then General, then Gadgets) and click save on Gadgets
will save them all.

That too is usability issue, although a different one from this bug.

Maybe it's possible to save the settings via Ajax and do not change the location.

  • Bug 28907 has been marked as a duplicate of this bug. ***

Updated summary to clarify what it's about.

Created attachment 9618
PoC patch of this functionality

So something like this.

TODO: escape request value -> queryparam value.

Still looks a bit clumsy...
don't really see another way though, with the redirect stripping fragments on most browsers.

Attached:

Since I0d6c654a7354ba77e65e338423952a6a78c1150f it should be possible to change the preferences via API and it should be possible to save the settings without leaving the page.

p.selitskas wrote:

I submitted a patch into gerrit: I7b7f14a6, although it works via sessionStorage (working with cookies made me cry with blood this night).

(In reply to comment #8)

Since I0d6c654a7354ba77e65e338423952a6a78c1150f it should be possible to
change
the preferences via API and it should be possible to save the settings
without
leaving the page.

Perhaps, saving via API should be implemented in Special:Preferences (and without a Save button!).

Merged by Nikerabbit.
HTML5-only: support for old browsers is WONTFIX'ed I guess (after all they've lived with it for so many years).