Skip to content

Conversation

@BhaskarKulshrestha
Copy link
Contributor

@BhaskarKulshrestha BhaskarKulshrestha commented Oct 4, 2025

Contributing Guidelines Checklist

This is a modified version of, and should adhere to, the Contributing Guidelines.

General Requirements

  • This PR contains housekeeping only (URL edits, copy changes etc) - if this is checked, delete other lines that don't apply
  • You are an employee of the company mentioned and confirm all included details are correct
  • This pull request adheres to the repository's Code of Conduct

For Company Additions/Updates

  • You know your alphabet - company is listed in alphabetical order in the README.md file
  • The company directly hires employees (No bootcamps / freelance sites / etc)
  • The company hires remote employees, or positions are available to remote workers and are clearly illustrated as such
  • A company profile is included in company-profiles/ - Required for new additions
  • An entry has been added or edited within the README.md file
  • Remote status has details regarding how the culture includes remote employees, how the company integrated remote workers, etc
  • Region details the geographic regions in which this company's employees can reside
  • How to apply details the best approach for new applications, page on site where open positions are listed, and any other help available for job hunters

Additional Information

This PR is for solving the issue: #1993

Feature: Search Results Pagination

Adds client‑side pagination to the company search results so users aren’t overwhelmed when a broad term (e.g. a single letter or a technology keyword) returns a large number of companies.

Users can now focus on a manageable subset (25 per page) while refining their search query in the search bar.


Summary of Change

Previously every matching company row was displayed at once. This could lead to:

  • Excessive scrolling
  • Slower DOM updates for large result sets
  • Harder comparison / cognitive overload

Pagination (25 results per page) is applied ONLY when a search term is present. With an empty search box, original behavior (show all) is preserved to avoid surprising existing users.


Implementation Details

Updated file: site/assets/companies-table.js

Key additions inside setupSearch():

  1. Pagination State: RESULTS_PER_PAGE, currentResultIndices, currentPage, totalPages, paginationContainer.
  2. Result Collection: Build currentResultIndices instead of immediately toggling row visibility.
  3. Conditional Activation: No pagination when the search box is empty.
  4. renderPage(page): Slices visible rows for the active page.
  5. buildPaginationControls(): Renders Prev / Next / numbered buttons (+ ellipses for large page counts).
  6. Reset Behavior: New searches (typing or fuzzy toggle change) reset to page 1.
  7. Auto-Hide: Pagination controls hidden if only 0–1 pages of results.
  8. Cleanup: removePagination() restores original view when search cleared.

What remained unchanged:

  • Search logic (exact first, fuzzy fallback) and Lunr index loading
  • Fuzzy toggle UI & search status text
  • Default full table display on empty search

Refrences:

Screenshot 2025-10-04 at 7 11 10 PM Screenshot 2025-10-04 at 7 11 31 PM Screenshot 2025-10-04 at 7 12 08 PM Screenshot 2025-10-04 at 7 12 42 PM Screenshot 2025-10-04 at 7 13 03 PM

Note: Our automated validation system will check your submission and provide feedback. Please address any issues found before requesting review.

@dougaitken
Copy link
Member

Closing this PR as the site has been rebuilt with a new architecture and no longer has a search results page in the same format. Thank you for the contribution!

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.

3 participants