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

Allow actions in the new tab dropdown #17281

Merged
merged 103 commits into from
Jun 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
90627b3
add origin tag
PankajBhojwani Mar 5, 2024
9dff28f
update calls in tests
PankajBhojwani Mar 5, 2024
8bcbd0b
fix tests
PankajBhojwani Mar 5, 2024
052d063
ah one of the tests uses this
PankajBhojwani Mar 5, 2024
8cc82de
generated
PankajBhojwani Mar 5, 2024
642d0ab
inbox makes more sense
PankajBhojwani Mar 5, 2024
66fe08f
default ids
PankajBhojwani Mar 7, 2024
2bb1b6c
conflict
PankajBhojwani Mar 19, 2024
be193b2
merge origin
PankajBhojwani Mar 19, 2024
db528c9
generate IDs for user commands
PankajBhojwani Mar 26, 2024
7c907fe
nits
PankajBhojwani Mar 26, 2024
b43191d
spacing
PankajBhojwani Mar 26, 2024
2093660
line
PankajBhojwani Mar 26, 2024
6c32539
string of numbers is unsightly but it works
PankajBhojwani Mar 27, 2024
eccd87f
update comment
PankajBhojwani Mar 27, 2024
44510dc
move id generation to fixupusersettings
PankajBhojwani Mar 28, 2024
10d1fc8
this way is better
PankajBhojwani Mar 28, 2024
71bf90f
even better, also get the ID from json
PankajBhojwani Mar 28, 2024
d57c7a1
move this
PankajBhojwani Mar 28, 2024
5c2307c
fix test
PankajBhojwani Mar 28, 2024
9fc6972
add tests
PankajBhojwani Mar 29, 2024
dca7df5
excess line
PankajBhojwani Mar 29, 2024
dd25ed7
change tests
PankajBhojwani Apr 1, 2024
6e293a5
Everytime
PankajBhojwani Apr 1, 2024
af2d22f
defaults conflict
PankajBhojwani Apr 11, 2024
bdf42c2
first round of nits
PankajBhojwani Apr 11, 2024
12f3aa9
truncate and hex, debug assert
PankajBhojwani Apr 12, 2024
aa49212
null check
PankajBhojwani Apr 12, 2024
5ee630e
fmt is smart
PankajBhojwani Apr 12, 2024
360b92e
fmt_compile, fix test
PankajBhojwani Apr 17, 2024
5e70911
remove 0
PankajBhojwani Apr 17, 2024
ca3eb87
rename and comment
PankajBhojwani Apr 17, 2024
85933e2
midpoint
PankajBhojwani Apr 23, 2024
c134402
about to test stage 1
PankajBhojwani Apr 24, 2024
22ab936
works??
PankajBhojwani Apr 24, 2024
0a3e17e
edge cases
PankajBhojwani Apr 24, 2024
e28d478
some todos for later
PankajBhojwani Apr 24, 2024
f425746
remove keysmap
PankajBhojwani Apr 24, 2024
d0938e2
ugly way to make sure we fixup
PankajBhojwani Apr 25, 2024
12a61c5
shows up in sui and all keybindings work
PankajBhojwani Apr 26, 2024
f1633e0
overwritten IDs and overwritten keychords show up properly in the SUI
PankajBhojwani Apr 26, 2024
ddfac90
Merge branch 'main' of https://github.com/microsoft/terminal into dev…
PankajBhojwani Apr 26, 2024
3e7ab38
sui works?
PankajBhojwani Apr 26, 2024
ae16a5e
started stage 3
PankajBhojwani Apr 26, 2024
dc874c3
rename to special/standard
PankajBhojwani Apr 27, 2024
936afd6
_getactionbyid no longer returns optional
PankajBhojwani Apr 27, 2024
b3e9c26
remove check for invalid
PankajBhojwani Apr 27, 2024
5a1b822
reimplement populating all known keybindings
PankajBhojwani Apr 30, 2024
c51558f
unmark these
PankajBhojwani Apr 30, 2024
754bf04
mark gh todo
PankajBhojwani Apr 30, 2024
2f1d8d2
update defaults
PankajBhojwani Apr 30, 2024
2b4aeb2
don't check for special in standard
PankajBhojwani Apr 30, 2024
e62dfa2
some comments
PankajBhojwani Apr 30, 2024
e725f1e
resolve conflict
PankajBhojwani Apr 30, 2024
db00b90
spelling things
PankajBhojwani Apr 30, 2024
3d92f27
format
PankajBhojwani Apr 30, 2024
428821b
remove _idwasgenerated
PankajBhojwani Apr 30, 2024
6437b9f
fix user defaults file
PankajBhojwani Apr 30, 2024
4c744e6
misc
PankajBhojwani Apr 30, 2024
ca4015f
only one tojson
PankajBhojwani Apr 30, 2024
45cfcd6
just add duplicate pane auto to defaults
PankajBhojwani Apr 30, 2024
3c6015d
remove _getcumulativeactions
PankajBhojwani Apr 30, 2024
c2c75c8
bandaid temporary fix for name
PankajBhojwani May 1, 2024
3e601f5
better if
PankajBhojwani May 1, 2024
cdb907d
mark todo
PankajBhojwani May 1, 2024
f35bf20
Merge branch 'main' of https://github.com/microsoft/terminal into dev…
PankajBhojwani May 1, 2024
2b16acd
check for name, fix some tests
PankajBhojwani May 1, 2024
193e573
fix remaining tests
PankajBhojwani May 2, 2024
0480d65
this is better
PankajBhojwani May 2, 2024
02a1e37
correct GH todo
PankajBhojwani May 2, 2024
80fc299
some new tests
PankajBhojwani May 3, 2024
ebc03e9
another test
PankajBhojwani May 3, 2024
ccf1cc9
nits
PankajBhojwani May 3, 2024
7793c5c
schema
PankajBhojwani May 3, 2024
abef25d
move this to header
PankajBhojwani May 3, 2024
4d35c14
schema conflict
PankajBhojwani May 3, 2024
3e31bda
generate here instead
PankajBhojwani May 6, 2024
14d83b5
delete user actions that are identical to inbox actions
PankajBhojwani May 6, 2024
5e48a45
update add action
PankajBhojwani May 7, 2024
ba375ec
remove keys from command
PankajBhojwani May 8, 2024
7d00b25
spelling
PankajBhojwani May 8, 2024
d4d216c
don't need helper anymore
PankajBhojwani May 8, 2024
40b4aa2
works
PankajBhojwani May 16, 2024
51528e9
spaces
PankajBhojwani May 16, 2024
6c6dd46
leonard comments
PankajBhojwani May 20, 2024
b88a8c5
eraseif
PankajBhojwani May 30, 2024
0dff336
nits, schema
PankajBhojwani May 31, 2024
9703815
nits n fixes
PankajBhojwani May 31, 2024
a80316d
1 more test
PankajBhojwani May 31, 2024
625753c
x86 hash
PankajBhojwani Jun 1, 2024
406312f
fix loops
PankajBhojwani Jun 1, 2024
253dedf
conflict
PankajBhojwani Jun 3, 2024
5a00d5f
nits and changes
PankajBhojwani Jun 3, 2024
96d8d1f
Merge branch 'main' of https://github.com/microsoft/terminal into dev…
PankajBhojwani Jun 4, 2024
327858b
Merge branch 'dev/pabhoj/action_refactor' into dev/pabhoj/command_keys
PankajBhojwani Jun 4, 2024
258c6eb
O(1), rename maps for clarity
PankajBhojwani Jun 4, 2024
6ea25e4
ID
PankajBhojwani Jun 4, 2024
589a1e0
IDTo
PankajBhojwani Jun 4, 2024
0f7e9f3
fixes
PankajBhojwani Jun 4, 2024
cc837b6
fix test
PankajBhojwani Jun 4, 2024
ab65ecb
Merge branch 'dev/pabhoj/command_keys' into dev/pabhoj/action_new_tab…
PankajBhojwani Jun 4, 2024
be82311
Merge branch 'main' of https://github.com/microsoft/terminal into dev…
PankajBhojwani Jun 6, 2024
8eae677
Merge branch 'dev/pabhoj/command_keys' into dev/pabhoj/action_new_tab…
PankajBhojwani Jun 6, 2024
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
Prev Previous commit
Next Next commit
sui works?
PankajBhojwani committed Apr 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 3e7ab3861a29bc3e063ccabd25c37e2fea41f256
27 changes: 4 additions & 23 deletions src/cascadia/TerminalSettingsModel/ActionMap.cpp
Original file line number Diff line number Diff line change
@@ -151,7 +151,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
{
// todo: stage 2 (done)
// todo: stage 3 - can we update RegisterShortcutAction to use new IDs instead of InternalActionID?
// then we'll be able to update _PopulateAvailableACtionsWithStandardCommands with new IDs too
// then we'll be able to update _PopulateAvailableActionsWithStandardCommands with new IDs too
// the problem is that we need IDs for every ShortcutAction, even if it is not in defaults/user settings
if (!_AvailableActionsCache)
{
@@ -164,7 +164,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
#define ON_ALL_ACTIONS(action) RegisterShortcutAction(ShortcutAction::action, availableActions, visitedActionIDs);
ALL_SHORTCUT_ACTIONS
#undef ON_ALL_ACTIONS

_AvailableActionsCache = single_threaded_map(std::move(availableActions));
}
if (!_AvailableActionsCache2)
@@ -178,7 +177,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
#define ON_ALL_ACTIONS(action) RegisterShortcutAction(ShortcutAction::action, availableActions2, visitedActionIDs2);
ALL_SHORTCUT_ACTIONS
#undef ON_ALL_ACTIONS

_AvailableActionsCache2 = single_threaded_map(std::move(availableActions2));
}
return _AvailableActionsCache2.GetView();
@@ -1280,25 +1278,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
return nullptr;
}

bool ActionMap::GenerateIDsForActions()
{
bool fixedUp{ false };
for (auto actionPair : _ActionMap)
{
auto cmdImpl{ winrt::get_self<Command>(actionPair.second) };

// Note: this function should ONLY be called for the action map in the user's settings file
// this debug assert should verify that for debug builds
assert(cmdImpl->Origin() == OriginTag::User);

if (cmdImpl->ID().empty())
{
fixedUp = cmdImpl->GenerateID() || fixedUp;
}
}
return fixedUp;
}

// Method Description:
// - Retrieves the key chord for the provided action
// Arguments:
@@ -1385,6 +1364,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// REPLACE oldKeys with newKeys
// - keybinding only exists in parent layer
// ADD newKeys to our map
// ADD oldKeys to our map, unbound
if (auto oldKeyPair = _KeyMap2.find(oldKeys); oldKeyPair != _KeyMap2.end())
{
// oldKeys is bound in our layer, replace it with newKeys
@@ -1393,8 +1373,9 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
}
else
{
// oldKeys is bound in some other layer, just set newKeys in this layer
// oldKeys is bound in some other layer, set newKeys to cmd in this layer, and oldKeys to unbound in this layer
_KeyMap2.insert_or_assign(newKeys, cmd.ID());
_KeyMap2.insert_or_assign(oldKeys, L"");
}

// make sure to update the Command with these changes