From dc82933644d744f90e20cd13bfd4a96b76800546 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Wed, 6 Nov 2024 09:25:17 +0300 Subject: [PATCH] Mobile UI fixes (#7109) Signed-off-by: Alexander Platov --- dev/prod/webpack.config.js | 2 +- packages/theme/styles/common.scss | 23 ++++++++++++--- packages/theme/styles/dialogs.scss | 2 +- packages/theme/styles/global.scss | 2 +- packages/theme/styles/panel.scss | 3 +- packages/ui/src/components/Dialog.svelte | 28 ++++++++++++++----- packages/ui/src/components/Header.svelte | 4 ++- .../ui/src/components/PopupInstance.svelte | 11 ++++---- packages/ui/src/components/Separator.svelte | 1 + .../ui/src/components/icons/ToDetails.svelte | 28 +++++++++++++++++++ .../ui/src/components/internal/Root.svelte | 2 +- packages/ui/src/index.ts | 1 + packages/ui/src/popups.ts | 8 +++--- .../src/components/PreviewPopupActions.svelte | 4 +-- .../src/components/ChannelHeader.svelte | 12 ++++++-- .../src/components/Header.svelte | 6 ++-- .../src/components/PinnedMessages.svelte | 20 +++++++------ .../src/components/PlanView.svelte | 6 +++- .../src/components/Applications.svelte | 3 +- .../src/components/Workbench.svelte | 6 +++- .../src/components/sidebar/Sidebar.svelte | 3 +- plugins/workbench-resources/src/sidebar.ts | 4 ++- .../tests/documents/documents-content.spec.ts | 4 ++- .../model/documents/document-content-page.ts | 2 ++ 24 files changed, 137 insertions(+), 48 deletions(-) create mode 100644 packages/ui/src/components/icons/ToDetails.svelte diff --git a/dev/prod/webpack.config.js b/dev/prod/webpack.config.js index 3669c434cd..2dce1b098f 100644 --- a/dev/prod/webpack.config.js +++ b/dev/prod/webpack.config.js @@ -277,7 +277,7 @@ module.exports = [ plugins: [ new HtmlWebpackPlugin({ meta: { - viewport: 'width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=1' + viewport: 'width=device-width, initial-scale=1' } }), ...(prod ? [new CompressionPlugin()] : []), diff --git a/packages/theme/styles/common.scss b/packages/theme/styles/common.scss index 3509ad2b06..6ea42526e3 100644 --- a/packages/theme/styles/common.scss +++ b/packages/theme/styles/common.scss @@ -149,8 +149,7 @@ width: 17.5rem; } &.right { - overflow: hidden; - border-radius: var(--medium-BorderRadius) 0 0 var(--medium-BorderRadius); + border-radius: var(--medium-BorderRadius); } } @@ -162,7 +161,7 @@ &:not(.right) { top: calc(var(--status-bar-height) + 1px); - height: calc(100% - var(--status-bar-height) - 1px); + height: calc(100% - var(--status-bar-height) - 2px); filter: drop-shadow(2px 0 5px rgba(0, 0, 0, .2)); &.portrait { left: 0; } @@ -171,12 +170,28 @@ &.right { top: var(--status-bar-height); right: 0; - height: calc(100% - var(--status-bar-height) - 1px); + height: calc(100% - var(--status-bar-height)); background-color: var(--theme-statusbar-color); filter: drop-shadow(-2px 0 5px rgba(0, 0, 0, .2)); } } } +@media (max-width: 480px) { + .mobile-theme { + .mobile-wrapper, + .antiPanel-navigator:not(.right) { + overflow: hidden; + border: 1px solid var(--theme-divider-color); + border-radius: var(--medium-BorderRadius); + } + .antiPanel-navigator:not(.right) { + top: var(--status-bar-height); + height: calc(100% - var(--status-bar-height)); + + .antiSeparator { display: none; } + } + } +} .antiPanel-component { overflow: hidden; flex-direction: column; diff --git a/packages/theme/styles/dialogs.scss b/packages/theme/styles/dialogs.scss index 5867c2727f..b4441ddc4b 100644 --- a/packages/theme/styles/dialogs.scss +++ b/packages/theme/styles/dialogs.scss @@ -304,7 +304,7 @@ display: flex; flex-direction: column; height: 100%; - min-width: 25rem; + min-width: 20rem; min-height: 0; background-color: var(--theme-popup-color); border-radius: .5rem; diff --git a/packages/theme/styles/global.scss b/packages/theme/styles/global.scss index a7f883a923..801bf1d7f0 100644 --- a/packages/theme/styles/global.scss +++ b/packages/theme/styles/global.scss @@ -147,7 +147,7 @@ body { height: var(--app-height); width: 100%; overflow: hidden; - touch-action: none; + // touch-action: none; @media print { overflow: visible !important; diff --git a/packages/theme/styles/panel.scss b/packages/theme/styles/panel.scss index 44e2af9301..0702583cd8 100644 --- a/packages/theme/styles/panel.scss +++ b/packages/theme/styles/panel.scss @@ -293,8 +293,6 @@ min-width: 0; min-height: 0; border-radius: var(--small-focus-BorderRadius); - border-top-right-radius: 0; - border-bottom-right-radius:0 ; &:not(.rowContent) { flex-direction: column; } .panel-instance & { @@ -590,5 +588,6 @@ } } .popup.fullsize { + align-items: center; transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19) !important; } diff --git a/packages/ui/src/components/Dialog.svelte b/packages/ui/src/components/Dialog.svelte index d9f9851e3f..9cc185ad8f 100644 --- a/packages/ui/src/components/Dialog.svelte +++ b/packages/ui/src/components/Dialog.svelte @@ -16,7 +16,17 @@
{/if} - {#if $$slots.utils && isFullSize} + {#if $$slots.utils && isFullSize && !needFullSize}
{/if} - {#if isFullSize} + {#if isFullSize && !needFullSize}
diff --git a/packages/ui/src/components/Header.svelte b/packages/ui/src/components/Header.svelte index edf9ae97d5..6fe72d133a 100644 --- a/packages/ui/src/components/Header.svelte +++ b/packages/ui/src/components/Header.svelte @@ -38,8 +38,9 @@ export let overflowExtra: boolean = false export let noPrint: boolean = false export let freezeBefore: boolean = false - export let doubleRowWidth = 768 + export let doubleRowWidth: number = 768 export let closeOnEscape: boolean = true + export let realWidth: number | undefined = undefined const dispatch = createEventDispatcher() @@ -78,6 +79,7 @@
{ + realWidth = element.clientWidth if (!doubleRow && element.clientWidth <= doubleRowWidth) doubleRow = true else if (doubleRow && element.clientWidth > doubleRowWidth) doubleRow = false }} diff --git a/packages/ui/src/components/PopupInstance.svelte b/packages/ui/src/components/PopupInstance.svelte index fa78c370ec..bb36c19e07 100644 --- a/packages/ui/src/components/PopupInstance.svelte +++ b/packages/ui/src/components/PopupInstance.svelte @@ -15,7 +15,7 @@ --> + + + + + diff --git a/packages/ui/src/components/internal/Root.svelte b/packages/ui/src/components/internal/Root.svelte index 8356f9006f..49858d6374 100644 --- a/packages/ui/src/components/internal/Root.svelte +++ b/packages/ui/src/components/internal/Root.svelte @@ -151,7 +151,7 @@ -
+
{#if desktopPlatform} diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 774d8d5492..135709bed7 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -237,6 +237,7 @@ export { default as IconKeyShift } from './components/icons/KeyShift.svelte' export { default as IconFolderCollapsed } from './components/icons/FolderCollapsed.svelte' export { default as IconFolderExpanded } from './components/icons/FolderExpanded.svelte' export { default as IconCheckmark } from './components/icons/Checkmark.svelte' +export { default as IconToDetails } from './components/icons/ToDetails.svelte' export { default as PanelInstance } from './components/PanelInstance.svelte' export { default as Panel } from './components/Panel.svelte' diff --git a/packages/ui/src/popups.ts b/packages/ui/src/popups.ts index 5f2bca9fd3..d679c18598 100644 --- a/packages/ui/src/popups.ts +++ b/packages/ui/src/popups.ts @@ -366,10 +366,10 @@ export function fitPopupElement ( show = false } else if (element === 'full' && contentPanel !== undefined) { const rect = contentPanel.getBoundingClientRect() - newProps.top = `${rect.top + 4}px` - newProps.bottom = '4px' - newProps.left = '4px' - newProps.right = '4px' + newProps.top = `${rect.top + 1}px` + newProps.bottom = '1px' + newProps.left = '1px' + newProps.right = '1px' show = true } else if (element === 'content' && contentPanel !== undefined) { const rect = contentPanel.getBoundingClientRect() diff --git a/plugins/attachment-resources/src/components/PreviewPopupActions.svelte b/plugins/attachment-resources/src/components/PreviewPopupActions.svelte index 635f23b40b..e270ef3f6d 100644 --- a/plugins/attachment-resources/src/components/PreviewPopupActions.svelte +++ b/plugins/attachment-resources/src/components/PreviewPopupActions.svelte @@ -15,7 +15,7 @@ {#if count > 0} - - - - + {#if iconOnly} + + {:else} + + + + + {/if} {/if} diff --git a/plugins/time-resources/src/components/PlanView.svelte b/plugins/time-resources/src/components/PlanView.svelte index c015668bb5..260432bd1f 100644 --- a/plugins/time-resources/src/components/PlanView.svelte +++ b/plugins/time-resources/src/components/PlanView.svelte @@ -88,7 +88,11 @@ {/if} -
+
{#if visibleCalendar} diff --git a/plugins/workbench-resources/src/components/Applications.svelte b/plugins/workbench-resources/src/components/Applications.svelte index 9c2c06e807..912af46c1b 100644 --- a/plugins/workbench-resources/src/components/Applications.svelte +++ b/plugins/workbench-resources/src/components/Applications.svelte @@ -15,7 +15,7 @@