Skip to content

Adds additional tabs for timdex sources#383

Open
JPrevost wants to merge 6 commits intomainfrom
use-517-more-tabs
Open

Adds additional tabs for timdex sources#383
JPrevost wants to merge 6 commits intomainfrom
use-517-more-tabs

Conversation

@JPrevost
Copy link
Copy Markdown
Member

Why are these changes being introduced:

  • All sources should exist in at least one tab

Relevant ticket(s):

How does this address that need:

  • Adds additional tabs for timdex sources
  • Adds additional blurbs for the new tabs

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.
  • 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.

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 22, 2026

Coverage Report for CI Build 24889604264

Coverage decreased (-0.003%) to 98.352%

Details

  • Coverage decreased (-0.003%) from the base build.
  • Patch coverage: 8 of 8 lines across 4 files 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: 1396
Covered Lines: 1373
Line Coverage: 98.35%
Coverage Strength: 69.2 hits per line

💛 - Coveralls

@qltysh
Copy link
Copy Markdown

qltysh Bot commented Apr 22, 2026

❌ 4 blocking issues (4 total)

Tool Category Rule Count
rubocop Lint Assignment Branch Condition size for query\_timdex is too high. [<8, 18, 15> 24.76/17] 1
rubocop Lint Cyclomatic complexity for query\_timdex is too high. [9/7] 1
rubocop Lint Method has too many lines. [18/10] 1
rubocop Lint Perceived complexity for query\_timdex is too high. [10/8] 1

Comment thread app/helpers/results_helper.rb
Comment thread app/helpers/results_helper.rb Outdated
Comment thread app/helpers/results_helper.rb Outdated
@mitlib mitlib temporarily deployed to timdex-ui-pi-use-517-mo-rw57og April 22, 2026 19:09 Inactive
Copy link
Copy Markdown

Copilot AI left a comment

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 expands the search “source tab” navigation so that additional TIMDEX sources each have a dedicated tab, aligning with USE-517’s requirement that all sources appear in at least one tab.

Changes:

  • Adds new TIMDEX tabs (databases, dspace, geodata) to the allowed tab lists and UI navigation.
  • Adds TIMDEX query sourceFilter mappings for the new tabs.
  • Adds user-facing tab description blurbs for the new tabs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/controllers/application_controller_unit_test.rb Updates expected timdex_tabs/all_tabs to include the new TIMDEX tabs.
app/views/search/_source_tabs.html.erb Adds new “core” navigation tabs for the added TIMDEX sources.
app/models/feature.rb Minor formatting change to the valid feature list (no behavior change).
app/helpers/results_helper.rb Adds tab description blurbs for dspace, geodata, and databases.
app/controllers/search_controller.rb Adds sourceFilter mappings for the new TIMDEX tabs; minor formatting in error links.
app/controllers/application_controller.rb Extends timdex_tabs to include the new TIMDEX tabs.

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

Comment thread app/helpers/results_helper.rb Outdated
Comment thread app/helpers/results_helper.rb Outdated
Why are these changes being introduced:

* All sources should exist in at least one tab

Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/USE-517

How does this address that need:

* Adds additional tabs for timdex sources
* Adds additional blurbs for the new tabs
@JPrevost JPrevost force-pushed the use-517-more-tabs branch from 790afc3 to e8394a5 Compare April 23, 2026 12:17
@JPrevost JPrevost temporarily deployed to timdex-ui-pi-use-517-mo-rw57og April 23, 2026 12:17 Inactive
Comment thread app/helpers/results_helper.rb
@JPrevost JPrevost temporarily deployed to timdex-ui-pi-use-517-mo-rw57og April 23, 2026 12:29 Inactive
We decided we didn't really want this to be enabled by default, but leaving it in with a high max value to make it easy to go back to this in the future if we want it.
@JPrevost JPrevost temporarily deployed to timdex-ui-pi-use-517-mo-rw57og April 24, 2026 12:31 Inactive
@mitlib mitlib temporarily deployed to timdex-ui-pi-use-517-mo-rslovb April 29, 2026 12:45 Inactive
@matt-bernhardt matt-bernhardt self-assigned this May 4, 2026
Copy link
Copy Markdown
Member

@matt-bernhardt matt-bernhardt left a comment

Choose a reason for hiding this comment

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

I have a non-blocking request for a different test type, but it isn't something I'm going to frame as a full request for changes - if there's something in this that I'm missing, I'm happy for this to merge as-is (the type of test I'm talking about didn't exist before, so this isn't a regression)

params[:tab] = 'website'
description = 'Information about the library: events, news, services, and more'
assert_equal description, tab_description
ResultsHelper::TAB_DESCRIPTIONS.each do |tab, expected|
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like the efficiency of this test, but I wonder whether we should have a test for the behavior when a value outside that TAB_DESCRIPTIONS construct is presented?

More theoretically, I get that this test makes things more robust because we don't need to manually keep the list of test values in sync with the content of the helper method. This feels like a win - but I'm not sure where the line is where we just end up testing that .each() does what we expect.

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.

I definitely agree we should confirm something outside of the expected list returns blank. I'll confirm that test exists or add one.

module ResultsHelper
# Descriptions for each tab. HTML entries use raw anchor tags (all URLs are
# hardcoded external links, so no XSS risk) and must be marked html_safe.
TAB_DESCRIPTIONS = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like this change in pattern a lot. 🍻

else
TAB_DESCRIPTIONS.fetch(params[:tab]) do
Rails.logger.error "Unknown tab parameter in `tab_description` helper: #{params[:tab]}"
''
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Making sure I understand - this is the default value in case tab_description gets presented a value that we don't expect, right? So if there's a regression or mismatch somehow, we're not presenting gibberish, just an empty string.

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.

Correct. Previous to this we were inadvertently returning true as the logging statement is apparently truthy.

@djanelle-mit
Copy link
Copy Markdown
Contributor

From my perspective, this looks good to go. Having a const to control the max viewable tabs makes sense. Since the truncation of tabs happens on pretty wide screens now, I should probably adjust the Tablet+ breakpoints to have a more traditional dropdown menu for the "more" overflow instead of the full width menu.

We can create a follow-up ticket for that though, and definitely shouldn't block things.

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.

6 participants