From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Corey Huinker <corey.huinker@gmail.com>
To: pgsql-docs@lists.postgresql.org
Subject: Re: Adding visual clues that accesskey exists
Date: Wed, 18 Jan 2023 12:09:24 +0100
Message-ID: <19d3d58f-c77e-4635-3097-875700fa3d4b@enterprisedb.com> (raw)
In-Reply-To: <CADkLM=dMg4cad1JJKny5ErRAuMXZcECYNznO6yFP2tJhwutdmA@mail.gmail.com>
References: <CADkLM=dMg4cad1JJKny5ErRAuMXZcECYNznO6yFP2tJhwutdmA@mail.gmail.com>
On 13.01.23 23:07, Corey Huinker wrote:
> 1. Add static hints to each link, so "Next" becomes "Next [n]". Fairly
> simple, but visually clumsy, and it might not actually clue the user
> that they need to hit ALT+n, not just "n". This chrome extension is an
> example of how it might look
> https://chrome.google.com/webstore/detail/display-access-keys/gpicedcgegaokienkdbbcagodgacpbpd?hl=en <https://chrome.google.com/webstore/detail/display-access-keys/gpicedcgegaokienkdbbcagodgacpbpd?hl=en; . The extension itself seems stale if not completely abandoned, but the screenshot gives a good visual representation.
>
> 2. Add the hint to the hovertext of the link. So, for example on
> https://www.postgresql.org/docs/current/libpq-exec.html
> <https://www.postgresql.org/docs/current/libpq-exec.html; the Hovertext
> for the "Next" link would become: "34.4 Asynchronous Command Processing
> [ALT+n]". This would lead to more accidental discovery, but wouldn't
> alter the existing static page appearance.
>
> 3. Add hotkey that launches an overlay which displays all available
> keyboard shortcuts. A common example of this is typing '?' in gmail or
> any other google web app.
>
> 4. Actually implement arrow keys with javascript, but leave the
> accesskeys as-is. I'm not a front-end programmer of any great skill, but
> it should be easy to capture the keydown event, filter for
> ArrowUp/ArrowLeft/ArrowRight, and then either search the DOM for the
> anchor with the corresponding accesskey, or rely on element ids
> (example: "nav-left", "nav-up", "nav-right") to find the anchor and
> invoke a .click() on it. Currently the navigation anchors do not have
> IDs, but adding them for this purpose might close us off from a future use.
I agree that hot key discoverability could be better, but I don't think
this is an issue in the PostgreSQL documentation; it's something the
browser should handle. The job of the HTML markup is to declare the key
-- then it's up to the browser how to present it. Otherwise, every
single web page in the world (well, those with hot keys) would have to
repeat this analysis, which seems on the wrong level to me.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: peter.eisentraut@enterprisedb.com, corey.huinker@gmail.com, pgsql-docs@lists.postgresql.org
Subject: Re: Adding visual clues that accesskey exists
In-Reply-To: <19d3d58f-c77e-4635-3097-875700fa3d4b@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox