Skip to content

Conversation

jjw24
Copy link
Member

@jjw24 jjw24 commented Oct 17, 2025

Follow on with #4042

Before
{7AD844BE-A3D1-412F-8F99-5BF9B6B3CCA5}

After
{7CD7956C-F38A-4885-B5FD-5212F1B44F9B}

@jjw24 jjw24 self-assigned this Oct 17, 2025
@jjw24 jjw24 added the Dev branch only An issue or fix for the Dev branch build label Oct 17, 2025
@github-actions github-actions bot added this to the 2.1.0 milestone Oct 17, 2025
Copy link

gitstream-cm bot commented Oct 17, 2025

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher/Storage/LastOpenedHistoryItem.cs

Activity based on git-commit:

Jack251970
OCT 38 additions & 7 deletions
SEP
AUG
JUL
JUN
MAY

Knowledge based on git-blame:
Jack251970: 48%

Flow.Launcher/Storage/QueryHistory.cs

Activity based on git-commit:

Jack251970
OCT 78 additions & 12 deletions
SEP
AUG
JUL
JUN
MAY

Knowledge based on git-blame:
Jack251970: 70%

Flow.Launcher/ViewModel/MainViewModel.cs

Activity based on git-commit:

Jack251970
OCT 125 additions & 88 deletions
SEP 13 additions & 15 deletions
AUG
JUL 76 additions & 51 deletions
JUN 25 additions & 13 deletions
MAY 529 additions & 316 deletions

Knowledge based on git-blame:
Jack251970: 37%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@jjw24
Copy link
Member Author

jjw24 commented Oct 17, 2025

@Jack251970 @01Dri thoughts on showing the last opened with the actual result icon? Should it just show the icon instead of badge icon as well?

@jjw24
Copy link
Member Author

jjw24 commented Oct 17, 2025

Also, there is a bug in the comparison logic when saving history results because as seen in the screenshot 'Save Settings' result shouldn't be duplicated.

@01Dri
Copy link
Contributor

01Dri commented Oct 18, 2025

Also, there is a bug in the comparison logic when saving history results because as seen in the screenshot 'Save Settings' result shouldn't be duplicated.

It’s not really a bug. The equality comparison also uses the query, so in scenarios where I type “Ter” and open Terminal, and then type “Term” and open Terminal again, I end up with two history items “Ter” and “Term” both referring to the same application (Terminal), which causes duplicate results.

In Query style, that makes sense because the two queries are different.
However, in Last Opened style, it doesn’t really make sense.
A suggestion would be to filter the history items, removing duplicates by name and sorting them by the most recent execution date/time.
Here’s an example in MainViewModels.cs -> GetHistoryItems:

    foreach (var h in historyItems
               .OrderByDescending(x => x.ExecutedDateTime) 
               .DistinctBy(x => x.GetCompositeKey()).ToList())

CompositeKey (This name is just an example; it could be something else)

   public string GetCompositeKey()
    {
        var parts = new[] { Title, SubTitle, RecordKey }
            .Where(s => !string.IsNullOrEmpty(s));

        return string.Join("-", parts);
    }

@01Dri
Copy link
Contributor

01Dri commented Oct 18, 2025

@Jack251970 @01Dri thoughts on showing the last opened with the actual result icon? Should it just show the icon instead of badge icon as well?

I think the icon with the badge is more intuitive for the user, as it indicates that the item is a history entry.

@Jack251970
Copy link
Member

Also, there is a bug in the comparison logic when saving history results because as seen in the screenshot 'Save Settings' result shouldn't be duplicated.

As 01Dri said, it is not a bug. Duplicated items will occur if you click A for many times.

SubTitle = Localize.lastExecuteTime(h.ExecutedDateTime),
IcoPath = Constant.HistoryIcon,
IcoPath = Settings.ShowBadges ? h.IcoPath : Constant.HistoryIcon,
BadgeIcoPath = Settings.ShowBadges ? Constant.HistoryIcon : h.IcoPath,
Copy link
Member

Choose a reason for hiding this comment

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

Please check if h.IcoPath exists to prevent possible blank icon

PluginID = result.PluginID,
Query = result.OriginQuery.RawQuery,
RecordKey = result.RecordKey,
IcoPath = result.IcoPath,
Copy link
Member

Choose a reason for hiding this comment

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

result.IcoPath should be absolute path which depends on Flow installed place, plugin version, Flow portable mode, etc. I think here we should use the relative path:

If this icon is inside the directory of the preinstalled plugins, let us store a relative path based on preinstalled plugin directory.

Else if the icon is inside the directory of the Flow data directory, let us store a relative path based on Flow data directory.

Else let us just use the absolute path.

Copy link
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

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

Showing icons enhance users' experience and I agree with this change. But there is still something we need to resolve

@jjw24
Copy link
Member Author

jjw24 commented Oct 18, 2025

@01Dri @Jack251970

I think the icon with the badge is more intuitive for the user, as it indicates that the item is a history entry.

What about just use the actual results icons, no badge?

However, in Last Opened style, it doesn’t really make sense.
A suggestion would be to filter the history items, removing duplicates by name and sorting them by the most recent execution date/time.

I think we should apply filtering of duplicates when last opened style is selected. What do you think?

@Jack251970
Copy link
Member

I think we should apply filtering of duplicates when last opened style is selected. What do you think?

@jjw24 I think we can do the filtering here as long as we keep the history in the order of execute time so that we can utilize the history list more effectively.

@01Dri
Copy link
Contributor

01Dri commented Oct 19, 2025

@Jack251970 @jjw24 Sorry for the question, I’m new to the open source community. My question is: am I allowed to make the requested changes, or is this PR only for jjw? Thanks!

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

Labels

1 min review Dev branch only An issue or fix for the Dev branch build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants