From 945b803dbadc2ea161e3f4448a079d8d5574c141 Mon Sep 17 00:00:00 2001 From: Nikolay Tatarinov Date: Sun, 1 Mar 2026 15:45:49 +0300 Subject: [PATCH] Enhance frontend components and introduce new features - Updated PasswordInput component with improved styling and touch manipulation support. - Added new IconMenu component for consistent icon representation in the UI. - Refactored MapControls and introduced MapControlsContent for better organization and usability. - Implemented suppress-leaflet-deprecation plugin to handle known warnings in Firefox. - Enhanced default layout with a responsive drawer for mobile navigation and improved user experience. --- frontend-nuxt/components/PasswordInput.vue | 98 +- frontend-nuxt/components/icons/IconMenu.vue | 7 + frontend-nuxt/components/map/MapControls.vue | 473 +++++----- .../components/map/MapControlsContent.vue | 169 ++++ frontend-nuxt/layouts/default.vue | 221 +++-- frontend-nuxt/pages/admin/index.vue | 892 +++++++++--------- frontend-nuxt/pages/profile.vue | 380 ++++---- .../suppress-leaflet-deprecation.client.ts | 22 + 8 files changed, 1293 insertions(+), 969 deletions(-) create mode 100644 frontend-nuxt/components/icons/IconMenu.vue create mode 100644 frontend-nuxt/components/map/MapControlsContent.vue create mode 100644 frontend-nuxt/plugins/suppress-leaflet-deprecation.client.ts diff --git a/frontend-nuxt/components/PasswordInput.vue b/frontend-nuxt/components/PasswordInput.vue index d58fd39..d873650 100644 --- a/frontend-nuxt/components/PasswordInput.vue +++ b/frontend-nuxt/components/PasswordInput.vue @@ -1,49 +1,49 @@ - - - + + + diff --git a/frontend-nuxt/components/icons/IconMenu.vue b/frontend-nuxt/components/icons/IconMenu.vue new file mode 100644 index 0000000..c5f9996 --- /dev/null +++ b/frontend-nuxt/components/icons/IconMenu.vue @@ -0,0 +1,7 @@ + diff --git a/frontend-nuxt/components/map/MapControls.vue b/frontend-nuxt/components/map/MapControls.vue index 7b93535..23665e2 100644 --- a/frontend-nuxt/components/map/MapControls.vue +++ b/frontend-nuxt/components/map/MapControls.vue @@ -1,218 +1,255 @@ - - - - - + + + + + diff --git a/frontend-nuxt/components/map/MapControlsContent.vue b/frontend-nuxt/components/map/MapControlsContent.vue new file mode 100644 index 0000000..923451c --- /dev/null +++ b/frontend-nuxt/components/map/MapControlsContent.vue @@ -0,0 +1,169 @@ + + + diff --git a/frontend-nuxt/layouts/default.vue b/frontend-nuxt/layouts/default.vue index ef60735..fcc9698 100644 --- a/frontend-nuxt/layouts/default.vue +++ b/frontend-nuxt/layouts/default.vue @@ -1,75 +1,165 @@ @@ -121,11 +204,16 @@ const dark = ref(false) const live = ref(false) const me = ref<{ username?: string; auths?: string[] } | null>(null) const userDropdownRef = ref(null) +const drawerCheckboxRef = ref(null) function closeDropdown() { userDropdownRef.value?.removeAttribute('open') } +function closeDrawer() { + if (drawerCheckboxRef.value) drawerCheckboxRef.value.checked = false +} + const { isLoginPath } = useAppPaths() const isLogin = computed(() => isLoginPath(route.path)) const isAdmin = computed(() => !!me.value?.auths?.includes('admin')) @@ -175,6 +263,7 @@ function applyTheme() { async function doLogout() { await useMapApi().logout() + closeDrawer() await router.push('/login') me.value = null } diff --git a/frontend-nuxt/pages/admin/index.vue b/frontend-nuxt/pages/admin/index.vue index d2db7f3..993c407 100644 --- a/frontend-nuxt/pages/admin/index.vue +++ b/frontend-nuxt/pages/admin/index.vue @@ -1,446 +1,446 @@ - - - - + + + + diff --git a/frontend-nuxt/pages/profile.vue b/frontend-nuxt/pages/profile.vue index eade2c6..2d2b28a 100644 --- a/frontend-nuxt/pages/profile.vue +++ b/frontend-nuxt/pages/profile.vue @@ -1,190 +1,190 @@ - - - + + + diff --git a/frontend-nuxt/plugins/suppress-leaflet-deprecation.client.ts b/frontend-nuxt/plugins/suppress-leaflet-deprecation.client.ts new file mode 100644 index 0000000..c9c27cc --- /dev/null +++ b/frontend-nuxt/plugins/suppress-leaflet-deprecation.client.ts @@ -0,0 +1,22 @@ +/** + * Suppress known Firefox deprecation warnings from Leaflet when panning/dragging the map. + * See: https://github.com/Leaflet/Leaflet/issues/7078, https://github.com/Leaflet/Leaflet/issues/9386 + * No ill effect; Leaflet has not fixed this upstream. + */ +export default defineNuxtPlugin(() => { + if (import.meta.dev && typeof console !== 'undefined' && console.warn) { + const originalWarn = console.warn + console.warn = function (...args: unknown[]) { + const msg = typeof args[0] === 'string' ? args[0] : String(args[0]) + if ( + msg.includes('mozPressure') || + msg.includes('mozInputSource') || + msg.includes('PointerEvent.pressure') || + msg.includes('PointerEvent.pointerType') + ) { + return + } + originalWarn.apply(console, args) + } + } +})