aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/CommandPalette/CommandPalette.svelte12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/CommandPalette/CommandPalette.svelte b/src/lib/CommandPalette/CommandPalette.svelte
index d0e015a5..f493bcac 100644
--- a/src/lib/CommandPalette/CommandPalette.svelte
+++ b/src/lib/CommandPalette/CommandPalette.svelte
@@ -28,20 +28,24 @@
items.forEach((action, idx) => {
const actionMatches = doesActionMatch(action);
+ let matchedParent = false;
- if (actionMatches) filtered.push({ ...action, id: `action-${idx}` });
+ if (actionMatches) {
+ filtered.push({ ...action, id: `action-${idx}` });
- if (action.actions) {
+ matchedParent = true;
+ }
+
+ if (action.actions)
action.actions.forEach((nestedAction, nestedIdx) => {
if (doesActionMatch(nestedAction)) {
filtered.push({
...nestedAction,
id: `action-${idx}-nested-${nestedIdx}`,
- name: `↳ ${nestedAction.name}`
+ name: `${matchedParent ? '↳' : `${action.name} >`} ${nestedAction.name}`
});
}
});
- }
});
}