diff --git a/src/AppCommon/FileTime.App.Core/Services/UserCommandHandler/NavigationUserCommandHandlerService.cs b/src/AppCommon/FileTime.App.Core/Services/UserCommandHandler/NavigationUserCommandHandlerService.cs index 703bab7..56e582d 100644 --- a/src/AppCommon/FileTime.App.Core/Services/UserCommandHandler/NavigationUserCommandHandlerService.cs +++ b/src/AppCommon/FileTime.App.Core/Services/UserCommandHandler/NavigationUserCommandHandlerService.cs @@ -75,7 +75,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase { var pathInput = new TextInputElement("Path"); await _userCommunicationService.ReadInputs(pathInput); - + //TODO: message on empty result and on null pathInput.Value var resolvedPath = await _timelessContentProvider.GetItemByNativePathAsync(new NativePath(pathInput.Value)); if (resolvedPath is IContainer container) @@ -146,6 +146,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase if (_currentSelectedItem is not IContainerViewModel containerViewModel || containerViewModel.Container is null) return Task.CompletedTask; + _appState.RapidTravelText = ""; _selectedTab?.Tab?.SetCurrentLocation(containerViewModel.Container); return Task.CompletedTask; } @@ -153,7 +154,12 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase private async Task GoUp() { if (_currentLocation?.Parent is not AbsolutePath parentPath || - await parentPath.ResolveAsyncSafe() is not IContainer newContainer) return; + await parentPath.ResolveAsyncSafe() is not IContainer newContainer) + { + return; + } + + _appState.RapidTravelText = ""; _selectedTab?.Tab?.SetCurrentLocation(newContainer); } diff --git a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/KeyboardConfigurationService.cs b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/KeyboardConfigurationService.cs index aa1b744..fb554b4 100644 --- a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/KeyboardConfigurationService.cs +++ b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/KeyboardConfigurationService.cs @@ -1,4 +1,5 @@ using System.Collections.ObjectModel; +using FileTime.App.Core.UserCommand; using FileTime.GuiApp.Configuration; using Microsoft.Extensions.Options; @@ -49,7 +50,12 @@ public class KeyboardConfigurationService : IKeyboardConfigurationService private static bool IsUniversal(CommandBindingConfiguration keyMapping) { - return false; - //return keyMapping.Command is ConfigCommand.GoUp or ConfigCommand.Open or ConfigCommand.OpenOrRun or ConfigCommand.MoveCursorUp or ConfigCommand.MoveCursorDown or ConfigCommand.MoveCursorUpPage or ConfigCommand.MoveCursorDownPage; + return keyMapping.Command is + GoUpCommand.CommandName + or OpenSelectedCommand.CommandName + or MoveCursorDownCommand.CommandName + or MoveCursorDownPageCommand.CommandName + or MoveCursorUpCommand.CommandName + or MoveCursorUpPageCommand.CommandName; } } \ No newline at end of file diff --git a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/RapidTravelModeKeyInputHandler.cs b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/RapidTravelModeKeyInputHandler.cs index e1d0f10..e264a8a 100644 --- a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/RapidTravelModeKeyInputHandler.cs +++ b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/RapidTravelModeKeyInputHandler.cs @@ -15,7 +15,7 @@ namespace FileTime.GuiApp.Services; public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler { private const string RapidTravelFilterName = "rapid_travel_filter"; - + private readonly IAppState _appState; private readonly IModalService _modalService; private readonly IKeyboardConfigurationService _keyboardConfigurationService; @@ -79,7 +79,7 @@ public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler } else { - var currentKeyAsList = new List() {new KeyConfig(key)}; + var currentKeyAsList = new List() { new KeyConfig(key) }; var selectedCommandBinding = _keyboardConfigurationService.UniversalCommandBindings.FirstOrDefault(c => c.Keys.AreKeysEqual(currentKeyAsList)); if (selectedCommandBinding != null) { @@ -91,7 +91,7 @@ public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler if (updateRapidTravelFilter) { if (_selectedTab?.Tab is not ITab tab) return; - + tab.RemoveItemFilter(RapidTravelFilterName); tab.AddItemFilter(new ItemFilter(RapidTravelFilterName, i => i.Name.ToLower().Contains(_appState.RapidTravelText))); /*var currentLocation = await _appState.SelectedTab.CurrentLocation.Container.WithoutVirtualContainer(MainPageViewModel.RAPIDTRAVEL);