2626 :helper-text =" validity"
2727 :label =" label"
2828 :value.sync =" localDefaultName" />
29+
30+ <!-- Hidden file warning -->
31+ <NcNoteCard v-if =" isHiddenFileName"
32+ type =" warning"
33+ :text =" t('files', 'Files starting with a dot are hidden by default')" />
2934 </form >
3035 </NcDialog >
3136</template >
@@ -35,12 +40,13 @@ import type { ComponentPublicInstance, PropType } from 'vue'
3540import { getUniqueName } from ' @nextcloud/files'
3641import { t } from ' @nextcloud/l10n'
3742import { extname } from ' path'
38- import { nextTick , onMounted , ref , watch , watchEffect } from ' vue'
43+ import { computed , nextTick , onMounted , ref , watch , watchEffect } from ' vue'
3944import { getFilenameValidity } from ' ../utils/filenameValidity.ts'
4045
4146import NcButton from ' @nextcloud/vue/components/NcButton'
4247import NcDialog from ' @nextcloud/vue/components/NcDialog'
4348import NcTextField from ' @nextcloud/vue/components/NcTextField'
49+ import NcNoteCard from ' @nextcloud/vue/components/NcNoteCard'
4450
4551const props = defineProps ({
4652 /**
@@ -89,6 +95,11 @@ const nameInput = ref<ComponentPublicInstance>()
8995const formElement = ref <HTMLFormElement >()
9096const validity = ref (' ' )
9197
98+ const isHiddenFileName = computed (() => {
99+ // Check if the name starts with a dot, which indicates a hidden file
100+ return localDefaultName .value .trim ().startsWith (' .' )
101+ })
102+
92103/**
93104 * Focus the filename input field
94105 */
0 commit comments