hypothesis / lms

LTI app for integrating with learning management systems
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

Make sure dashboard page titles update when navigating #6469

Closed acelaya closed 1 month ago

acelaya commented 1 month ago

Closes #6458

Add a new useDocumentTitle hook that sets document.title, and use it in all dashboard page/section components to ensure the page title is in sync with what's being displayed.

To make sure we don't forget calling it in future page components, this PR also adds a dev-env-only navigation listener which sets a placeholder page title right before navigation occurs.

Testing steps

  1. Open the dashboard.
  2. Navigate to other sections and observe the page title gets updated.

Titles should be the same that the backend sets on initial server-side renders, but we could potentially get rid of the backend logic entirely.