Skip to content
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

New Tab Menu Customization #13763

Merged
29 commits merged into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7e922ab
Adding a basic NewTabMenuEntry and some scaffolding
FWest98 Aug 16, 2022
88a336b
Add SeparatorEntry but it breaks the build
FWest98 Aug 16, 2022
cec114e
Implemented FolderEntry and SeparatorEntry
FWest98 Aug 16, 2022
294c13a
Add Profile and RemainingProfiles entry definitions
FWest98 Aug 16, 2022
6676785
Full implementation of the feature
FWest98 Aug 16, 2022
ea62c28
Add ProfileCollection abstraction
FWest98 Aug 17, 2022
1d5f6d3
Code cleanup and documentation
FWest98 Aug 17, 2022
40f2a3e
Update schema
FWest98 Aug 17, 2022
b140c75
Code style fixes
FWest98 Aug 17, 2022
fc18f1f
Add words
FWest98 Aug 17, 2022
2e6f1ce
Fixing spelling
FWest98 Sep 10, 2022
bc628f6
Remove ProfilesSourceEntry for now
FWest98 Sep 10, 2022
7b7dc4f
Copyright headers and small code improvements
FWest98 Sep 10, 2022
46a09a4
Remove redundant override
FWest98 Sep 10, 2022
14f6ece
Merge branch 'main' into fw/profiles_dropdown
FWest98 Sep 10, 2022
af0515a
Review comment
FWest98 Sep 10, 2022
5425298
Merge branch 'main' into fw/profiles_dropdown
carlos-zamora Oct 7, 2022
6bceb8c
Apply suggestions from code review
FWest98 Oct 7, 2022
e5d81a1
Merge branch 'main' into fw/profiles_dropdown
FWest98 Nov 20, 2022
6239a7f
Fix merging mistake
FWest98 Nov 21, 2022
afc2f0b
Update resources file with feedback; reintroduce VS spaces
FWest98 Nov 22, 2022
77304b7
Bug bash, review feedback
FWest98 Nov 22, 2022
b7f915f
Implement auto-inlining and emtpy-handling for folders
FWest98 Nov 24, 2022
547b500
Fix code formatting
FWest98 Nov 24, 2022
7ee3602
Add support for matchProfiles entry
FWest98 Nov 24, 2022
86fb995
Update JSON Schema
FWest98 Nov 24, 2022
2473709
Incorporate review feedback
FWest98 Dec 1, 2022
ac703df
Merge remote-tracking branch 'origin/main' into fw/profiles_dropdown
zadjii-msft Dec 6, 2022
ec176b1
Adjust matchProfiles semantics to AND
FWest98 Dec 6, 2022
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
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ conbufferout
concat
concfg
conclnt
concretizations
conddkrefs
condrv
conechokey
Expand Down Expand Up @@ -2607,6 +2608,7 @@ website
websocket
wekyb
WEOF
Westerman
wex
wextest
wextestclass
Expand Down
180 changes: 180 additions & 0 deletions doc/cascadia/profiles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,160 @@
},
"type": "object"
},
"NewTabMenuEntryType": {
"enum": [
"source",
"profile",
"folder",
"separator",
"remainingProfiles",
"matchProfiles"
]
},
"NewTabMenuEntry": {
"properties": {
"type": {
"description": "The type of menu entry",
"$ref": "#/$defs/NewTabMenuEntryType"
}
},
"required": [
"type"
],
"type": "object"
},
"FolderEntryInlining": {
"enum": [
"never",
"auto"
]
},
"FolderEntry": {
"description": "A folder entry in the new tab dropdown",
"allOf": [
{
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"properties": {
"type": {
"type": "string",
"const": "folder"
},
"name": {
"type": "string",
"default": "",
"description": "The name of the folder to show in the menu"
},
"icon": {
"$ref": "#/$defs/Icon"
},
"entries": {
"type": "array",
"description": "The entries to put inside this folder",
"minItems": 1,
"items": {
"$ref": "#/$defs/NewTabMenuEntry"
}
},
"inline": {
"description": "When set to auto and the folder only has a single entry, the entry will show directly and no folder will be rendered",
"default": "never",
"$ref": "#/$defs/FolderEntryInlining"
},
"allowEmpty": {
"description": "Whether to render a folder without entries, or to hide it",
"default": "false",
"type": "boolean"
}
}
}
]
},
"SeparatorEntry": {
"description": "A separator in the new tab dropdown",
"allOf": [
{
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"properties": {
"type": {
"type": "string",
"const": "separator"
}
}
}
]
},
"ProfileEntry": {
"description": "A profile in the new tab dropdown",
"allOf": [
{
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"properties": {
"type": {
"type": "string",
"const": "profile"
},
"profile": {
"type": "string",
"default": "",
"description": "The name or GUID of the profile to show in this entry"
}
}
}
]
},
"RemainingProfilesEntry": {
"description": "The set of profiles that are not yet explicitly included in another entry, such as the profile or source entries. This entry can be used at most one time!",
"allOf": [
{
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"properties": {
"type": {
"type": "string",
"const": "remainingProfiles"
}
}
}
]
},
"MatchProfilesEntry": {
"description": "A set of profiles all matching the given name, source, or command line, to show in the new tab dropdown",
"allOf": [
{
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"properties": {
"type": {
"type": "string",
"const": "matchProfiles"
},
"name": {
"type": "string",
"default": "",
"description": "The name of the profiles to match"
},
"source": {
"type": "string",
"default": "",
"description": "The source of the profiles to match"
},
"commandline": {
"type": "string",
"default": "",
"description": "The command line of the profiles to match"
}
}
}
]
},
"SwitchToAdjacentTabArgs": {
"oneOf": [
{
Expand Down Expand Up @@ -1546,6 +1700,29 @@
}
]
},
"NewTabMenu": {
"description": "Defines the order and structure of the 'new tab' menu. It can consist of e.g. profiles, folders, and separators.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/$defs/FolderEntry"
},
{
"$ref": "#/$defs/SeparatorEntry"
},
{
"$ref": "#/$defs/ProfileEntry"
},
{
"$ref": "#/$defs/MatchProfilesEntry"
},
{
"$ref": "#/$defs/RemainingProfilesEntry"
}
]
}
},
"Keybinding": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -1924,6 +2101,9 @@
},
"type": "array"
},
"newTabMenu": {
"$ref": "#/$defs/NewTabMenu"
},
"language": {
"default": "",
"description": "Sets an override for the app's preferred language, expressed as a BCP-47 language tag like en-US.",
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/AppLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static const std::array settingsLoadWarningsLabels {
USES_RESOURCE(L"FailedToParseStartupActions"),
USES_RESOURCE(L"FailedToParseSubCommands"),
USES_RESOURCE(L"UnknownTheme"),
USES_RESOURCE(L"DuplicateRemainingProfilesEntry"),
};
static const std::array settingsLoadErrorsLabels {
USES_RESOURCE(L"NoProfilesText"),
Expand Down
23 changes: 15 additions & 8 deletions src/cascadia/TerminalApp/Resources/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,19 @@
<value>Warnings were found while parsing your keybindings:</value>
</data>
<data name="TooManyKeysForChord" xml:space="preserve">
<value>&#x2022; Found a keybinding with too many strings for the "keys" array. There should only be one string value in the "keys" array.</value>
<comment>{Locked="\"keys\"","&#x2022;"} This glyph is a bullet, used in a bulleted list.</comment>
<value> Found a keybinding with too many strings for the "keys" array. There should only be one string value in the "keys" array.</value>
<comment>{Locked="\"keys\"",""} This glyph is a bullet, used in a bulleted list.</comment>
</data>
<data name="FailedToParseSubCommands" xml:space="preserve">
<value>&#x2022; Failed to parse all subcommands of nested command.</value>
<value> Failed to parse all subcommands of nested command.</value>
</data>
<data name="MissingRequiredParameter" xml:space="preserve">
<value>&#x2022; Found a keybinding that was missing a required parameter value. This keybinding will be ignored.</value>
<comment>{Locked="&#x2022;"} This glyph is a bullet, used in a bulleted list.</comment>
<value> Found a keybinding that was missing a required parameter value. This keybinding will be ignored.</value>
<comment>{Locked=""} This glyph is a bullet, used in a bulleted list.</comment>
</data>
<data name="UnknownTheme" xml:space="preserve">
<value>&#x2022; The specified "theme" was not found in the list of themes. Temporarily falling back to the default value.</value>
<comment>{Locked="&#x2022;"} This glyph is a bullet, used in a bulleted list.</comment>
<value> The specified "theme" was not found in the list of themes. Temporarily falling back to the default value.</value>
<comment>{Locked=""} This glyph is a bullet, used in a bulleted list.</comment>
</data>
<data name="LegacyGlobalsProperty" xml:space="preserve">
<value>The "globals" property is deprecated - your settings might need updating. </value>
Expand Down Expand Up @@ -752,6 +752,10 @@
<value>Suggestions found: {0}</value>
<comment>{0} will be replaced with a number.</comment>
</data>
<data name="DuplicateRemainingProfilesEntry" xml:space="preserve">
<value>The "newTabMenu" field contains more than one entry of type "remainingProfiles". Only the first one will be considered.</value>
<comment>{Locked="newTabMenu"} {Locked="remainingProfiles"}</comment>
</data>
<data name="AboutToolTip" xml:space="preserve">
<value>Open a dialog containing product information</value>
</data>
Expand Down Expand Up @@ -788,4 +792,7 @@
<data name="TabCloseToolTip" xml:space="preserve">
<value>Close this tab</value>
</data>
</root>
<data name="NewTabMenuFolderEmpty" xml:space="preserve">
<value>Empty...</value>
</data>
</root>
Loading