Skip to content

[6.x] Command Palette (Part 1) #11699

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

Merged
merged 79 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
77e552a
Add `Category` enum.
jesseleite Mar 23, 2025
3b462da
Implement base `Command`.
jesseleite Mar 23, 2025
e679ea1
Implement `Link` command type (ie. for ‘Navigation’ items).
jesseleite Mar 23, 2025
cac82d5
Implement `Palette` builder.
jesseleite Mar 23, 2025
7418338
Register `CommandPalette` facade.
jesseleite Mar 23, 2025
ac09518
Test basic `Navigation` commands are built for JS component.
jesseleite Mar 23, 2025
8fcba2b
Data composer, so that command palette data is available in main CP l…
jesseleite Mar 23, 2025
40a97a9
Dummy partial for now until vue.
jesseleite Mar 23, 2025
44b4e29
Merge branch 'master' of https://github.com/statamic/cms into command…
jesseleite Mar 23, 2025
bda1870
Simplify/remove `Nav::buildWithoutPreferences()` method. Just use `bu…
jesseleite Mar 24, 2025
1657daf
Allow nav builder to add its items to command palette using facade API.
jesseleite Mar 24, 2025
7c71621
Todo.
jesseleite Mar 24, 2025
1e094fe
Pass these tests again.
jesseleite Mar 24, 2025
7a71068
Merge branch 'master' of https://github.com/statamic/cms into command…
jesseleite Mar 24, 2025
07a584d
Merge branch 'master' of https://github.com/statamic/cms into command…
jesseleite Apr 3, 2025
db48311
Build Collection.
jesseleite Apr 4, 2025
d3ab51d
Component.
jesseleite Apr 4, 2025
07376be
Improve nav link transformation.
jesseleite Apr 4, 2025
921bf04
Fuzzysort example.
jesseleite Apr 4, 2025
ea3226f
Composition.
jesseleite Apr 4, 2025
153f042
Reka Combobox proof of concept.
jesseleite Apr 5, 2025
d1292b8
Merge branch 'ui' of https://github.com/statamic/cms into command-pal…
jesseleite Apr 5, 2025
3518f8d
Delete initial prototype.
jesseleite Apr 5, 2025
cc351d2
Delete blade view partial.
jesseleite Apr 5, 2025
d924be4
Ditch view composer in favour of ajax on mount.
jesseleite Apr 5, 2025
739a27c
Make icon configurable.
jesseleite Apr 5, 2025
633e492
Use nicer arrow in nav link items.
jesseleite Apr 5, 2025
be9377e
Delete reka prototype.
jesseleite Apr 5, 2025
862bbb9
Self.
jesseleite Apr 5, 2025
ce79411
Wire up reka combobox to Jack’s UI 😎
jesseleite Apr 5, 2025
1da0e0b
Make keys configurable (wip).
jesseleite Apr 5, 2025
064de34
Update reka.
jesseleite Apr 7, 2025
ce0fdd6
Treat dialog as modal.
jesseleite Apr 7, 2025
1b4a923
Close palette on select.
jesseleite Apr 7, 2025
8e8d098
Wire up `ctrl+n/p` for vim users.
jesseleite Apr 7, 2025
7de155f
Fix / make `esc` close outer dialog modal.
jesseleite Apr 7, 2025
6fafe1b
Reset state on close.
jesseleite Apr 7, 2025
f4d1e96
Merge old global search behaviour into command palette.
jesseleite Apr 7, 2025
ddf65dc
Yeet old `GlobalSearch` component.
jesseleite Apr 7, 2025
b6c8134
Move test.
jesseleite Apr 7, 2025
fb75923
Add iconCache to fix CommandPalette flickering
jackmcdade Apr 8, 2025
b1c1adc
Preloading is handled nicely in `ui/Icon` now 🤘
jesseleite Apr 8, 2025
7abe5ad
Merge branch 'ui' of https://github.com/statamic/cms into command-pal…
jesseleite Apr 8, 2025
d2f9397
These are handled dynamically by integrated content search.
jesseleite Apr 8, 2025
d624808
New routes.
jesseleite Apr 8, 2025
afc0ab8
Move this logic into `CommandPaletteController`.
jesseleite Apr 8, 2025
01aedfd
Get initial data via ajax.
jesseleite Apr 8, 2025
5de77a6
Wire up link types.
jesseleite Apr 8, 2025
35c6950
Todo.
jesseleite Apr 8, 2025
1bdbfd2
Move command palette components out of `ui` namespace.
jesseleite Apr 9, 2025
e1dc124
Not needed?
jesseleite Apr 9, 2025
25c5cf1
Restore `data-` attribute, but without `ui` namespace.
jesseleite Apr 9, 2025
6f016fe
Merge branch 'ui' of https://github.com/statamic/cms into command-pal…
jesseleite Apr 11, 2025
8f6c085
Merge branch 'ui' of https://github.com/statamic/cms into command-pal…
jesseleite Apr 14, 2025
db760a5
Remove hardcoded actions stuff, moving this to next PR.
jesseleite Apr 14, 2025
35ad0f7
Match indentation.
jesseleite Apr 14, 2025
6bbaa9b
Merge branch 'ui' of https://github.com/statamic/cms into command-pal…
jesseleite Apr 14, 2025
d06c904
Merge branch 'ui' of https://github.com/statamic/cms into command-pal…
jesseleite Apr 14, 2025
2080fac
Doesn't need to be global component.
jesseleite Apr 14, 2025
6450e8f
wip
jasonvarga Apr 14, 2025
9ebe42c
Only ever build commands when ajaxing for them (will cache and bust l…
jesseleite Apr 14, 2025
190c243
Build nav item children in command palette (ie. articles, pages, etc.)
jesseleite Apr 14, 2025
62506b4
Fix order to match what user sees in side nav.
jesseleite Apr 14, 2025
9f6ba67
Make `$keys` available (for DJ Khaled).
jesseleite Apr 14, 2025
8071635
Use `Statamic.$keys`.
jesseleite Apr 14, 2025
c7c45ca
We're not using this.
jesseleite Apr 14, 2025
5051559
This wasn't being used. Do we bring back on ui branch, Jack?
jesseleite Apr 14, 2025
5c168f3
Wire up navigation icons in palette.
jesseleite Apr 14, 2025
b1f657b
Use backed enum.
jesseleite Apr 14, 2025
2146f4a
Add `ContentSearchResult` command type.
jesseleite Apr 14, 2025
9682af9
Use new `ContentSearchResult`.
jesseleite Apr 14, 2025
9494162
Don’t need to massage data response on JS side anymore.
jesseleite Apr 14, 2025
cfd03d1
Pass category order down from enum.
jesseleite Apr 14, 2025
e9139d2
This sort is not needed anymore.
jesseleite Apr 15, 2025
e457ddf
Simplify aggregation logic.
jesseleite Apr 15, 2025
fb22087
Pre-selection workaround.
jesseleite Apr 15, 2025
8ed1ee9
Actual fix for pre-selection and icon flicker.
jesseleite Apr 15, 2025
4c5f584
pint
jasonvarga Apr 15, 2025
c579c43
leave this, it might be getting used as reference
jasonvarga Apr 15, 2025
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
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"svgo": "svgo -f ./resources/svg/ -r",
"test": "vitest run",
"test-watch": "npm run test -- --watch --notify",
"frontend-dev": "vite build -c vite-frontend.config.js --watch",
"frontend-dev": "vite -c vite-frontend.config.js",
"frontend-build": "vite build -c vite-frontend.config.js",
"prettier:format": "prettier --write \"**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts,vue,blade.php,antlers.html,css}\"",
"prettier:check": "prettier --check \"**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts,vue,blade.php,antlers.html,css}\"",
Expand Down Expand Up @@ -63,6 +63,7 @@
"cva": "^1.0.0-beta.3",
"floating-vue": "^5.2.2",
"fuse.js": "^7.0.0",
"fuzzysort": "^3.1.0",
"highlight.js": "^11.7.0",
"laravel-echo": "^1.16.0",
"lodash-es": "^4.17.21",
Expand Down
113 changes: 0 additions & 113 deletions resources/css/components/global-header.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,119 +29,6 @@
}
}

/* Search
========================================================================== */
.global-search {
@apply relative flex hidden items-center rounded-md border px-2 py-0 dark:border-dark-300;
transition: 0.12s ease-out;

.search-input {
@apply w-full max-w-full text-sm dark:bg-dark-600 dark:text-dark-150;
padding-left: 5px;
padding-right: 20px;
[dir='rtl'] & {
padding-left: 20px;
padding-right: 5px;
}
height: 32px;
&:focus {
outline: 0;
}
}

.global-search-results {
@apply absolute w-full rounded-sm border border-gray-500 bg-white p-0 shadow-lg;
@apply dark:border-dark-900 dark:bg-dark-650;
top: 36px;
left: -1px;
[dir='rtl'] & {
left: auto;
right: -1px;
} /* border offset */
z-index: 999;
}

.global-search-loading-indicator {
position: absolute;
right: 8px;
[dir='rtl'] & {
right: auto;
left: 8px;
}
}

.global-search-result-item {
@apply cursor-pointer border-t dark:border-dark-800 dark:bg-dark-600 dark:text-dark-150;

&:first-child {
@apply rounded-t border-none;
}

&:last-child {
@apply rounded-b;
}
}

.global-search-result-badge {
@apply rounded-sm border bg-gray-200 px-1 text-2xs text-gray;
@apply dark:border-dark-700 dark:bg-dark-600 dark:text-dark-100;
}

.active {
@apply bg-gray-300 dark:bg-dark-650;
}

.title {
@apply text-sm font-medium;
}

.url {
@apply text-2xs text-gray-400;
}

.status {
float: right;
[dir='rtl'] & {
float: left;
}
background: #ddd;
border-radius: 2px;
padding: 2px 4px;
}

.icon {
@apply relative cursor-pointer overflow-hidden text-gray dark:text-dark-175;
font-size: 18px;
top: 1px;
width: 20px;
height: 20px;
line-height: 20px;
}

.reset {
font-size: 21px;
left: -3px;
[dir='rtl'] & {
left: auto;
right: -3px;
}
position: relative;
}

kbd {
@apply rounded-sm border px-1 pb-px font-sans text-2xs text-gray-500;
}
}

@media (width >= theme(--breakpoint-lg)) {
.global-search {
@apply flex w-128 max-w-full;
.global-search-results {
@apply w-128;
}
}
}

.site-selector {
.v-select {
@apply h-full;
Expand Down
4 changes: 2 additions & 2 deletions resources/js/bootstrap/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script>
import GlobalSearch from '../components/GlobalSearch.vue';
import GlobalSiteSelector from '../components/GlobalSiteSelector.vue';
import Login from '../components/login/Login.vue';
import BaseEntryCreateForm from '../components/entries/BaseCreateForm.vue';
Expand Down Expand Up @@ -42,12 +41,13 @@ import AssetContainerEditForm from '../components/asset-containers/EditForm.vue'
import Updater from '../components/updater/Updater.vue';
import PortalTargets from '../components/portals/PortalTargets.vue';
import SitesEditForm from '../components/sites/EditForm.vue';
import CommandPalette from '../components/command-palette/CommandPalette.vue';
import { defineAsyncComponent } from 'vue';
import { ConfigProvider } from 'reka-ui';

export default {
components: {
GlobalSearch,
CommandPalette,
GlobalSiteSelector,
Login,
BaseEntryCreateForm,
Expand Down
4 changes: 4 additions & 0 deletions resources/js/bootstrap/statamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export default {
return { defineStore };
},

get $keys() {
return this.$app.config.globalProperties.$keys;
},

get $permissions() {
return this.$app.config.globalProperties.$permissions;
},
Expand Down
205 changes: 0 additions & 205 deletions resources/js/components/GlobalSearch.vue

This file was deleted.

Loading
Loading