-
Notifications
You must be signed in to change notification settings - Fork 150
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
Command center and migrations #479
Merged
Merged
Changes from all commits
Commits
Show all changes
143 commits
Select commit
Hold shift + click to select a range
fc2932b
feat: command center POC
TGlide a7c53ae
feat: multi key commands
TGlide afcbb5d
refactor: one-liner registers
TGlide 05d9cb7
refactor: cleaner registerCommand fn
TGlide 41ce56e
fix: onboarding missing shortcus
TGlide bf77043
fix: disabling commands
TGlide adbd2c7
fix: command key order
TGlide 46c7a26
refactor: disable commands on input elements
TGlide ea8a924
feat: cmd center animation
TGlide 6874ab2
feat: more command center animations
TGlide d01c078
refactor: command center positioning
TGlide 7de0a21
refactor: animation changes
TGlide 142e89a
fix: enter bug
TGlide dce2d82
Merge branch 'command-center-poc' of https://github.com/appwrite/cons…
TGlide 7badf3a
refactor: improve commands
TGlide 318d72d
refactor: rename fn
TGlide de42801
feat(wip): ai command panel
TGlide 411fa32
feat(wip): ask ai
TGlide ca7c9c0
feat: ai panel
TGlide ba27b42
feat: migrations screen
TGlide 5069ee2
feat: initial migrations page
TGlide 0a74fd9
feat: migrations wizard structure
TGlide 920c65f
feat: migrations select data form
TGlide 47d51eb
feat: more mocked ui
TGlide 9cb611b
chore: small changes
TGlide 6ac6c6a
feat: migrations sdk impl
TGlide 29d5826
refactor: failed status
TGlide 7a18b76
feat: export data modal
TGlide 1ca164b
feat: supabase and nhost forms
TGlide 9382eff
refactor: command center styles
TGlide 92032f5
fix: ai
TGlide 5256a13
refactor: small changes
TGlide 09df201
feat: grouped options
TGlide 1ee4daf
feat: basic search functionality
TGlide bd3c086
feat: improve search
TGlide 7a6a44d
Update imports
PineappleIOnic f32e1d5
refactor: migrations
TGlide 2bfd693
feat: command center icons
TGlide 21de81d
refactor: details modal & self-hosted screens
TGlide 59ccdf8
Merge branch 'migrations' into migrations-bradley
PineappleIOnic 1daa098
refactor: vercel ai sdk
TGlide e7c9eab
command center styling
TGlide 60591cc
Implement new SDK Methods and Reporting
PineappleIOnic 0bbd82e
feat: AI restyling and examples
TGlide 1c0b050
fix: command center styles
TGlide f977fab
force redeploy
TGlide e91ef41
pnpm fixes everything
TGlide 1a9207d
refactor: change installCommand
TGlide b4c1516
back to npm
TGlide cf21609
fix: ai streaming
TGlide e6363ec
feat: find projects command
TGlide e983413
feat: streamed projects
TGlide dd0bc31
refactor: minor cmdCenter changes
TGlide 89255a1
feat: basic command prioritization
TGlide 79feb7d
refactor: improve command ranking algorithm
TGlide edea04c
refactor: further improve cmd ranking
TGlide 7d4009f
command center debug
TGlide 311d5c8
feat: working migrations & details
TGlide c8e9da2
mock deploy to cloud & self-hosted
TGlide aef914d
add commands & fix command kbd selection
TGlide 1957154
feat: ranked groups and options
TGlide 4238efe
refactor: improve group ranking functionality
TGlide cb20d7a
Merge branch 'migrations-t' into command-center-and-migrations
TGlide 11dd905
migrations stuff
TGlide 13e972d
more commands
TGlide d02fd1c
add search icon
TGlide 09a9be3
feat: basic export data modal functionality
TGlide 23cb171
refactor: migration export
TGlide cd193f2
fix: progress color & loader
TGlide 40396d2
feat: mocked deploy to cloud
TGlide 08f0202
feat: deploy to cloud & export to self-hosted
TGlide a4fddd6
remove key debug on input events
TGlide 575dcf2
feat: add auth commands
TGlide 248fbb6
reactive details
TGlide 5535d43
fix details
TGlide 9de3158
refactor: small changes
TGlide e11b177
ai examples kbd nav
TGlide 297974f
storage commands
TGlide 597ae77
add password inputs
TGlide cfd815d
fix: supabase & nhost formdata
TGlide b9c4393
fix deploy
TGlide 7c03f05
feat: user searcher
TGlide ece145d
feat: more searchers
TGlide 791f55f
nested commands
TGlide 2e13a56
fix: modifier keys triggering non modifier commands
TGlide 9a31ce8
more searchers & commands
TGlide 10acb77
more commands
TGlide 1fb3a01
db commands
TGlide 14051cc
more commands & searchers & version check
TGlide c76a61e
feat: import from org settings
TGlide fe90912
fix: report
TGlide f0961b4
feat: firebase migrations wip
TGlide 8c4825f
commands & migrations fixes
TGlide 41102e6
function commands
TGlide e45823f
function commands
TGlide 92d3baf
more fn commands & icons
TGlide 0b21fe4
storage commands
TGlide 1fdd2fc
add light theme
TGlide 263e328
basic db selection
TGlide 92af191
bulk db deletion
TGlide cee7726
nanoid instead of cyrpto.randomUUID
TGlide d0693ad
Merge branch 'command-center-and-migrations' into bulk-deletion
TGlide 382b473
collection deletion
TGlide 5d2aace
Start work on firebase OAuth
PineappleIOnic f922cc1
Update sdk.ts
PineappleIOnic 274e110
Add stage 2 of Firebase OAuth
PineappleIOnic 8d8d690
feat: document bulk deletion
TGlide d32bfc5
Update step1.svelte
PineappleIOnic ea2ae81
small changes
TGlide 57d5541
Merge branch 'command-center-and-migrations' into filtering
TGlide ccc9a72
basic styling
TGlide 42c8e91
basic filter add & theme command
TGlide 836a3b0
firebase oauth changes
TGlide 58f652f
Add 401 catch to firebaseProjects
PineappleIOnic 2664b54
working filtering
TGlide 545a256
add more filters
TGlide 6cb932b
basic query param save data
TGlide d437f64
improve filtering
TGlide deb173a
sentence case commands
TGlide 29924a2
Update API's
PineappleIOnic 1c8d520
pr changes
TGlide e8f73d5
Merge branch 'command-center-and-migrations' of https://github.com/ap…
TGlide 1a9a61d
Merge branch 'main' into command-center-and-migrations
TGlide f9c9b19
disable cmd center on wizards and modals
TGlide 8b6ae78
Merge branch 'command-center-and-migrations' of https://github.com/ap…
TGlide 1cfe0e3
address pr reviews
TGlide 68f8fe7
Merge branch 'command-center-and-migrations' into bulk-deletion
TGlide d5e26ca
fix multiple selection checkbox
TGlide c8b6048
tableCellHeadCheck cmp
TGlide 87a4ef3
refactor: pr changes
TGlide bf9617e
small changes
TGlide 1c38e70
Update src/routes/console/project-[project]/databases/database-[datab…
TGlide 5d4d2ff
review changes
TGlide 3164453
add command tracking
TGlide 98143ef
Merge pull request #485 from appwrite/bulk-deletion
christyjacob4 6d9a528
filtering mobile
TGlide dd44289
Merge branch 'bulk-deletion' into filtering
TGlide 35a74b2
Merge pull request #490 from appwrite/filtering
christyjacob4 6cb9333
Merge pull request #497 from appwrite/bulk-deletion
TGlide 5d5f6a0
file changes
TGlide d64b9cd
Merge branch 'main' into command-center-and-migrations
TGlide af6480a
small changes
TGlide e674fe3
Merge branch 1.4.x into command-center-and-migrations
TGlide File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ node_modules | |
node_modules/ | ||
dist/ | ||
.vercel | ||
|
||
*.swp |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { tick } from 'svelte'; | ||
import type { Action } from 'svelte/action'; | ||
|
||
export type PortalConfig = string | HTMLElement | undefined; | ||
|
||
export const portal: Action<HTMLElement, PortalConfig> = (el, target = 'body') => { | ||
let targetEl; | ||
|
||
async function update(newTarget: PortalConfig) { | ||
target = newTarget; | ||
if (typeof target === 'string') { | ||
targetEl = document.querySelector(target); | ||
if (targetEl === null) { | ||
await tick(); | ||
targetEl = document.querySelector(target); | ||
} | ||
if (targetEl === null) { | ||
throw new Error(`No element found matching css selector: "${target}"`); | ||
} | ||
} else if (target instanceof HTMLElement) { | ||
targetEl = target; | ||
} else { | ||
throw new TypeError( | ||
`Unknown portal target type: ${ | ||
target === null ? 'null' : typeof target | ||
}. Allowed types: string (CSS selector) or HTMLElement.` | ||
); | ||
} | ||
targetEl.appendChild(el); | ||
el.hidden = false; | ||
} | ||
|
||
function destroy() { | ||
el.remove(); | ||
} | ||
|
||
update(target); | ||
return { | ||
update, | ||
destroy | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<script lang="ts" context="module"> | ||
type Context = Readable<{ | ||
isInitialPanel: boolean; | ||
open: boolean; | ||
}>; | ||
type ReadableValue<T> = T extends Readable<infer U> ? U : never; | ||
|
||
const contextKey = 'command-center'; | ||
export const getCommandCenterCtx = () => getContext<Context>(contextKey); | ||
const setCommandCenterCtx = (value: ReadableValue<Context>) => { | ||
const store = writable(value); | ||
setContext(contextKey, store); | ||
return store; | ||
}; | ||
|
||
export const toggleCommandCenter = () => { | ||
if (get(subPanels).length > 0) { | ||
clearSubPanels(); | ||
} else { | ||
addSubPanel(RootPanel); | ||
} | ||
}; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import { dev } from '$app/environment'; | ||
import { portal } from '$lib/actions/portal'; | ||
import { last } from '$lib/helpers/array'; | ||
import { debounce } from '$lib/helpers/debounce'; | ||
import { getContext, setContext } from 'svelte'; | ||
import { get, writable, type Readable } from 'svelte/store'; | ||
import { fade } from 'svelte/transition'; | ||
import { commandCenterKeyDownHandler, disableCommands, registerCommands } from './commands'; | ||
import { RootPanel } from './panels'; | ||
import { addSubPanel, clearSubPanels, subPanels } from './subPanels'; | ||
|
||
$: $registerCommands([ | ||
{ | ||
callback: toggleCommandCenter, | ||
keys: ['k'], | ||
ctrl: true, | ||
forceEnable: true | ||
} | ||
]); | ||
|
||
$: openSubPanel = last($subPanels) ?? null; | ||
$: $disableCommands(!!openSubPanel); | ||
|
||
$: if (openSubPanel) { | ||
document.documentElement.classList.add('u-overflow-hidden'); | ||
} else { | ||
document.documentElement.classList.remove('u-overflow-hidden'); | ||
} | ||
|
||
let dialog: HTMLDivElement; | ||
|
||
function handleBlur(event: MouseEvent) { | ||
if (event.target === dialog) { | ||
clearSubPanels(); | ||
} | ||
} | ||
|
||
const ctx = setCommandCenterCtx({ | ||
isInitialPanel: true, | ||
open: false | ||
}); | ||
|
||
$: if (!openSubPanel) { | ||
$ctx.isInitialPanel = true; | ||
} | ||
$: $subPanels.length > 1 && ($ctx.isInitialPanel = false); | ||
|
||
$: $ctx.open = !!openSubPanel; | ||
|
||
let keys: string[] = []; | ||
|
||
const resetKeys = debounce(() => { | ||
keys = []; | ||
}, 1000); | ||
|
||
function isInputEvent(event: KeyboardEvent) { | ||
return ['INPUT', 'TEXTAREA', 'SELECT'].includes((event.target as HTMLElement).tagName); | ||
} | ||
|
||
const handleKeydown = (e) => { | ||
if (!$subPanels.length) { | ||
if (isInputEvent(e)) return; | ||
keys = [...keys, e.key].slice(-10); | ||
resetKeys(); | ||
} | ||
$commandCenterKeyDownHandler(e); | ||
}; | ||
</script> | ||
|
||
<svelte:window on:mousedown={handleBlur} on:keydown={handleKeydown} /> | ||
|
||
{#if openSubPanel} | ||
<div class="dialog" bind:this={dialog} transition:fade={{ duration: 100 }}> | ||
<svelte:component this={openSubPanel.component} /> | ||
</div> | ||
{/if} | ||
|
||
{#if dev} | ||
<div class="debug-keys" use:portal> | ||
{#each keys as key, i (i)} | ||
<kbd class="kbd" transition:fade|local={{ duration: 150 }}> | ||
{key.length === 1 ? key.toUpperCase() : key} | ||
</kbd> | ||
{/each} | ||
</div> | ||
{/if} | ||
|
||
<style lang="scss"> | ||
.dialog { | ||
padding: 0.5rem; | ||
position: fixed; | ||
inset: 0; | ||
|
||
background-color: hsl(var(--color-neutral-500) / 0.5); | ||
z-index: 9999; | ||
} | ||
|
||
.debug-keys { | ||
position: fixed; | ||
bottom: 10%; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
padding: 0.5rem; | ||
// background-color: hsl(var(--color-neutral-500) / 0.5); | ||
z-index: 9999; | ||
|
||
display: flex; | ||
gap: 1rem; | ||
|
||
font-size: 2rem; | ||
|
||
.kbd { | ||
padding-inline: 0.5rem; | ||
padding-block: 1.5rem; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we typically put all these
$:
at the end?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily, as the order of where they are matters (Svelte uses static code analysis to determine how to execute the code, so we can't be super liberal with this: https://svelte.dev/docs/svelte-components#script-3-$-marks-a-statement-as-reactive)