diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreSection.java b/app/src/main/java/io/xpipe/app/comp/store/StoreSection.java index b2527bf91..1e7875f72 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreSection.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreSection.java @@ -163,10 +163,10 @@ public class StoreSection { var allChildren = all.filtered( other -> { // Legacy implementation that does not use children caches. Use for testing - // if (true) return DataStorage.get() - // .getDisplayParent(other.getEntry()) - // .map(found -> found.equals(e.getEntry())) - // .orElse(false); +// if (true) return DataStorage.get() +// .getDefaultDisplayParent(other.getEntry()) +// .map(found -> found.equals(e.getEntry())) +// .orElse(false); // is children. This check is fast as the children are cached in the storage return DataStorage.get().getStoreChildren(e.getEntry()).contains(other.getEntry()) diff --git a/app/src/main/java/io/xpipe/app/ext/ScanProvider.java b/app/src/main/java/io/xpipe/app/ext/ScanProvider.java index 3ed8260f4..965f1147e 100644 --- a/app/src/main/java/io/xpipe/app/ext/ScanProvider.java +++ b/app/src/main/java/io/xpipe/app/ext/ScanProvider.java @@ -2,10 +2,8 @@ package io.xpipe.app.ext; import io.xpipe.app.storage.DataStoreEntry; import io.xpipe.core.process.ShellControl; -import io.xpipe.core.store.DataStore; import io.xpipe.core.util.FailableRunnable; import io.xpipe.core.util.ModuleLayerLoader; - import lombok.AllArgsConstructor; import lombok.Value; @@ -22,10 +20,6 @@ public abstract class ScanProvider { return ALL; } - public ScanOperation create(DataStore store) { - return null; - } - public ScanOperation create(DataStoreEntry entry, ShellControl sc) throws Exception { return null; } diff --git a/app/src/main/java/io/xpipe/app/fxcomps/impl/FilterComp.java b/app/src/main/java/io/xpipe/app/fxcomps/impl/FilterComp.java index a6a2db1f1..8a131e0f2 100644 --- a/app/src/main/java/io/xpipe/app/fxcomps/impl/FilterComp.java +++ b/app/src/main/java/io/xpipe/app/fxcomps/impl/FilterComp.java @@ -10,6 +10,9 @@ import io.xpipe.app.fxcomps.util.PlatformThread; import javafx.beans.binding.Bindings; import javafx.beans.property.Property; import javafx.scene.Cursor; +import javafx.scene.input.KeyCode; +import javafx.scene.input.KeyCodeCombination; +import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseButton; import atlantafx.base.controls.CustomTextField; @@ -53,6 +56,13 @@ public class FilterComp extends Comp> { filter.focusedProperty())); filter.setAccessibleText("Filter"); + filter.addEventFilter(KeyEvent.KEY_PRESSED,event -> { + if (new KeyCodeCombination(KeyCode.ESCAPE).match(event)) { + filter.getScene().getRoot().requestFocus(); + event.consume(); + } + }); + filterText.subscribe(val -> { PlatformThread.runLaterIfNeeded(() -> { clear.setVisible(val != null); diff --git a/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java b/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java index 97c32e6e7..9e108efcf 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java @@ -157,7 +157,7 @@ public class DataStoreEntry extends StorageElement { null, uuid, categoryUuid, - name, + name.trim(), Instant.now(), Instant.now(), storeFromNode, @@ -194,7 +194,7 @@ public class DataStoreEntry extends StorageElement { var categoryUuid = Optional.ofNullable(json.get("categoryUuid")) .map(jsonNode -> UUID.fromString(jsonNode.textValue())) .orElse(DataStorage.DEFAULT_CATEGORY_UUID); - var name = json.required("name").textValue(); + var name = json.required("name").textValue().trim(); var persistentState = stateJson.get("persistentState"); var lastUsed = Optional.ofNullable(stateJson.get("lastUsed")) diff --git a/app/src/main/java/io/xpipe/app/util/ScanAlert.java b/app/src/main/java/io/xpipe/app/util/ScanAlert.java index ef148f383..ddd0379e4 100644 --- a/app/src/main/java/io/xpipe/app/util/ScanAlert.java +++ b/app/src/main/java/io/xpipe/app/util/ScanAlert.java @@ -40,7 +40,7 @@ public class ScanAlert { }); } - private static void showForShellStore(DataStoreEntry initial) { + public static void showForShellStore(DataStoreEntry initial) { show(initial, (DataStoreEntry entry, ShellControl sc) -> { if (!sc.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) { return null; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/action/ScanStoreAction.java b/ext/base/src/main/java/io/xpipe/ext/base/action/ScanStoreAction.java index 7064ff551..a236f930c 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/action/ScanStoreAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/action/ScanStoreAction.java @@ -7,9 +7,7 @@ import io.xpipe.app.storage.DataStoreEntryRef; import io.xpipe.app.util.ScanAlert; import io.xpipe.core.process.ShellStoreState; import io.xpipe.core.store.ShellStore; - import javafx.beans.value.ObservableValue; - import lombok.Value; public class ScanStoreAction implements ActionProvider { @@ -67,7 +65,9 @@ public class ScanStoreAction implements ActionProvider { @Override public void execute() { - ScanAlert.showAsync(entry); + if (entry == null || entry.getStore() instanceof ShellStore) { + ScanAlert.showForShellStore(entry); + } } } }