Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 7 additions & 42 deletions QuickShell.Core.Tests/RunGlobalQueryTests.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using QuickShell.Services;




namespace QuickShell.Core.Tests;




public sealed class RunGlobalQueryTests

{

[Theory]

[InlineData("quickshell")]
Expand All @@ -21,85 +15,56 @@ public sealed class RunGlobalQueryTests
[InlineData("qs")]

public void TryActivate_PluginName_EntersBrowseMode(string query)

{

Assert.True(RunGlobalQuery.TryActivate(query, rawQuery: null, out var remaining));

Assert.Equal(string.Empty, remaining);

}




[Fact]

public void TryActivate_PluginNameWithFilter_StripsPrefix()

{

Assert.True(RunGlobalQuery.TryActivate("quick shell api", rawQuery: null, out var remaining));

Assert.Equal("api", remaining);

}




[Fact]

public void TryActivate_RawQueryFallback_ActivatesWhenSearchEmpty()

{

Assert.True(RunGlobalQuery.TryActivate(string.Empty, "Quick Shell", out var remaining));

Assert.Equal(string.Empty, remaining);

}




[Fact]

public void TryActivate_UnrelatedQuery_DoesNotActivate()

{

Assert.False(RunGlobalQuery.TryActivate("my api project", rawQuery: null, out var remaining));

Assert.Equal("my api project", remaining);

}




[Fact]

public void ShouldSuppressEmptyGlobalQuery_BlocksBareGlobalSearch()

{

var context = new QueryActivationContext(HasActionKeyword: false, Search: string.Empty);

Assert.True(RunGlobalQuery.ShouldSuppressEmptyGlobalQuery(context));

}




[Fact]

public void ShouldSuppressEmptyGlobalQuery_AllowsActionKeywordBrowse()

{

var context = new QueryActivationContext(HasActionKeyword: true, Search: string.Empty);

Assert.False(RunGlobalQuery.ShouldSuppressEmptyGlobalQuery(context));

}

}


1 change: 0 additions & 1 deletion QuickShell.Core.Tests/TestQuickShellServicesFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,4 @@ private static (AppDataPaths appDataPaths, TerminalLaunchGlyphs glyphs, Terminal
var prewarm = new TerminalCatalogPrewarm(bundle.Catalog);
return (appDataPaths, glyphs, listIcons, prewarm);
}

}
3 changes: 1 addition & 2 deletions QuickShell.Core.Tests/WorkspaceTrustCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ private static (QuickShellServices Services, QuickShellLifetime Lifetime, Shortc
lifetime);
return (services, lifetime, drafts);
}



private static TerminalShortcut CreateWorkspace() =>
new()
{
Expand Down
70 changes: 16 additions & 54 deletions QuickShell.Core/Models/TerminalShortcut.cs
Original file line number Diff line number Diff line change
@@ -1,84 +1,47 @@
namespace QuickShell.Models;




internal sealed class TerminalShortcut

{

public string Id { get; set; } = string.Empty;




public string Name { get; set; } = string.Empty;




public string? Abbreviation { get; set; }




public string Directory { get; set; } = string.Empty;




public string? Command { get; set; }




// "default" means use extension-level default terminal setting.

public string Terminal { get; set; } = "default";




// Optional Windows Terminal profile name for terminal=wt/default->wt.

public string? WtProfile { get; set; }




public bool RunAsAdmin { get; set; }




public bool IsPinned { get; set; }




// Lower number means higher in the favorites section.

public int? PinOrder { get; set; }




public DateTime? LastUsedUtc { get; set; }




/// <summary>One or more terminal launches for this workspace. When empty on disk, synthesized from legacy fields on load.</summary>

public List<WorkspaceEntry> Launches { get; set; } = [];




/// <summary>Optional dev server URL opened in the browser when the workspace runs.</summary>
public string? DevServerUrl { get; set; }




/// <summary>When true, opens <see cref="DevServerUrl"/> whenever the full workspace runs.</summary>

public bool OpenDevServerOnLaunch { get; set; }




/// <summary>Optional repository URL opened from the workspace action menu.</summary>

public string? RepoUrl { get; set; }




/// <summary>
/// One or more GUI companion apps. When empty on disk, synthesized from the legacy
/// scalar companion fields on load (see <c>CompanionAppNormalization</c>).
Expand All @@ -103,7 +66,6 @@ internal sealed class TerminalShortcut
/// for the workspace directory. Mirrored from the first <see cref="CompanionApps"/> entry.
/// </summary>
public string? CompanionAppArguments { get; set; }

}


1 change: 0 additions & 1 deletion QuickShell.Core/Models/WorkspaceSecurityMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ internal sealed record WorkspaceSecurityMetadata
public bool IsTrusted { get; init; } = true;

public long Revision { get; init; } = 1;

}

internal sealed record StoredWorkspace(
Expand Down
Loading
Loading