Skip to content

Commit 6262273

Browse files
Update ADR based on bespoke navigation outcome
With the realization that we would not be able to complete the bespoke navigation option in the time available, I have re-written the ADR to explain our decision-making.
1 parent d229e49 commit 6262273

File tree

1 file changed

+50
-41
lines changed

1 file changed

+50
-41
lines changed

docs/architecture-decisions/0005-implement-an-accessible-navigation-system.md

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 5. Implement an accessible navigation system
1+
# 5. Using SmartMenus 1 for navigation menus
22

33
Date: 2024-03-22
44

@@ -8,12 +8,16 @@ Accepted
88

99
## Context
1010

11-
Our initial releases of this theme used the [SmartMenus](https://www.smartmenus.org/) library to build its
11+
Our initial releases of this theme use the [SmartMenus](https://www.smartmenus.org/) library to build its
1212
navigation menus. While this library is easy to implement and pretty useful, its
1313
output was flagged during usability and accessibility testing as needing some
1414
improvements.
1515

16-
The markup which the user finally interacts with looks like this:
16+
The problem is that, for users relying on a keyboard or a screen reader to
17+
navigate the platform, attempting to close a submenu in the navigation also
18+
causes the user follow the link to the submenu's parent page.
19+
20+
The markup which the user interacts with looks like this:
1721

1822
```html
1923
<nav aria-label="Under the Lens: Women Biologists and Chemists at MIT (1865-2024)">
@@ -36,22 +40,32 @@ The markup which the user finally interacts with looks like this:
3640
```
3741

3842
The issue is that the element triggering the flyout menu (the
39-
`<span class="sub-arrow"></span>` tag) is _inside_ the anchor element, making it
40-
challenging (if not impossible) for users of assistive technologies to separate
41-
their interactions with the menu link and the submenu toggle.
43+
`<span class="sub-arrow"></span>` tag on line six above) is _inside_ the anchor
44+
element, making it challenging for users relying on screen readers or keyboard
45+
navigation to get around an exhibit. While it is possible to open all of the
46+
submenus like this, attempting to close a submenu gets intercepted by the
47+
containing anchor element, resulting in an unintentional navigation to that
48+
page.
49+
50+
Omeka provides other ways to get around an exhibit - for example the Next and
51+
Previous buttons on all pages, and individual pages can also provide blocks of
52+
links to their child pages. As a result, we believe that Omeka is still usable
53+
by users who rely on these technologies - but this is a bug which should be
54+
prioritized for resolution.
4255

4356
The current release of SmartMenus (1.2.1) does not support placing this toggle
4457
element outside of the link element, so it will be necessary to replace it with
45-
a library which does support this behavior.
58+
a library which does support this behavior. We have evaluated several options
59+
for resolving this issue:
4660

4761

4862
### Option 1: SmartMenus 2
4963

5064
The maintainer for SmartMenus is aware of this problem in the library, as we and
5165
others have reported it via GitHub (see [issue 204](https://github.com/vadikom/smartmenus/issues/204) and [issue 231](https://github.com/vadikom/smartmenus/issues/231)). He has
5266
committed to including this as an improvement in the future release of
53-
SmartMenus 2, and the documentation already available [includes this among its available
54-
features](https://configurator.smartmenus.org/).
67+
SmartMenus 2, and the documentation already available [includes this among its
68+
available features](https://configurator.smartmenus.org/).
5569

5670
However, at the time of writing [SmartMenus 2 is only available via one alpha
5771
release](https://github.com/vadikom/smartmenus/releases) - and the maintainer has [cautioned us against using it in a production
@@ -168,47 +182,42 @@ The styling rules required for this approach should likewise be minimal.
168182

169183
#### Drawbacks of a bespoke approach
170184

171-
The maxim "if you aren't using a framework, you are building one" applies here.
172-
While the amount of code required is small, it is still code for which we are
173-
responsible. That code will require us to commit to maintaining the knowledge of
174-
how it works and how to troubleshoot it, and to commit to having the bandwidth
175-
to respond to problems as they are reported.
176-
177-
This bespoke approach is also not just javascript, but all the associated
178-
styling rules for the menu to be rendered in both a vertical and horizontal
179-
layout.
185+
While conceptually simple, the bespoke approach proved to be beyond our
186+
current bandwidth by the time all the use cases were resolved.
180187

181-
In addition, because this code is so small, it has likely been written by some
182-
other group of developers - and it would be preferable to leverage their work
183-
rather than repeat it.
188+
We attempted to develop a bespoke navigation library for this theme, starting
189+
from the code which Rich shared. The result of those efforts can be found on
190+
the [post-107-bespoke](https://github.com/MITLibraries/mitlibraries-theme-omeka/tree/post-107-bespoke) branch of this repository.
184191

185-
Ultimately, though, the review which we've conducted of existing menu libraries
186-
has not identified such a suitable existing library at this time.
192+
Follow-up testing showed that the solution was more suitable for users who rely
193+
on assistive technologies, but the interaction needs for sighted and desktop
194+
users were not adequately met in the available timeframe.
187195

188196

189-
## Decision: Option 4
197+
## Decision: Keep using SmartMenus 1, at least for now
190198

191-
We will implement option 4 - a bespoke solution. We will develop, and maintain,
192-
a small set of javascript and stylesheet rules for the navigation menu in this
193-
theme.
199+
With the failure of option 4 to coalesce into a generally suitable solution in
200+
the time available, we are choosing to continue using SmartMenus 1, at least in
201+
the short term.
194202

195-
If this proves sustainable, the feature will be considered for promotion to the
196-
overall style library in order to make the feature available to our other
197-
web applications.
203+
We will continue to watch for future releases of SmartMenus which may resolve
204+
this problem. This work has also identified the need for a general navigation
205+
solution within [our style library](https://mitlibraries.github.io/mitlib-style/), which could provide an opportunity for us to
206+
return to this problem space and devote additional time to finishing the bespoke
207+
approach.
198208

199-
Our ultimate preference for an externally-defined navigation library will mean
200-
that we continue to monitor the development of both SmartMenus and Accessible
201-
Menu, with an eye toward adopting one should a suitable version be released.
209+
The remaining items that need to be resolved have been noted in that branch, in
210+
the form of a [punch list](https://github.com/MITLibraries/mitlibraries-theme-omeka/blob/post-107-bespoke/docs/navigation-notes.md) that was maintained during the initial development.
202211

203212

204213
## Consequences
205214

206-
We will work from the prototypes and examples which Rich has provided and write
207-
our own bespoke solution for navigation menus in Omeka. This solution will:
215+
The usability of our digital exhibits platform is less straightforward than we
216+
want it to be.
217+
218+
The theme applied to this platform remains somewhat simpler without a bespoke
219+
navigation system that would need ongoing maintenance.
208220

209-
1. Make use of appropriate HTML tags as much as possible, with toggles for
210-
triggering submenus separate from the navigation links - at any depth.
211-
1. Implement minimal javascript.
212-
1. Include styling rules for both a horizontal and vertical implementation,
213-
while the markup and javascript for each will be the same.
214-
1. Be evaluated for promotion to our style guide.
221+
Our organization as a whole continues to not have a navigation menu as part of
222+
its style library. As a result, our various platforms with navigation menus all
223+
implement their own approaches to a shared problem.

0 commit comments

Comments
 (0)