Repository: microsoft/terminal
File: src/cascadia/TerminalSettingsEditor/ActionsViewModel.cpp (C++)

Code before:
        {
            _cachedDisplayName = _command.Name();
        }
        return _cachedDisplayName;
    }

    winrt::hstring CommandViewModel::Name()
    {
        return _command.HasName() ? _command.Name() : L"";
    }

    void CommandViewModel::Name(const winrt::hstring& newName)
    {
        _command.Name(newName);
        if (newName.empty())
        {
            // if the name was cleared, refresh the DisplayName
            _NotifyChanges(L"DisplayName", L"DisplayNameAndKeyChordAutomationPropName");
        }
        _cachedDisplayName.clear();
    }

    winrt::hstring CommandViewModel::DisplayNameAndKeyChordAutomationPropName()
    {
        auto result = DisplayName() + L", " + FirstKeyChordText();
        const auto additional = AdditionalKeyChordCountText();
        if (!additional.empty())
        {
            result = result + L" " + additional;
        }
        return result;
    }

    winrt::hstring CommandViewModel::FirstKeyChordText()
    {
        if (_KeyChordList.Size() != 0)
        {
            return _KeyChordList.GetAt(0).KeyChordText();
        }
        return L"";
    }

    winrt::hstring CommandViewModel::AdditionalKeyChordCountText()
    {
        const auto size = _KeyChordList.Size();
        if (size > 1)
        {
            return winrt::hstring{ L"+" + winrt::to_hstring(size - 1) };
        }
        return L"";
    }

Review comment (suggestion):
> (can we not say something like "+2 more" in the UI and "and 2 more" in the voiceover?)

Yeah, probably just a matter of updating `additional` here with the new accessible text.

Code after:
        {
            _cachedDisplayName = _command.Name();
        }
        return _cachedDisplayName;
    }

    winrt::hstring CommandViewModel::Name()
    {
        return _command.HasName() ? _command.Name() : L"";
    }

    void CommandViewModel::Name(const winrt::hstring& newName)
    {
        _command.Name(newName);
        if (newName.empty())
        {
            // if the name was cleared, refresh the DisplayName
            _NotifyChanges(L"DisplayName", L"DisplayNameAndKeyChordAutomationPropName");
        }
        _cachedDisplayName.clear();
    }

    winrt::hstring CommandViewModel::DisplayNameAndKeyChordAutomationPropName()
    {
        auto result = DisplayName() + L", " + FirstKeyChordText();
        const auto size = _KeyChordList.Size();
        if (size > 1)
        {
            result = result + L" " + hstring{ RS_fmt(L"Actions_AdditionalKeyChords", winrt::to_hstring(size - 1)) };
        }
        return result;
    }

    winrt::hstring CommandViewModel::FirstKeyChordText()
    {
        if (_KeyChordList.Size() != 0)
        {
            return _KeyChordList.GetAt(0).KeyChordText();
        }
        return L"";
    }

    winrt::hstring CommandViewModel::AdditionalKeyChordCountText()
    {
        const auto size = _KeyChordList.Size();
        if (size > 1)
        {
            return winrt::hstring{ L"+" + winrt::to_hstring(size - 1) };
        }
        return L"";
    }