Skip to content

ETT-1542: fix viewability table viewport a11y issue - #144

Merged
carylwyatt merged 3 commits into
mainfrom
ETT-1542
Sep 10, 2026
Merged

ETT-1542: fix viewability table viewport a11y issue#144
carylwyatt merged 3 commits into
mainfrom
ETT-1542

Conversation

@carylwyatt

@carylwyatt carylwyatt commented Sep 4, 2026

Copy link
Copy Markdown
Member

Most of this is reformatting the html, but I also removed unnecessary comments and whitespace.

While working on the css for this, I realized that the span that houses the enumchron data (<span class="IndItem">) was being rendered even if there isn't enumchron info for that volume, so I added a conditional to take care of that unnecessary markup that was also adding whitespace to the table.

Gayathri has approved the UI and a11y for this, so this PR is a second set of eyes of markup and php. This is staged on dev-3 if you want to look: https://dev-3.catalog.hathitrust.org/Record/000140237

@carylwyatt
carylwyatt requested a review from eumalin September 9, 2026 16:18
<a data-activated-role="true" href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url">
<i aria-hidden="true" class="fa-solid fa-unlock"></i>
<span class="text-decoration-underline">Limited (Access Permitted)</span>
{if (isset($ld.enumchron) and $ld.enumchron)}<span class="IndItem">{$ld.enumchron}</span>{/if}

@eumalin eumalin Sep 9, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This check treats the text "0" as if it were empty.

{if (isset($ld.enumchron) and $ld.enumchron)} will hide the value when $ld.enumchron is the string "0", because PHP and Smarty treat "0" as false in a boolean check. Before this PR, the value was always shown, even if it was "0".

If a volume or issue is ever labeled just "0", it will now disappear from the link instead of showing up.

Suggested fix: check for an empty string directly instead of relying on truthiness, for example:

{if isset($ld.enumchron) and $ld.enumchron !== ''}

This same check is repeated on other lines, so the fix should be made in all five places (or pulled out into one shared check before the if/elseif chain).

@carylwyatt carylwyatt Sep 10, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@eumalin Thanks for the feedback! I googled a bit and found this {capture} function in smarty that holds template pieces as variables, so I used that to compute the enumchron template piece one time if it exists for that record and then insert where needed.
Edit to add: re-staged on dev-3

@carylwyatt
carylwyatt requested a review from eumalin September 10, 2026 14:06

@eumalin eumalin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, thank you!

@carylwyatt
carylwyatt merged commit a997092 into main Sep 10, 2026
2 checks passed
@carylwyatt
carylwyatt deleted the ETT-1542 branch September 10, 2026 17:22
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.

2 participants