Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

feat(nc-gui): allow to show base overview page in mobile mode

Ramesh Mane2db3cdfda124
diff --git a/packages/nc-gui/assets/style.scss b/packages/nc-gui/assets/style.scss
index 090ffbeb24..db12500e1f 100644
--- a/packages/nc-gui/assets/style.scss
+++ b/packages/nc-gui/assets/style.scss
@@ -922,7 +922,7 @@ input[type='number'] {
}
.ant-message {
- @apply !bottom-16 !md:bottom-4 !top-auto px-2 md:px-4;
+ @apply !bottom-12 !md:bottom-4 !top-auto px-2 md:px-4;
}
.ant-message-notice {
diff --git a/packages/nc-gui/components/dashboard/Sidebar/HeaderWrapper.vue b/packages/nc-gui/components/dashboard/Sidebar/HeaderWrapper.vue
index 29221b1f04..d78934fbbc 100644
--- a/packages/nc-gui/components/dashboard/Sidebar/HeaderWrapper.vue
+++ b/packages/nc-gui/components/dashboard/Sidebar/HeaderWrapper.vue
@@ -9,7 +9,7 @@ const { isLoading } = toRefs(props)
const workspaceStore = useWorkspace()
-const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
+const { isLeftSidebarOpen, allowHideLeftSidebarForCurrentRoute } = storeToRefs(useSidebarStore())
const { activeWorkspace, isWorkspacesLoading } = storeToRefs(workspaceStore)
@@ -21,7 +21,13 @@ const { activeTableId } = storeToRefs(useTablesStore())
const { isMobileMode } = useGlobal()
-const showSidebarBtn = computed(() => !(isMobileMode.value && !activeViewTitleOrId.value && !activeTableId.value))
+const showSidebarBtn = computed(() => {
+ if (allowHideLeftSidebarForCurrentRoute.value) {
+ return isMobileMode.value
+ }
+
+ return !(isMobileMode.value && !activeViewTitleOrId.value && !activeTableId.value)
+})
</script>
<template>
diff --git a/packages/nc-gui/components/dashboard/TreeView/Project/Home.vue b/packages/nc-gui/components/dashboard/TreeView/Project/Home.vue
index 98358f0a2b..ca2880a7dc 100644
--- a/packages/nc-gui/components/dashboard/TreeView/Project/Home.vue
+++ b/packages/nc-gui/components/dashboard/TreeView/Project/Home.vue
@@ -4,6 +4,8 @@ import Table from '~/components/dashboard/TreeView/Table/index.vue'
const router = useRouter()
const route = router.currentRoute
+const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
+
const { isSharedBase } = storeToRefs(useBase())
const { baseUrl } = useBase()
@@ -15,6 +17,8 @@ const { activeProjectId } = storeToRefs(basesStore)
const { isUIAllowed } = useRoles()
+const { isMobileMode } = useGlobal()
+
const { meta: metaKey, control } = useMagicKeys()
const projectNodeRef = ref()
@@ -35,6 +39,11 @@ async function addNewProjectChildEntity(showSourceSelector = true) {
}
const openBaseHomePage = async () => {
+ if (isMobileMode.value && isLeftSidebarOpen.value && route.value.name === 'index-typeOrId-baseId-index-index') {
+ isLeftSidebarOpen.value = false
+
+ return
+ }
const cmdOrCtrl = isMac() ? metaKey.value : control.value
await navigateTo(
@@ -42,7 +51,7 @@ const openBaseHomePage = async () => {
id: base.value.id!,
type: 'database',
isSharedBase: isSharedBase.value,
- projectPage: !isUIAllowed('projectOverviewTab') ? 'collaborator' : undefined,
+ projectPage: !isUIAllowed('projectOverviewTab') || isMobileMode.value ? 'collaborator' : undefined,
})}`,
cmdOrCtrl
? {
diff --git a/packages/nc-gui/components/project/AccessSettings.vue b/packages/nc-gui/components/project/AccessSettings.vue
index 1ce4118777..2e5781e076 100644
--- a/packages/nc-gui/components/project/AccessSettings.vue
+++ b/packages/nc-gui/components/project/AccessSettings.vue
@@ -329,7 +329,7 @@ onBeforeUnmount(() => {
<div
class="nc-collaborator-table-container nc-access-settings-view flex flex-col relative"
:class="{
- 'h-[calc(100vh_-_100px)]': !isAdminPanel,
+ 'nc-admin-panel': isAdminPanel,
}"
>
<ProjectPrivateOverlay v-if="showOverlay" />
@@ -367,7 +367,7 @@ onBeforeUnmount(() => {
</NcPageHeader>
</div>
- <div class="nc-content-max-w h-full flex flex-col items-center gap-6 px-6 pt-6">
+ <div class="nc-content-max-w h-full flex flex-col items-center gap-6 px-4 md:px-6 pt-6">
<NcAlert v-if="isEeUI && isPrivateBase" type="info" :message="$t('title.privateBase')" class="bg-nc-bg-gray-extralight">
<template #icon>
<GeneralIcon icon="ncUser" class="w-6 h-6 text-nc-content-gray-subtle" />
@@ -405,7 +405,7 @@ onBeforeUnmount(() => {
</template>
</a-input>
- <NcButton :disabled="isLoading" size="small" @click="isInviteModalVisible = true">
+ <NcButton :disabled="isLoading" size="small" class="flex-none" @click="isInviteModalVisible = true">
<div class="flex items-center gap-1">
<component :is="iconMap.plus" class="w-4 h-4" />
{{ $t('activity.addMembers') }}
@@ -519,4 +519,14 @@ onBeforeUnmount(() => {
@apply h-4.5 w-4.5;
}
}
+
+.nc-collaborator-table-container {
+ &:not(.nc-admin-panel) {
+ @apply h-[calc(100vh-var(--topbar-height)-44px)];
+
+ @supports (height: 100dvh) {
+ @apply h-[calc(100dvh-var(--topbar-height)-44px)];
+ }
+ }
+}
</style>
diff --git a/packages/nc-gui/components/project/View.vue b/packages/nc-gui/components/project/View.vue
index 4b525bbd6d..9031c48b5e 100644
--- a/packages/nc-gui/components/project/View.vue
+++ b/packages/nc-gui/components/project/View.vue
@@ -94,6 +94,12 @@ watch(
*/
if (route.value.params.viewId) return
+ // In mobile mode we only show collaborator tab
+ if (isMobileMode.value && newVal !== 'collaborator') {
+ projectPageTab.value = 'collaborator'
+ return
+ }
+
if (newVal && newVal !== oldVal) {
if (newVal === 'syncs') {
projectPageTab.value = 'syncs'
@@ -200,7 +206,7 @@ onMounted(() => {
</NcBadge>
</div>
</div>
- <LazyGeneralShareProject v-if="!showEmptySkeleton" />
+ <LazyGeneralShareProject v-if="!showEmptySkeleton && !isMobileMode" />
</div>
<div
v-if="!showEmptySkeleton"
@@ -213,7 +219,11 @@ onMounted(() => {
<template #leftExtra>
<div class="w-3"></div>
</template>
- <a-tab-pane v-if="!isAdminPanel && isOverviewTabVisible" key="overview" class="nc-project-overview-tab-content">
+ <a-tab-pane
+ v-if="!isAdminPanel && isOverviewTabVisible && !isMobileMode"
+ key="overview"
+ class="nc-project-overview-tab-content"
+ >
<template #tab>
<div class="tab-title" data-testid="proj-view-tab__overview">
<GeneralIcon icon="ncMultiCircle" />
@@ -245,7 +255,7 @@ onMounted(() => {
<ProjectAccessSettings :base-id="currentBase?.id" />
</a-tab-pane>
<a-tab-pane
- v-if="isEeUI && isUIAllowed('sourceCreate') && base.id && isTableAndFieldPermissionsEnabled"
+ v-if="isEeUI && isUIAllowed('sourceCreate') && base.id && isTableAndFieldPermissionsEnabled && !isMobileMode"
key="permissions"
>
<template #tab>
@@ -256,7 +266,7 @@ onMounted(() => {
</template>
<DashboardSettingsPermissions v-model:state="baseSettingsState" :base-id="base.id" />
</a-tab-pane>
- <a-tab-pane v-if="isUIAllowed('sourceCreate') && base.id" key="data-source">
+ <a-tab-pane v-if="isUIAllowed('sourceCreate') && base.id && !isMobileMode" key="data-source">
<template #tab>
<div class="tab-title" data-testid="proj-view-tab__data-sources">
<GeneralIcon icon="ncDatabase" />
@@ -275,7 +285,10 @@ onMounted(() => {
</template>
<DashboardSettingsDataSources v-model:state="baseSettingsState" :base-id="base.id" class="max-h-full" />
</a-tab-pane>
- <a-tab-pane v-if="isFeatureEnabled(FEATURE_FLAG.SYNC) && isUIAllowed('sourceCreate') && base.id" key="syncs">
+ <a-tab-pane
+ v-if="isFeatureEnabled(FEATURE_FLAG.SYNC) && isUIAllowed('sourceCreate') && base.id && !isMobileMode"
+ key="syncs"
+ >
<template #tab>
<div class="tab-title" data-testid="proj-view-tab__syncs">
<GeneralIcon icon="ncZap" />
@@ -285,7 +298,11 @@ onMounted(() => {
<DashboardSettingsSyncs v-model:state="baseSettingsState" :base-id="base.id" class="max-h-full" />
</a-tab-pane>
<a-tab-pane
- v-if="!isSharedBase && (isUIAllowed('baseMiscSettings') || isFeatureEnabled(FEATURE_FLAG.MODEL_CONTEXT_PROTOCOL))"
+ v-if="
+ !isSharedBase &&
+ (isUIAllowed('baseMiscSettings') || isFeatureEnabled(FEATURE_FLAG.MODEL_CONTEXT_PROTOCOL)) &&
+ !isMobileMode
+ "
key="base-settings"
>
<template #tab>
diff --git a/packages/nc-gui/pages/index/[typeOrId]/[baseId]/index/index/index.vue b/packages/nc-gui/pages/index/[typeOrId]/[baseId]/index/index/index.vue
index 9258130057..65c3de692d 100644
--- a/packages/nc-gui/pages/index/[typeOrId]/[baseId]/index/index/index.vue
+++ b/packages/nc-gui/pages/index/[typeOrId]/[baseId]/index/index/index.vue
@@ -123,7 +123,7 @@ function openQuickImportDialog(type: QuickImportTypes, file: File) {
}
const hideProjectViewPage = computed(() => {
- return isSharedBase.value || isMobileMode.value
+ return isSharedBase.value
})
const showEmptySkeleton = ref(true)
diff --git a/packages/nc-gui/store/sidebar.ts b/packages/nc-gui/store/sidebar.ts
index 567d59d1ad..610ab81b86 100644
--- a/packages/nc-gui/store/sidebar.ts
+++ b/packages/nc-gui/store/sidebar.ts
@@ -19,9 +19,14 @@ export const useSidebarStore = defineStore('sidebarStore', () => {
const isFullScreen = ref(false)
const tablesStore = useTablesStore()
+
+ const allowHideLeftSidebarForCurrentRoute = computed(() => {
+ return ['index-typeOrId-baseId-index-index', 'index-typeOrId-settings'].includes(route.name as string)
+ })
+
const isLeftSidebarOpen = computed({
get() {
- if (isMobileMode.value && route.name === 'index-typeOrId-settings') {
+ if (isMobileMode.value && allowHideLeftSidebarForCurrentRoute.value) {
return _isLeftSidebarOpen.value
}
@@ -141,6 +146,7 @@ export const useSidebarStore = defineStore('sidebarStore', () => {
isFullScreen,
toggleFullScreenState,
ncIsIframeFullscreenSupported,
+ allowHideLeftSidebarForCurrentRoute,
}
})