Skip to content

Commit

Permalink
last nits before review
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed May 28, 2024
1 parent 57930ad commit 3ac5414
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 57 deletions.
20 changes: 0 additions & 20 deletions src/cascadia/TerminalApp/AppActionHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1475,24 +1475,4 @@ namespace winrt::TerminalApp::implementation
args.Handled(true);
}

void TerminalPage::_HandleOpenTasksPane(const IInspectable& sender,
const ActionEventArgs& args)
{
if (Feature_ScratchpadPane::IsEnabled())
{
const auto& scratchPane{ winrt::make_self<TasksPaneContent>() };
scratchPane->UpdateSettings(_settings);
// This is maybe a little wacky - add our key event handler to the pane
// we made. So that we can get actions for keys that the content didn't
// handle.
scratchPane->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler });

scratchPane->DispatchCommandRequested({ this, &TerminalPage::_OnDispatchCommandRequested });

const auto resultPane = std::make_shared<Pane>(*scratchPane);
_SplitPane(_senderOrFocusedTab(sender), SplitDirection::Automatic, 0.5f, resultPane);
args.Handled(true);
}
}

}
10 changes: 0 additions & 10 deletions src/cascadia/TerminalApp/TabManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,6 @@ namespace winrt::TerminalApp::implementation
// for it. The Title change will be propagated upwards through the tab's
// PropertyChanged event handler.
newTabImpl->ActivePaneChanged([weakTab, weakThis{ get_weak() }]() {
// TODO!
//
// * Make this a method on TerminalPage.
// * Convert ActivePaneChanged to a typed event, so it sends the sender (so we don't need to make all these lambdas)
// * Stash the task pane as a member on the Terminal? if one was opened.
// * If the tab does have a taskpane, then tell the taskpane the active pane changed
//
// wait don't do any of that. just do that in TerminalTab directly
// before we even raise the event you donkey

auto page{ weakThis.get() };
auto tab{ weakTab.get() };

Expand Down
1 change: 0 additions & 1 deletion src/cascadia/TerminalApp/TasksPaneContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace winrt::TerminalApp::implementation
void Close();
winrt::Microsoft::Terminal::Settings::Model::INewContentArgs GetNewTerminalArgs(BuildStartupKind kind) const;

// TODO! lots of strings here and in XAML that need RS_-ifying
winrt::hstring Title() { return RS_(L"SnippetPaneTitle/Text"); }
uint64_t TaskbarState() { return 0; }
uint64_t TaskbarProgress() { return 0; }
Expand Down
27 changes: 5 additions & 22 deletions src/cascadia/TerminalApp/TasksPaneContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,19 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Viewbox Width="20"
Height="20">
<Viewbox Width="14"
Height="14">
<Grid>
<FontIcon x:Name="ButtonBackgroundIcon"
FontFamily="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Foreground="{ThemeResource PlayButtonHoveredColor}"
Glyph="&#xF5b0;"
Visibility="Collapsed" />
<FontIcon x:Name="ButtonOutlineIcon"
FontFamily="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Foreground="{ThemeResource PlayButtonNormalColor}"
Glyph="&#xE768;" />
</Grid>
<!-- TODO! FontFamily="{ThemeResource SymbolThemeFontFamily}" -->
</Viewbox>

<VisualStateManager.VisualStateGroups>
Expand Down Expand Up @@ -80,22 +79,6 @@
<Setter Target="StatusProgress.IsActive" Value="False" />
</VisualState.Setters>
</VisualState>
<!--
<VisualState x:Name="Running">
<VisualState.Setters>
<Setter Target="ButtonBackgroundIcon.Glyph" Value=" " />
<Setter Target="ButtonOutlineIcon.Glyph" Value=" " />
<Setter Target="StatusProgress.IsActive" Value="True" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="AlreadyRan">
<VisualState.Setters>
<Setter Target="ButtonBackgroundIcon.Glyph" Value="&#xe72c;" />
<Setter Target="ButtonOutlineIcon.Glyph" Value="&#xe72c;" />
<Setter Target="StatusProgress.IsActive" Value="False" />
</VisualState.Setters>
</VisualState>-->
</VisualStateGroup>

</VisualStateManager.VisualStateGroups>
Expand Down Expand Up @@ -142,7 +125,7 @@
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(HasChildren), Mode=OneWay}">

<Button.Content>
<FontIcon FontFamily="Segoe Fluent Icons, Segoe MDL2 Assets"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Glyph="&#xE768;" />
<!--
Expand Down
2 changes: 0 additions & 2 deletions src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ static constexpr std::string_view RestartConnectionKey{ "restartConnection" };
static constexpr std::string_view ToggleBroadcastInputKey{ "toggleBroadcastInput" };
static constexpr std::string_view OpenScratchpadKey{ "experimental.openScratchpad" };
static constexpr std::string_view OpenAboutKey{ "openAbout" };
static constexpr std::string_view OpenTasksPaneKey{ "experimental.openTasks" };

static constexpr std::string_view ActionKey{ "action" };

Expand Down Expand Up @@ -435,7 +434,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
{ ShortcutAction::ToggleBroadcastInput, RS_(L"ToggleBroadcastInputCommandKey") },
{ ShortcutAction::OpenScratchpad, RS_(L"OpenScratchpadKey") },
{ ShortcutAction::OpenAbout, RS_(L"OpenAboutCommandKey") },
{ ShortcutAction::OpenTasksPane, RS_(L"OpenTasksPaneCommandKey") },
};
}();

Expand Down
3 changes: 1 addition & 2 deletions src/cascadia/TerminalSettingsModel/AllShortcutActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@
ON_ALL_ACTIONS(RestartConnection) \
ON_ALL_ACTIONS(ToggleBroadcastInput) \
ON_ALL_ACTIONS(OpenScratchpad) \
ON_ALL_ACTIONS(OpenAbout) \
ON_ALL_ACTIONS(OpenTasksPane)
ON_ALL_ACTIONS(OpenAbout)

#define ALL_SHORTCUT_ACTIONS_WITH_ARGS \
ON_ALL_ACTIONS_WITH_ARGS(AdjustFontSize) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
<data name="SplitPaneParentCommandName" xml:space="preserve">
<value>Split pane</value>
</data>
<data name="SnippetsPaneCommandName" xml:space="preserve">
<value>Open snippets pane</value>
</data>
<data name="ApplicationDisplayNamePortable" xml:space="preserve">
<value>Terminal (Portable)</value>
<comment>This display name is used when the Terminal application is running in a "portable" mode, where settings are not stored in a shared location.</comment>
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalSettingsModel/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@
{ "command": { "action": "movePane", "index": 8 }, "id": "Terminal.MovePaneToTab8" },
{ "command": { "action": "movePane", "window": "new" }, "id": "Terminal.MovePaneToNewWindow" },
{ "command": "restartConnection", "id": "Terminal.RestartConnection" },
{ "command": { "action": "splitPane", "type": "snippets" }, "id": "Terminal.OpenSnippetsPane", "name": { "key": "SnippetsPaneCommandName" } },

// Clipboard Integration
{ "command": { "action": "copy", "singleLine": false }, "keys": "ctrl+shift+c", "id": "Terminal.CopySelectedText" },
Expand Down

1 comment on commit 3ac5414

@github-actions
Copy link

Choose a reason for hiding this comment

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

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (2)

actiopn
sxnui

Previously acknowledged words that are now absent CRLFs Redir wcsicmp 🫥
To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:microsoft/terminal.git repository
on the dev/migrie/f/snippets-pane branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.22/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/9271780126/attempts/1'
Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (2211) from .github/actions/spelling/expect/04cdb9b77d6827c0202f51acd4205b017015bfff.txt
.github/actions/spelling/expect/alphabet.txt
.github/actions/spelling/expect/expect.txt
.github/actions/spelling/expect/web.txt and unrecognized words (2)

Dictionary Entries Covers Uniquely
cspell:cpp/src/lang-jargon.txt 11 1 1
cspell:swift/src/swift.txt 53 1 1
cspell:gaming-terms/dict/gaming-terms.txt 59 1 1
cspell:monkeyc/src/monkeyc_keywords.txt 123 1 1
cspell:cryptocurrencies/cryptocurrencies.txt 125 1 1

Consider adding them (in .github/workflows/spelling2.yml) for uses: check-spelling/check-spelling@v0.0.22 in its with:

      with:
        extra_dictionaries:
          cspell:cpp/src/lang-jargon.txt
          cspell:swift/src/swift.txt
          cspell:gaming-terms/dict/gaming-terms.txt
          cspell:monkeyc/src/monkeyc_keywords.txt
          cspell:cryptocurrencies/cryptocurrencies.txt

To stop checking additional dictionaries, add (in .github/workflows/spelling2.yml) for uses: check-spelling/check-spelling@v0.0.22 in its with:

check_extra_dictionaries: ''
Errors (1)

See the 📜action log or 📝 job summary for details.

❌ Errors Count
❌ ignored-expect-variant 3

See ❌ Event descriptions for more information.

✏️ Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Please sign in to comment.