Skip to content

ER: Remove unused search id query selectors #8803

Description

@castillios

Emergent Requirement - Problem

In assets/js/current-projects.js, there are three query selectors that select an id named search. However, in _includes/current-projects.html, there is no id for search.

We must remove any query selectors for search in assets/js/current-projects.js since it is an unused id.

Issue you discovered this emergent requirement in

Date discovered

9/19/2026

Did you have to do something temporarily

  • YES
  • NO

Who was involved

@ldaws003 @castillios

What happens if this is not addressed

Any deprecated IDs may continue to bloat the codebase if left unaddressed.

Resources

Recommended Action Items

  • Make a new issue
  • Discuss with team
  • Let a Team Lead know

Potential solutions [draft]

  • Create a small issue that lists the 3 instances of document.querySelector('#search') and their corresponding line numbers to be removed from assets/js/current-projects.js.

  • In your issue body under the Instructions section, include before and after code snippets as follows:

    Line 105 before:

    const inputEl = document.querySelector('#search-desktop') || document.querySelector('#search-mobile') || document.querySelector('#search');
    

    Line 105 after removing document.querySelector('#search'):

    const inputEl = document.querySelector('#search-desktop') || document.querySelector('#search-mobile');
    

    Lines 344-348 before:

    function searchEventHandler(e){
        e.preventDefault();
        const input = document.querySelector('#search-desktop') || document.querySelector('#search-mobile') || document.querySelector('#search');
        let searchTerm = input ? input.value : '';
    

    Lines 344-348 after removing document.querySelector('#search'):

    function searchEventHandler(e){
        e.preventDefault();
        const input = document.querySelector('#search-desktop') || document.querySelector('#search-mobile');
        let searchTerm = input ? input.value : '';
    

    Lines 376-380 before:

    function searchCloseEventHandler(e){
        e.preventDefault();
        const input = document.querySelector('#search-desktop') || document.querySelector('#search-mobile') || document.querySelector('#search');
        if (input) input.value="";
    }
    

    Lines 376-380 after removing document.querySelector('#search'):

    function searchCloseEventHandler(e){
        e.preventDefault();
        const input = document.querySelector('#search-desktop') || document.querySelector('#search-mobile');
        if (input) input.value="";
    }
    
  • After listing implementation details, include an action item to test and verify that the changes still work by performing a search in both mobile and desktop views on the Projects and Projects-Check pages

  • Ensure your issue labels match this parent ER (with the exception of Issue Making: Level 1 and ER)

  • Once the overall issue has been drafted, in the sidebar under Relationships, add this ER as a parent to your issue

  • Review and if ready, apply the ready for merge team label

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Complexity: SmallTake this type of issues after the successful merge of your second good first issueDraftIssue is still in the process of being createdEREmergent RequestIssue Making: Level 1Make issues from a template and a spreadsheetP-Feature: Projects pagehttps://www.hackforla.org/projects/ready for merge teamneeds a senior review either to do some re writing or to approve it for ready for prioritizationrole: back end/devOpsTasks for back-end developerssize: 0.25ptCan be done in 0.5 to 1.5 hours

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions