Skip to content

Conversation

@HelloWorld017
Copy link

Summary

Adds new configuration option to sort the entries to the applications plugin.

// Can be ActionsFirst (default), ApplicationsFirst, NoPriority
entry_priority: Some(ApplicationsFirst)

Motivation

#257

Screenshot

With ActionsFirst:
image

With ApplicationsFirst:
image

Copy link
Collaborator

@Kirottu Kirottu left a comment

Choose a reason for hiding this comment

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

A few nitpicks, but otherwise looks alright as a feature.

max_entries: 5,
preprocess_exec_script: None,
terminal: None,
entry_priority: None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the default behavior resolves to ActionsFirst, it should be reflected here. That should also be returned by a separate function Config::default_entry_priority or by a sufficient implementation of Default on EntryPriority.

@HelloWorld017 HelloWorld017 force-pushed the feature/add-entry-priority branch from 460a293 to 3494622 Compare September 26, 2025 17:21
@Kirottu
Copy link
Collaborator

Kirottu commented Sep 28, 2025

Alright the code looks good now, but at least in my testing the setting didn't actually have any effect (with both the Zen browser and Firefox the main entry appeared first regardless of the priority setting). I think the weights need to be adjusted so that it works like expected.

@HelloWorld017
Copy link
Author

Sorry for late reply 😢

I think the weights need to be adjusted so that it works like expected.

I have adjusted weights so that in ActionsFirst, the actions could be show along the original application. (95f88d8)

I'm not certain whether should we apply this in the general scoring logic (like below), or only in the ActionsFirst case.

let mut score = (name_score * 10 + desc_score * (if entry.is_action { 5 } else { 1 }) + keyword_score) - entry.offset;

For now, to maintain original scoring logic, and not to surprise users, I only applied this to the ActionsFirst.
Please notice me if there are another good ways to improve scoring.

Thanks!

Copy link
Collaborator

@Kirottu Kirottu left a comment

Choose a reason for hiding this comment

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

While it does certainly do something now, it seems like there's still some weighting issues somewhere since if I look for "zen" on my machine with desktop actions on and with the applications first priority, it will correctly show Zen as the first entry, but proceed to show Nextcloud and LibreOffice Calc after it before the desktop actions.

Also sorry for the delay, I've been busy with studies and this PR slipped out of my mind.

@HelloWorld017
Copy link
Author

I'm not certain whether should we apply this in the general scoring logic (like below), or only in the ActionsFirst case.

To fix your case, it seems that boosting description for action should be applied to both priorities. I have applied a5a916c and tested with the Firefox and Fileroller, but I wonder whether it works on the Zen Browser and Libreoffice case, too.

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.

2 participants