Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2993] Use custom page title for zaak detail page #1586

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

pi-sigma
Copy link
Contributor

@pi-sigma pi-sigma commented Jan 29, 2025

@pi-sigma pi-sigma changed the title [#2397] Use custom page title for zaak detail page [#2993] Use custom page title for zaak detail page Jan 29, 2025
@pi-sigma pi-sigma force-pushed the task/2993-zaak-detail-page-title branch from 133a192 to 416cc73 Compare January 29, 2025 14:13
@pi-sigma pi-sigma marked this pull request as ready for review January 29, 2025 14:35
@pi-sigma pi-sigma requested a review from swrichards January 29, 2025 14:35
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.22%. Comparing base (a5e4938) to head (416cc73).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1586   +/-   ##
========================================
  Coverage    94.22%   94.22%           
========================================
  Files         1075     1075           
  Lines        39657    39658    +1     
========================================
+ Hits         37366    37368    +2     
+ Misses        2291     2290    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi-sigma pi-sigma requested a review from jiromaykin January 29, 2025 14:36
Comment on lines +3 to +5
{% block title %}
<title>{% if page_title %}{{ page_title }}{% else %}{% trans "Aanvraag" %}{% endif %}</title>
{% endblock title %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I just wonder whether there's issues of having this in the inner template, for two reasons:

  1. The <title> tag will only appear in the DOM tree after the HTMX has finished loading (which can be a few seconds). I am not sure this change will be properly picked up by screenreaders and announced, but perhaps @jiromaykin knows more here.
  2. I think <title> has to be a child of <head>, having it nested under <body> is probably not valid spec-compliant (not sure that's a show stopper, but again, it might have a11y knock-on effects).

I don't really have a better option, either then setting the title via some kind of HTMX post-load handler (doing it in the main template would defeat the purpose of the async load). Happy to merge this and address it later if it turns out to be a problem.

Copy link
Contributor

@jiromaykin jiromaykin left a comment

Choose a reason for hiding this comment

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

@pi-sigma You are misunderstanding/mixing-up a couple of things:

  1. Story nr.2397 is about the META title tags and how multiple pages are missing a proper <title> there, so they can be differentiated in the browse History, for example: all of the Flat pages.
    So yeah: that is a TITLE META tag that indeed needs to be part of the HEAD tag, and you will have to resarch first, which pages have Titles missing, And a <title> tag will neverbe functional inside the Body tag.
    Also: the unique title needs to come first, then a hyphen after which the Sitename can appear.
    So this is a bigger/different issue.
  2. We are only using HTMX to swap and load partial components in this project, so the DOM and it's META tags are already loaded first, so no worries for screenreaders there.
  3. The cases status page already has a 'unique' meta title ("status") so you can either delete the stuff you made in this PR or add the status-name to the actual meta tag (not the content of the Body...).
  4. Is this the only PR you are making for this issue? If so: this does not tackle that issue at all.
  5. Oh dear, we do need to make a separate issue for the Heading-level-1 titles that do not load immediately on pageload. Which indeed is bad for accessibility, but that's completely separet from this one. So I made a new one here you do not need to worry about right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants