aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-05-15 03:16:29 -0700
committerFuwn <[email protected]>2025-05-15 03:16:29 -0700
commit4f0657aa8d12fb4dd075bdd3c947160f823b0ad8 (patch)
tree9870f421ccd5a65d0dfa6f101aa6672c89bef388 /src
parentfeat(CommandPalette): Add nested action support (diff)
downloaddue.moe-4f0657aa8d12fb4dd075bdd3c947160f823b0ad8.tar.xz
due.moe-4f0657aa8d12fb4dd075bdd3c947160f823b0ad8.zip
feat(CommandPalette): Enhanced nested visual indicators
Diffstat (limited to 'src')
-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}`
});
}
});
- }
});
}