diff --git a/packages/kanban/src/components/KanbanRow.svelte b/packages/kanban/src/components/KanbanRow.svelte index 40a750fa08..d6766fefaf 100644 --- a/packages/kanban/src/components/KanbanRow.svelte +++ b/packages/kanban/src/components/KanbanRow.svelte @@ -57,18 +57,22 @@ let limitedObjects: DocWithRank[] = [] let loading = false + let loadingTimeout: any | undefined = undefined - function nop (op: () => void, timeout: number) { - op() - } - - $: { - loading = true - ;(limitedObjects.length > 0 ? nop : setTimeout)(() => { + function update (stateObjects: Item[], limit: number | undefined, index: number): void { + clearTimeout(loadingTimeout) + if (limitedObjects.length > 0 || index * 2 === 0) { limitedObjects = stateObjects.slice(0, limit) - loading = false - }, index * 2) + } else { + loading = true + loadingTimeout = setTimeout(() => { + limitedObjects = stateObjects.slice(0, limit) + loading = false + }, index * 2) + } } + + $: update(stateObjects, limit, index) {#each limitedObjects as object, i (object._id)} diff --git a/packages/presentation/src/components/MessageBox.svelte b/packages/presentation/src/components/MessageBox.svelte index 753fed0024..f46919033d 100644 --- a/packages/presentation/src/components/MessageBox.svelte +++ b/packages/presentation/src/components/MessageBox.svelte @@ -14,8 +14,8 @@ --> + +
{/if}
@@ -183,9 +215,8 @@ &.gradient::before { background: linear-gradient( 90deg, - rgba(var(--list-header-rgb-color), 0.5), - rgba(var(--list-header-rgb-color), 0.3), - rgba(var(--list-header-rgb-color), 0.1) + rgba(var(--list-header-rgb-color), 0.15), + rgba(var(--list-header-rgb-color), 0.05) ); } &::before, diff --git a/plugins/view-resources/src/selection.ts b/plugins/view-resources/src/selection.ts index 98db2269cb..c8f907153c 100644 --- a/plugins/view-resources/src/selection.ts +++ b/plugins/view-resources/src/selection.ts @@ -1,7 +1,7 @@ import { Doc } from '@hcengineering/core' import { panelstore } from '@hcengineering/ui' import { onDestroy } from 'svelte' -import { Unsubscriber, writable } from 'svelte/store' +import { Unsubscriber, derived, writable } from 'svelte/store' /** * @public @@ -50,8 +50,17 @@ export interface FocusSelection { * @public */ export const focusStore = writable({}) + +/** + * @public + */ export const selectionStore = writable([]) +/** + * @public + */ +export const selectionStoreMap = derived(selectionStore, (it) => new Set(it.map((it) => it._id))) + export const previewDocument = writable() panelstore.subscribe((val) => { @@ -61,6 +70,10 @@ panelstore.subscribe((val) => { * @public */ export function updateFocus (selection?: FocusSelection): void { + if (!window.document.hasFocus()) { + window.focus() + } + focusStore.update((cur) => { const now = Date.now()