Skip to content

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

fix: Mobile friendly responsive onboarding flow

Ramesh Mane7a8e1ffc7383
diff --git a/packages/nc-gui/components/ai/Erd/view.vue b/packages/nc-gui/components/ai/Erd/view.vue
index dce32ddba1..804bb935da 100644
--- a/packages/nc-gui/components/ai/Erd/view.vue
+++ b/packages/nc-gui/components/ai/Erd/view.vue
@@ -30,7 +30,7 @@ const toggleFullScreen = () => {
<div
class="w-full bg-white"
:class="{
- 'z-100 h-screen w-screen fixed top-0 left-0 right-0 bottom-0': config.isFullScreen,
+ 'z-100 nc-h-screen w-screen fixed top-0 left-0 right-0 bottom-0': config.isFullScreen,
'nc-erd-vue-flow-single-table': config.singleTableMode,
'nc-erd-vue-flow': !config.singleTableMode,
}"
diff --git a/packages/nc-gui/components/auth/onboarding/Layout/index.vue b/packages/nc-gui/components/auth/onboarding/Layout/index.vue
index 44afe0eee8..5d8f60736c 100644
--- a/packages/nc-gui/components/auth/onboarding/Layout/index.vue
+++ b/packages/nc-gui/components/auth/onboarding/Layout/index.vue
@@ -114,6 +114,7 @@ watch(stepIndex, (newIndex, oldIndex, cleanup) => {
<NcButton
type="text"
size="small"
+ mobile-size="medium"
:disabled="isDisabledSkipButton"
data-testid="nc-onboarding-flow-skip-button"
@click="onCompleteOnboardingFlow(true)"
@@ -127,6 +128,7 @@ watch(stepIndex, (newIndex, oldIndex, cleanup) => {
v-else
type="text"
size="small"
+ mobile-size="medium"
:disabled="isFirst"
data-testid="nc-onboarding-flow-back-button"
@click="goToPrevious()"
@@ -140,6 +142,7 @@ watch(stepIndex, (newIndex, oldIndex, cleanup) => {
<NcButton
type="primary"
size="small"
+ mobile-size="medium"
:disabled="!isFilledVisibleOptions"
data-testid="nc-onboarding-flow-next-button"
@click="isLast ? onCompleteOnboardingFlow(false) : goToNext()"
diff --git a/packages/nc-gui/components/auth/onboarding/Question/index.vue b/packages/nc-gui/components/auth/onboarding/Question/index.vue
index 58d85165c8..5b293830be 100644
--- a/packages/nc-gui/components/auth/onboarding/Question/index.vue
+++ b/packages/nc-gui/components/auth/onboarding/Question/index.vue
@@ -6,6 +6,8 @@ interface Props {
const props = defineProps<Props>()
+const { isMobileMode } = useGlobal()
+
const { question } = toRefs(props)
const { formState, onSelectOption, stepper } = useOnboardingFlow()
@@ -62,8 +64,9 @@ const isOptionSelected = (option: OnboardingOptionType) => {
<div
class="flex flex-wrap gap-4"
:class="{
- 'children:(w-[calc(50%-8px)] flex-none)': !question.config?.optionsInEachRow || question.config?.optionsInEachRow === 2,
- 'flex-col items-center children:(w-[60%] flex-none)': question.config?.optionsInEachRow === 1,
+ 'children:(w-[calc(50%-8px)] flex-none)':
+ (!question.config?.optionsInEachRow || question.config?.optionsInEachRow === 2) && !isMobileMode,
+ 'flex-col items-center children:(w-[90%] md:w-[60%] flex-none)': question.config?.optionsInEachRow === 1 || isMobileMode,
}"
>
<template v-for="(option, index) of options" :key="option.value">
diff --git a/packages/nc-gui/components/cell/attachment/Carousel.vue b/packages/nc-gui/components/cell/attachment/Carousel.vue
index 722e68351b..a81a73668b 100644
--- a/packages/nc-gui/components/cell/attachment/Carousel.vue
+++ b/packages/nc-gui/components/cell/attachment/Carousel.vue
@@ -147,7 +147,7 @@ const initEmblaApi = (val: any) => {
<div
v-if="selectedFile"
ref="container"
- class="flex w-full overflow-hidden justify-center text-center relative h-screen items-center"
+ class="flex w-full overflow-hidden justify-center text-center relative nc-h-screen items-center"
>
<NcButton
class="top-5 !absolute cursor-pointer !z-30 !hover:bg-transparent left-5"
diff --git a/packages/nc-gui/components/erd/View.vue b/packages/nc-gui/components/erd/View.vue
index 4443af4fbc..d1c66199b0 100644
--- a/packages/nc-gui/components/erd/View.vue
+++ b/packages/nc-gui/components/erd/View.vue
@@ -156,7 +156,7 @@ onMounted(async () => {
<div
class="w-full bg-white border-1 border-gray-100 rounded-lg"
:class="{
- 'z-100 h-screen w-screen fixed top-0 left-0 right-0 bottom-0': config.isFullScreen,
+ 'z-100 nc-h-screen w-screen fixed top-0 left-0 right-0 bottom-0': config.isFullScreen,
'nc-erd-vue-flow-single-table': config.singleTableMode,
'nc-erd-vue-flow': !config.singleTableMode,
}"
diff --git a/packages/nc-gui/components/nc/Button.vue b/packages/nc-gui/components/nc/Button.vue
index d018527405..67be9e1840 100644
--- a/packages/nc-gui/components/nc/Button.vue
+++ b/packages/nc-gui/components/nc/Button.vue
@@ -20,6 +20,7 @@ export interface NcButtonProps {
showAsDisabled?: boolean
type?: ButtonType | 'danger' | 'secondary' | undefined
size?: NcButtonSize
+ mobileSize?: NcButtonSize
loaderSize?: GeneralLoaderProps['size']
centered?: boolean
fullWidth?: boolean
@@ -52,15 +53,23 @@ const emits = defineEmits(['update:loading'])
const slots = useSlots()
+const { isMobileMode } = useGlobal()
+
const NcButton = ref<HTMLElement | null>(null)
-const { size, loaderSize, type, theme, bordered } = toRefs(props)
+const { size: _size, mobileSize, loaderSize, type, theme, bordered } = toRefs(props)
const loading = useVModel(props, 'loading', emits)
const isFocused = ref(false)
const isClicked = ref(false)
+const size = computed(() => {
+ if (isMobileMode.value && mobileSize.value) return mobileSize.value
+
+ return _size.value
+})
+
const onFocus = (e: FocusEvent) => {
// Only focus when coming from another element which is not a mouse click
nextTick(() => {
diff --git a/packages/nc-gui/components/smartsheet/Map.vue b/packages/nc-gui/components/smartsheet/Map.vue
index 12c681645e..04c03e7bd5 100644
--- a/packages/nc-gui/components/smartsheet/Map.vue
+++ b/packages/nc-gui/components/smartsheet/Map.vue
@@ -221,7 +221,7 @@ const count = computed(() => paginationData.value.totalRows)
</a-modal>
<div class="flex flex-col h-full w-full no-underline" data-testid="nc-map-wrapper">
- <div id="mapContainer" ref="mapContainerRef" class="w-full h-screen">
+ <div id="mapContainer" ref="mapContainerRef" class="w-full nc-h-screen">
<a-tooltip placement="bottom" class="h-2 w-auto max-w-fit-content absolute top-3 right-3 p-2 z-500 cursor-default">
<template #title>
<span v-if="count > 1000"> {{ $t('msg.info.map.overLimit') }} </span>
diff --git a/packages/nc-gui/layouts/empty.vue b/packages/nc-gui/layouts/empty.vue
index b734bb51f6..477ce54100 100644
--- a/packages/nc-gui/layouts/empty.vue
+++ b/packages/nc-gui/layouts/empty.vue
@@ -5,7 +5,7 @@ export default {
</script>
<template>
- <NuxtLayout class="h-screen">
+ <NuxtLayout class="nc-h-screen">
<slot></slot>
</NuxtLayout>
</template>
diff --git a/packages/nc-gui/layouts/top.vue b/packages/nc-gui/layouts/top.vue
index ec12665f10..a7a8717b1b 100644
--- a/packages/nc-gui/layouts/top.vue
+++ b/packages/nc-gui/layouts/top.vue
@@ -5,7 +5,7 @@ export default {
</script>
<template>
- <NuxtLayout class="h-screen">
+ <NuxtLayout class="nc-h-screen">
<DashboardTopbar />
<div class="h-full overflow-auto">
<slot></slot>
diff --git a/packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index.vue b/packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index.vue
index a84528e175..b5a99c7d86 100644
--- a/packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index.vue
+++ b/packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index.vue
@@ -30,7 +30,7 @@ router.afterEach((to) => shouldRedirect(to.name as string))
<template>
<div
- class="scrollbar-thin scrollbar-track-transparent scrollbar-thumb-gray-200 hover-scrollbar-thumb-gray-300 h-[100vh] overflow-y-auto overflow-x-hidden flex flex-col color-transition p-4 lg:p-6 nc-form-view min-h-[600px]"
+ class="scrollbar-thin scrollbar-track-transparent scrollbar-thumb-gray-200 hover-scrollbar-thumb-gray-300 nc-h-screen overflow-y-auto overflow-x-hidden flex flex-col color-transition p-4 lg:p-6 nc-form-view min-h-[600px]"
:class="{
'children:(!h-auto my-auto)': sharedViewMeta?.surveyMode,
}"