Skip to content

Update page titles#411

Open
jazairi wants to merge 1 commit into
mainfrom
use-621
Open

Update page titles#411
jazairi wants to merge 1 commit into
mainfrom
use-621

Conversation

@jazairi

@jazairi jazairi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Why these changes are being introduced:

UXWS has requested a few related changes to
normalize page titles. See ticket for details.

Relevant ticket(s):

How this addresses that need:

This makes the requested changes.

Side effects of this change:

  • Removed use of ternary in index_page_title for readability
  • Removed redundant title method
  • Updated record page titles (though technically not in scope of USE, it made sense to fix them as
    part of this change)

Developer

Accessibility
  • ANDI or WAVE has been run in accordance to our guide.
  • This PR contains no changes to the view layer.
  • New issues flagged by ANDI or WAVE have been resolved.
  • New issues flagged by ANDI or WAVE have been ticketed (link in the Pull Request details above).
  • No new accessibility issues have been flagged.
New ENV
  • All new ENV is documented in README.
  • All new ENV has been added to Heroku Pipeline, Staging and Prod. (n.b.: not new env, but apps have been updated with new PLATFORM_NAME values)
  • ENV has not changed.
Approval beyond code review
  • UXWS/stakeholder approval has been confirmed.
  • UXWS/stakeholder review will be completed retroactively.
  • UXWS/stakeholder review is not needed.
Additional context needed to review

E.g., if the PR includes updated dependencies and/or data
migration, or how to confirm the feature is working.

Code Reviewer

Code
  • I have confirmed that the code works as intended.
  • Any CodeClimate issues have been fixed or confirmed as
    added technical debt.
Documentation
  • The commit message is clear and follows our guidelines
    (not just this pull request message).
  • The documentation has been updated or is unnecessary.
  • New dependencies are appropriate or there were no changes.
Testing
  • There are appropriate tests covering any new functionality.
  • No additional test coverage is required.

Why these changes are being introduced:

UXWS has requested a few related changes to
normalize page titles. See ticket for details.

Relevant ticket(s):

- [USE-621](https://mitlibraries.atlassian.net/browse/USE-621)

How this addresses that need:

This makes the requested changes.

Side effects of this change:

- Removed use of ternary in `index_page_title` for
readability
- Removed redundant title method
- Updated record page titles (though technically
not in scope of USE, it made sense to fix them as
part of this change)
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27988369575

Coverage decreased (-0.003%) to 98.35%

Details

  • Coverage decreased (-0.003%) from the base build.
  • Patch coverage: 4 of 4 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1515
Covered Lines: 1490
Line Coverage: 98.35%
Coverage Strength: 71.38 hits per line

💛 - Coveralls

Copilot AI 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.

Pull request overview

This PR normalizes HTML <title> strings across the index, results, record, and “About Natural Language Search” pages by making titles consistently incorporate the platform/index title.

Changes:

  • Update index_page_title default and simplify title composition by reusing index_page_title for results/record pages.
  • Ensure results_page_title ignores the new queryMode param and update helper tests for the new title formats.
  • Update the “About Natural Language Search” static page to include the normalized title format.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
app/helpers/application_helper.rb Adjusts index/results/record title helpers and updates ignored params list (adds queryMode).
app/views/static/about_natural_language_search.html.erb Updates static page to set a normalized composite <title>.
test/helpers/application_helper_test.rb Updates expectations for new title formats and adds coverage for the About NLS title format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to 24
ignored_terms = %i[page advanced geobox geodistance booleanType tab queryMode]
terms = query.reject { |term| ignored_terms.include? term }.values.join(' ')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seems to be correct in theory, but it's incorrect in practice. The terms are filtered out as expected, including the newly added queryMode.

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