tl-its-umich-edu / my-learning-analytics

My Learning Analytics (MyLA)
Apache License 2.0
35 stars 39 forks source link

Update document title based on view/route #957

Closed ssciolla closed 4 years ago

ssciolla commented 4 years ago

Thank you for contributing to this project!

Describe your problem or feature you'd like added

On the ReactJS accessibility page they mentioned the DocumentTitle and React Helmet package that sound like they do updates directly to the header. Did you try either of these?

...

Before single page apps, the user noticed that they changed pages by the title changes. I feel like updating the title would have benefit both to visual users as well as screen reader users as this is what's displayed in the tab.

Apps like Gmail are a SPA and the title updates when you folders something from

Inbox - jonespm@gmail.com - Gmail Starred - jonespm@gmail.com - Gmail or more specifically

<Folder Name> <email> - Gmail

It seems like our style should be of the format <Page Name> - <username> - My Learning Analytics

Sorry for being a day late to the comments here. It's also possible the username is not needed.

Originally posted by @jonespm in https://github.com/tl-its-umich-edu/my-learning-analytics/pull/949

Describe the solution you'd like

We should investigate and decide on one of the libraries mentioned by @jonespm, or another alternative. I think the format proposed above makes sense, probably without the username. Note that this was one of the solutions suggested to resolve an issue raised by the October 2019 accessibility review, captured by issue #801.

chrisrrowland commented 4 years ago

I have a solution for this using react-helmet, but this is only effective for standalone MyLA. In LTI mode the title remains the name of the LTI tool. This seems like it achieves the literal goal as stated by the issue, but I'm not sure that it achieves the spirit, as I'm not sure how it would be evaluated with regards to improving accessibility in LTI mode. When I browse with a screen reader it doesn't read any title at all in LTI mode.

jonespm commented 4 years ago

Yeah, I don't think there's any way to fix this anymore with it running in an iframe in Canvas now over LTI.

ssciolla commented 4 years ago

Yeah, I hadn't thought about how this issue is changed in an LTI setting. Not sure we'd have much impact if we did implement the fix but it doesn't do anything with LTI. Hm...

jonespm commented 4 years ago

I think we might be doing the best we can now by having the title of the page appear in the <h1> tag, which it already was.

It looks like the "Title" attribute that Canvas passes on the