Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Announce to screen reader when markers are added to the map#12707

Merged

Conversation

ahukkanen
Copy link
Contributor

@ahukkanenahukkanen commentedApr 18, 2024
edited
Loading

🎩 What? Why?

It was suggested in an accessibility audit to announce to the screen reader when markers are added to the map.

This adds a new utility that allows announcing messages to screen reader dynamically and applies this utility to the proposal edit form map.

After seeing the CI failures, this PR also implements a basic test environment "map server" running as a rack middleware in order to avoid modifying the application routes for every map spec. The map tiles were not configured correctly for the test environment which caused JS errors to be shown on pages that display maps. After configuring the tile URLs for all specs, I started to see several different errors in the system specs that display maps. Therefore, I decided to create a new middleware that handles all the map related functionality in the test env. This particular PR requires the map to be shown on the page which requires the tile URLs to be configured correctly. If the URL isnull as so far, Leaflet will show errors and the map display will fail which causes the spec added in this PR to work incorrectly (as the message never appears in the view, cannot be tested otherwise).

At the same time I noticed there were also errors printed out in the console on pages that display static maps. This was because Webmock disabled these requests and therefore they errored out with HTTP 500.

Testing

  • Enable geocoding for the proposals component
  • Make sure you have maps configured
  • Go to create a new proposal and proceed to the complete step with the address field
  • Enable screen reader
  • Write an address that gives you results in the address field
  • Pick one of the provided addresses (note that there is another a11y issue with the autocomplete which does not allow navigating through the results using keyboard)
  • Hear the screen reader announce "Marker added to the map."

@ahukkanenahukkanen added module: proposals module: core type: fixPRs that implement a fix for a bug labelsApr 18, 2024
github-actions[bot]
github-actionsbot previously approved these changesApr 18, 2024
@ahukkanenahukkanen added the no-backportPull Requests that should not be backported labelApr 18, 2024
In order to avoid route definition errors, this commit implementsa basic map server as a rack middleware that serves all the maprelated routes in a secific local map domain.
github-actions[bot]
github-actionsbot previously approved these changesApr 18, 2024
github-actions[bot]
github-actionsbot previously approved these changesApr 18, 2024
Copy link
Member

@andreslucenaandreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I've just checked it out in BrowserStack with NVDA and it works as expected

@andreslucena
Copy link
Member

After seeing the CI failures, this PR also implements a basic test environment "map server" running as a rack middleware in order to avoid modifying the application routes for every map spec.

One quick check regarding this fix, are you referring to these kind of warnings from " [CI] Meetings - System tests", right?

 2024-04-23 06:30:09 +0000 WARNING: http://1.lvh.me:5486/packs-test/js/decidim_core.js 26:30557 "jQuery.Deferred exception: Cannot read properties of null (reading 'replace')" "TypeError: Cannot read properties of null (reading 'replace')\n    at rt (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:1399)\n    at i.getTileUrl (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:111653)\n    at i.createTile (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:111403)\n    at i._addTile (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:109326)\n    at i._update (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:107928)\n    at i._setView (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:105659)\n    at i._resetView (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:104991)\n    at i.onAdd (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:100687)\n    at i._layerAdd (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:63603)\n    at i.fire (http://1.lvh.me:5486/packs-test/js/decidim_map_provider_default.js:4:5017)" undefined

@andreslucenaandreslucena self-assigned thisApr 23, 2024
@ahukkanen
Copy link
ContributorAuthor

One quick check regarding this fix, are you referring to these kind of warnings from " [CI] Meetings - System tests", right?

Yes, I believe so.

Testing with the development app using the following configuration atconfig/initializers/decidim.rb:

# ...config.maps={provider::osm}# ...

I see the following in the browser's developer console when loading a page with map (e.g./meetings), and the map is not loaded properly:

Error in developer console

When changing the initializer configuration to the following, the error disappears and the map loads correctly (please note the tile usage policy if using this config):

# ...config.maps={provider::osm,dynamic:{tile_layer:{url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png"}}}config.content_security_policies_extra={"img-src"=>%w(https://tile.openstreetmap.org)}# ...
andreslucena reacted with thumbs up emoji

@andreslucena
Copy link
Member

Great, thanks for the outstanding explanation and the PR!

@andreslucenaandreslucena merged commit30ec206 intodecidim:developApr 24, 2024
104 checks passed
@ahukkanenahukkanen deleted the fix/a11y-announce-map-markers branchApril 24, 2024 06:21
andreslucena pushed a commit that referenced this pull requestMay 9, 2024
* Announce to screen reader when markers are added to the map* Fix spelling* Fix linting issue* Do not announce empty message* Implement more robust testing map serverIn order to avoid route definition errors, this commit implementsa basic map server as a rack middleware that serves all the maprelated routes in a secific local map domain.* Fix error in the comment of the middleware* Fix spelling mistakes* Fix broken specs due to test env configuration change
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@andreslucenaandreslucenaandreslucena approved these changes

@github-actionsgithub-actions[bot]github-actions[bot] approved these changes

Assignees

@andreslucenaandreslucena

Labels
module: coremodule: proposalsno-backportPull Requests that should not be backportedtype: fixPRs that implement a fix for a bug
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ahukkanen@andreslucena

[8]ページ先頭

©2009-2025 Movatter.jp