Skip to content

Add Sorting Functionality for Quick Search Results #3012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025

Conversation

SougandhS
Copy link
Contributor

This PR adds sorting functionality to the Quick Search results, enabling users to sort entries by Line Number, Text, or by Path. The update introduces a user interface element (such as a dropdown or clickable column headers) that allows users to choose their preferred sorting method. This improves the usability of the search feature, especially when working with large result sets, by helping users locate relevant entries more quickly.

quick.mp4

Fixes : #1940

@SougandhS
Copy link
Contributor Author

Hi @mickaelistria
Could you please check this PR when you have some time..

@SougandhS SougandhS force-pushed the quickSearchSorting branch 3 times, most recently from 431fd3f to 2babf62 Compare June 10, 2025 05:30
@SougandhS SougandhS force-pushed the quickSearchSorting branch from 2babf62 to 0685418 Compare June 13, 2025 03:13
@SougandhS
Copy link
Contributor Author

Hi @merks, could you please take a look at this PR when you get a sec?

@SougandhS SougandhS force-pushed the quickSearchSorting branch 2 times, most recently from 577685c to 573a28b Compare June 20, 2025 05:48
@SougandhS
Copy link
Contributor Author

hi @iloveeclipse, could you please review this ?

@SougandhS SougandhS force-pushed the quickSearchSorting branch from 573a28b to 2b0e17d Compare June 24, 2025 12:00
Copy link
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

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

I’m traveling and looking with an iPhone. It’s not clear why some of the fields are arrays. Mostly I see access via [0].

@SougandhS
Copy link
Contributor Author

I’m traveling and looking with an iPhone. It’s not clear why some of the fields are arrays. Mostly I see access via [0].

Thanks Ed Merks for checking. I used single-element final arrays here so I could retain and update the values inside TableColumn.addSelectionListener 's new SelectionAdapter() {...}.(). class.

@merks
Copy link
Contributor

merks commented Jun 24, 2025

I’m traveling and looking with an iPhone. It’s not clear why some of the fields are arrays. Mostly I see access via [0].

Thanks Ed Merks for checking. I used single-element final arrays here so I could retain and update the values inside TableColumn.addSelectionListener 's new SelectionAdapter() {...}.(). class.

So why not ordinary non-final fields? Taking off now.

@SougandhS
Copy link
Contributor Author

So why not ordinary non-final fields? Taking off now.

non-final values can work too, I will update it

@SougandhS SougandhS force-pushed the quickSearchSorting branch 2 times, most recently from 2e2a84c to 26c7fc8 Compare June 26, 2025 10:33
@SougandhS SougandhS requested a review from merks June 29, 2025 15:18
@SougandhS SougandhS force-pushed the quickSearchSorting branch from 26c7fc8 to 159b2a7 Compare June 29, 2025 15:18
Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

I see (smaller) style issues, but unfortunately too many of them to approve:

  1. Arrays passed to access first element only to handleColumnSort(). Looks ugly, hard to debug. Cant we have sortColumnIndex and sortDirectionAscending just as regulat fields?
  2. New code is not properly formatted (no spaces between arguments, in if statements etc). Looks really not nice. E.g. if(comparator==null) should be if (comparator == null).
  3. contentProvider.sortList(); called in the middle of unrelated code in refreshWidgets(). Can't it be called after list.setItemCount(itemCount); ?
  4. items.sort(comparator); is executed on each call of getElements(). Shouldn't be called once at the place where the sort order is initialized / changed?

Copy link
Contributor

github-actions bot commented Jun 30, 2025

Test Results

 2 778 files  ±0   2 778 suites  ±0   1h 48m 36s ⏱️ + 7m 52s
 7 932 tests ±0   7 704 ✅ +1  228 💤 ±0  0 ❌  - 1 
23 349 runs  ±0  22 603 ✅ +1  746 💤 ±0  0 ❌  - 1 

Results for commit cbcce94. ± Comparison against base commit a9b8d9a.

♻️ This comment has been updated with latest results.

@SougandhS SougandhS force-pushed the quickSearchSorting branch from 159b2a7 to 05788ba Compare July 1, 2025 03:00
@SougandhS
Copy link
Contributor Author

I see (smaller) style issues, but unfortunately too many of them to approve:

  1. Done, refactored accordingly
  2. Done
  3. Done, removed from refreshWidgets() -> didn't required when 4. was done
  4. Done, moved to block where comparator is set

@SougandhS SougandhS force-pushed the quickSearchSorting branch from 05788ba to c2bb07a Compare July 1, 2025 03:00
@SougandhS SougandhS force-pushed the quickSearchSorting branch from c2bb07a to fc1b513 Compare July 8, 2025 08:49
@SougandhS SougandhS force-pushed the quickSearchSorting branch from fc1b513 to 62c4d94 Compare July 10, 2025 00:38
@SougandhS SougandhS requested a review from iloveeclipse July 10, 2025 00:39
@SougandhS SougandhS force-pushed the quickSearchSorting branch from 62c4d94 to 271b8ba Compare July 25, 2025 10:17
@SougandhS SougandhS force-pushed the quickSearchSorting branch 2 times, most recently from 23447f7 to 95d52f1 Compare August 8, 2025 06:18
@SougandhS
Copy link
Contributor Author

Hi @iloveeclipse
Could you please check this again ?

@iloveeclipse iloveeclipse dismissed their stale review August 8, 2025 13:59

No time, going to vacation now

@SougandhS
Copy link
Contributor Author

Hi @merks
Could you please check this ?

Copy link
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

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

Look okay. Just one small improvement could be applied.

This commit adds sorting functionality to the Quick Search results,
allowing users to sort entries by Line Number, Text, and Path.

Fixes : eclipse-platform#1940
@SougandhS
Copy link
Contributor Author

Look okay. Just one small improvement could be applied.

If there are no more issues, can this be merged ?

@merks
Copy link
Contributor

merks commented Aug 11, 2025

I’m not sure if @iloveeclipse still wants to review.

@iloveeclipse
Copy link
Member

No, I'm out of PC till 26.08

@merks merks merged commit 0c268ac into eclipse-platform:master Aug 11, 2025
18 checks passed
@SougandhS
Copy link
Contributor Author

Thank you @iloveeclipse & @merks

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.

Quick Search: Allow ordering of search results by Path
3 participants