mirror of
https://github.com/microsoft/terminal.git
synced 2026-07-08 17:56:28 +00:00
Fix search results
This commit is contained in:
@@ -34,7 +34,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||||||
std::pair{ newTabMenuTag, L"\xE71D" }, /* All Apps */
|
std::pair{ newTabMenuTag, L"\xE71D" }, /* All Apps */
|
||||||
std::pair{ extensionsTag, L"\xEA86" }, /* Puzzle */
|
std::pair{ extensionsTag, L"\xEA86" }, /* Puzzle */
|
||||||
std::pair{ profilesTag, L"\xE7EE" }, /* Other User */
|
std::pair{ profilesTag, L"\xE7EE" }, /* Other User */
|
||||||
std::pair{ globalProfileTag, L"\xE81E" }, /* Map Layers */
|
std::pair{ globalProfileTag, L"\xE7EE" }, /* Other User */
|
||||||
std::pair{ openJsonTag, L"\xE713" }, /* Settings */
|
std::pair{ openJsonTag, L"\xE713" }, /* Settings */
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||||||
// This allows us to prioritize certain fields over others when scoring search results.
|
// This allows us to prioritize certain fields over others when scoring search results.
|
||||||
std::array<std::pair<std::optional<winrt::hstring>, int>, 2> LocalizedIndexEntry::GetSearchableFields() const
|
std::array<std::pair<std::optional<winrt::hstring>, int>, 2> LocalizedIndexEntry::GetSearchableFields() const
|
||||||
{
|
{
|
||||||
// Profile Defaults entries (DisplayTextUid starts with "Profile_") get a higher weight
|
// Profile Defaults entries get a higher weight so they rank above per-profile matches.
|
||||||
const auto weight = til::starts_with(std::wstring_view{ Entry->ResourceName }, L"Profile_") ? WeightProfileDefaults : WeightDisplayTextLocalized;
|
const auto weight = (std::wstring_view{ Entry->NavigationArgTag } == globalProfileTag) ? WeightProfileDefaults : WeightDisplayTextLocalized;
|
||||||
return { { { std::optional<winrt::hstring>{ DisplayTextLocalized }, weight },
|
return { { { std::optional<winrt::hstring>{ DisplayTextLocalized }, weight },
|
||||||
{ DisplayTextNeutral, WeightDisplayTextNeutral } } };
|
{ DisplayTextNeutral, WeightDisplayTextNeutral } } };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ $ProhibitedUids = @(
|
|||||||
"ColorScheme_ColorsHeader",
|
"ColorScheme_ColorsHeader",
|
||||||
"ColorScheme_Rename",
|
"ColorScheme_Rename",
|
||||||
"Profile_ResetProfile",
|
"Profile_ResetProfile",
|
||||||
"Profile_DeleteProfile"
|
"Profile_DeleteProfile",
|
||||||
|
"Profiles_ColorSchemesNavigator",
|
||||||
|
"Profiles_DefaultsNavigator"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Prohibited XAML files (already limited to Page root elements)
|
# Prohibited XAML files (already limited to Page root elements)
|
||||||
@@ -57,6 +59,7 @@ $ClassMap = @{
|
|||||||
ResourceName = "Nav_ColorSchemes/Content"
|
ResourceName = "Nav_ColorSchemes/Content"
|
||||||
NavigationParam = "ColorSchemes_Nav"
|
NavigationParam = "ColorSchemes_Nav"
|
||||||
SubPage = "BreadcrumbSubPage::None"
|
SubPage = "BreadcrumbSubPage::None"
|
||||||
|
SecondaryLabel = "Nav_Profiles/Content"
|
||||||
}
|
}
|
||||||
"Microsoft::Terminal::Settings::Editor::Rendering" = @{
|
"Microsoft::Terminal::Settings::Editor::Rendering" = @{
|
||||||
ResourceName = "Nav_Rendering/Content"
|
ResourceName = "Nav_Rendering/Content"
|
||||||
@@ -248,12 +251,15 @@ foreach ($xamlFile in Get-ChildItem -Path $SourceDir -Filter *.xaml)
|
|||||||
|
|
||||||
if ($includeInBuildIndex)
|
if ($includeInBuildIndex)
|
||||||
{
|
{
|
||||||
|
# Profiles > Defaults results should show "Profiles" as secondary label
|
||||||
|
$buildSecondaryLabel = $navigationParam -eq "GlobalProfile_Nav" ? "Nav_Profiles/Content" : $null
|
||||||
$entries += [pscustomobject]@{
|
$entries += [pscustomobject]@{
|
||||||
ResourceName = "$($settingContainer.Uid)/Header"
|
ResourceName = "$($settingContainer.Uid)/Header"
|
||||||
ParentPage = $pageClass
|
ParentPage = $pageClass
|
||||||
NavigationParam = $navigationParam
|
NavigationParam = $navigationParam
|
||||||
SubPage = $subPage
|
SubPage = $subPage
|
||||||
ElementName = $name
|
ElementName = $name
|
||||||
|
SecondaryLabel = $buildSecondaryLabel
|
||||||
File = $filename
|
File = $filename
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -456,4 +462,4 @@ Set-Content -LiteralPath $cppPath -Value $cpp -NoNewline
|
|||||||
|
|
||||||
Write-Host "Generated:"
|
Write-Host "Generated:"
|
||||||
Write-Host " $headerPath"
|
Write-Host " $headerPath"
|
||||||
Write-Host " $cppPath"
|
Write-Host " $cppPath"
|
||||||
|
|||||||
Reference in New Issue
Block a user