Return spaces to card navigator (#10243)

* Return spaces to card navigator

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>

* Fix formatting

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>

---------

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2025-11-25 00:38:53 +07:00
committed by GitHub
parent ef3b90fcaa
commit 05a388fd08
6 changed files with 41 additions and 30 deletions
@@ -81,8 +81,8 @@
let requestIndex = 0
async function update (model: NavigatorModel, spaces: Space[], preferences: Map<Ref<Doc>, SpacePreference>) {
shownSpaces = spaces.filter((sp) => !sp.archived && !preferences.has(sp._id))
starred = spaces.filter((sp) => preferences.has(sp._id))
shownSpaces = spaces.filter((sp) => !sp.archived && (model.hideStarred || !preferences.has(sp._id)))
starred = model.hideStarred ? [] : spaces.filter((sp) => preferences.has(sp._id))
if (model.specials !== undefined) {
const [sp, resIndex] = await updateSpecials(model.specials, spaces, ++requestIndex)
if (resIndex !== requestIndex) return
@@ -173,7 +173,7 @@
<div class="min-h-3 flex-no-shrink" />
<SavedView alias={currentApplication?.alias} on:select={(res) => (menuSelection = res.detail)} />
{#if starred.length}
{#if starred.length > 0 && !model.hideStarred}
<StarredNav
label={preference.string.Starred}
spaces={starred}
@@ -186,6 +186,15 @@
/>
{/if}
{#if model.groups && model.groups.length > 0}
<div class="min-h-3 flex-no-shrink" />
{#each model.groups as group (group.id)}
{#if group.component}
<Component is={group.component} props={{ model: group, currentSpace }} />
{/if}
{/each}
{/if}
{#each model.spaces as m (m.label)}
<SpacesNav
spaces={shownSpaces.filter((it) => hierarchy.isDerived(it._class, m.spaceClass))}
@@ -198,14 +207,5 @@
deselect={menuSelection || starred.some((s) => s._id === currentSpace)}
/>
{/each}
{#if model.groups && model.groups.length > 0}
<div class="min-h-3 flex-no-shrink" />
{#each model.groups as group (group.id)}
{#if group.component}
<Component is={group.component} props={{ model: group }} />
{/if}
{/each}
{/if}
</Scroller>
{/if}