-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Run plugin refactor and installer bundling #9
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
Open
tonythethompson
wants to merge
10
commits into
master
Choose a base branch
from
pr/run-plugin-and-installer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+807
−609
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
df07d07
feat: refactor Run plugin, add query scoring, and bundle in installer
tonythethompson a53dbd9
Potential fix for pull request finding
tonythethompson 8d9f74d
Potential fix for pull request finding
tonythethompson c874fb1
fix: address PR #9 Run plugin and installer review feedback
tonythethompson 947e877
fix: address PR #9 review findings
tonythethompson 535f598
feat: lock contained folder-bolt logo with edge-fit layout
tonythethompson 0417d9e
fix: keep unordered favorites above recent shortcuts in Run browse mode
tonythethompson e734a73
fix: address Copilot PR #9 review feedback
tonythethompson fe4a467
fix: drain async draft IO in ShortcutDraftStoreTests
tonythethompson 9ca1a66
fix: preserve OpenDevServerOnLaunch in TrySaveRunEditor clone
tonythethompson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| using QuickShell.Models; | ||
| using QuickShell.Services; | ||
|
|
||
| namespace QuickShell.Core.Tests; | ||
|
|
||
| public sealed class RunQueryScoringTests | ||
| { | ||
| [Fact] | ||
| public void BrowseMode_ShortcutsOutrankUtilities() | ||
| { | ||
| var shortcut = new TerminalShortcut { Name = "Demo", Directory = @"C:\Demo" }; | ||
| var shortcutScore = RunQueryScoring.ComputeShortcutScore(shortcut, search: string.Empty, directActivationBrowse: true); | ||
| var utilityScore = RunQueryScoring.ComputeUtilityScore(rankedScore: 2000, search: string.Empty, utilityOrder: 0); | ||
|
|
||
| Assert.True(shortcutScore > utilityScore); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void BrowseMode_PinnedShortcutsRespectPinOrder() | ||
| { | ||
| var first = new TerminalShortcut { Name = "A", IsPinned = true, PinOrder = 1 }; | ||
| var second = new TerminalShortcut { Name = "B", IsPinned = true, PinOrder = 2 }; | ||
|
|
||
| var firstScore = RunQueryScoring.ComputeShortcutScore(first, string.Empty, directActivationBrowse: true); | ||
| var secondScore = RunQueryScoring.ComputeShortcutScore(second, string.Empty, directActivationBrowse: true); | ||
|
|
||
| Assert.True(firstScore > secondScore); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void BrowseMode_PinOrderBeatsRecency() | ||
| { | ||
| var recentSecond = new TerminalShortcut | ||
| { | ||
| Name = "B", | ||
| IsPinned = true, | ||
| PinOrder = 2, | ||
| LastUsedUtc = new DateTime(2024, 6, 1, 12, 0, 0, DateTimeKind.Utc), | ||
| }; | ||
| var olderFirst = new TerminalShortcut | ||
| { | ||
| Name = "A", | ||
| IsPinned = true, | ||
| PinOrder = 1, | ||
| LastUsedUtc = null, | ||
| }; | ||
|
|
||
| var now = new DateTime(2024, 6, 1, 13, 0, 0, DateTimeKind.Utc); | ||
| var firstScore = RunQueryScoring.ComputeShortcutScore(olderFirst, string.Empty, directActivationBrowse: true, now); | ||
| var secondScore = RunQueryScoring.ComputeShortcutScore(recentSecond, string.Empty, directActivationBrowse: true, now); | ||
|
|
||
| Assert.True(firstScore > secondScore); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void BrowseMode_UnorderedPinnedShortcutsRankBelowExplicitOrder() | ||
| { | ||
| var ordered = new TerminalShortcut { Name = "A", IsPinned = true, PinOrder = 1 }; | ||
| var unordered = new TerminalShortcut { Name = "B", IsPinned = true, PinOrder = null }; | ||
|
|
||
| var orderedScore = RunQueryScoring.ComputeShortcutScore(ordered, string.Empty, directActivationBrowse: true); | ||
| var unorderedScore = RunQueryScoring.ComputeShortcutScore(unordered, string.Empty, directActivationBrowse: true); | ||
|
|
||
| Assert.True(orderedScore > unorderedScore); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void BrowseMode_UnorderedPinnedBeatsRecentUnpinned() | ||
| { | ||
| var favorite = new TerminalShortcut { Name = "Fav", IsPinned = true, PinOrder = null }; | ||
| var recent = new TerminalShortcut | ||
| { | ||
| Name = "Recent", | ||
| LastUsedUtc = new DateTime(2024, 6, 1, 12, 0, 0, DateTimeKind.Utc), | ||
| }; | ||
|
|
||
| var now = new DateTime(2024, 6, 1, 13, 0, 0, DateTimeKind.Utc); | ||
| var favoriteScore = RunQueryScoring.ComputeShortcutScore(favorite, string.Empty, directActivationBrowse: true, now); | ||
| var recentScore = RunQueryScoring.ComputeShortcutScore(recent, string.Empty, directActivationBrowse: true, now); | ||
|
|
||
| Assert.True(favoriteScore > recentScore); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void BrowseMode_UtilitiesPreserveDeclarationOrder() | ||
| { | ||
| var firstUtility = RunQueryScoring.ComputeUtilityScore(2000, string.Empty, utilityOrder: 0); | ||
| var secondUtility = RunQueryScoring.ComputeUtilityScore(2000, string.Empty, utilityOrder: 1); | ||
|
|
||
| Assert.True(firstUtility > secondUtility); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void SearchMode_UtilitiesKeepHighRankWhenMatched() | ||
| { | ||
| var firstUtility = RunQueryScoring.ComputeUtilityScore(2000, "export", utilityOrder: 0); | ||
| var secondUtility = RunQueryScoring.ComputeUtilityScore(2000, "export", utilityOrder: 1); | ||
|
|
||
| Assert.Equal(2000, firstUtility); | ||
| Assert.True(firstUtility > secondUtility); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.