From 2556de1f38035dfcf4e3182058cd7111a5c12d72 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Thu, 27 Feb 2025 12:10:33 +0530 Subject: [PATCH] feat: Support bigger font size in dashboard (#10974) # Pull Request Template ## Description Fixes https://linear.app/chatwoot/issue/CW-4091/accessibility-improvement-support-bigger-font-size-for-the-dashboard ## Type of change - [x] New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### **Loom video** https://www.loom.com/share/1ab781859fa748a5ad54aacbacd127b4?sid=a7dd9164-a6de-462f-bff7-1b25e9c55b4f ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- app/javascript/dashboard/App.vue | 10 +- .../dashboard/assets/scss/widgets/_base.scss | 9 +- .../Campaigns/CampaignLayout.vue | 4 +- .../LiveChatCampaignDialog.vue | 2 +- .../SMSCampaign/SMSCampaignDialog.vue | 2 +- .../Contacts/ContactsDetailsLayout.vue | 10 +- .../Contacts/ContactsHeader/ContactHeader.vue | 2 +- .../ContactsActiveFiltersPreview.vue | 2 +- .../Contacts/ContactsListLayout.vue | 2 +- .../components-next/EmptyStateLayout.vue | 2 +- .../HelpCenter/HelpCenterLayout.vue | 4 +- .../ArticleEditorProperties.vue | 14 +- .../Pages/CategoryPage/CategoryDialog.vue | 2 +- .../Pages/CategoryPage/CategoryForm.vue | 2 +- .../PortalSettingsPage/PortalSettings.vue | 2 +- .../PortalSwitcher/PortalSwitcher.vue | 2 +- .../components/ActionButtons.vue | 2 +- .../components/AttachmentPreviews.vue | 6 +- .../components/ComposeNewConversationForm.vue | 2 +- .../components-next/captain/PageLayout.vue | 4 +- .../captain/pageComponents/Paywall.vue | 2 +- .../pagination/PaginationFooter.vue | 2 +- .../phonenumberinput/PhoneNumberInput.vue | 2 +- .../components-next/sidebar/Sidebar.vue | 2 +- .../sidebar/SidebarGroupLeaf.vue | 2 +- .../components-next/switch/Switch.vue | 2 +- .../dashboard/components/SettingsSection.vue | 49 ++--- .../dashboard/components/ui/PreviewCard.vue | 9 +- .../dashboard/components/ui/Switch.vue | 8 +- .../dashboard/components/ui/Tabs/Tabs.vue | 39 ++-- .../dashboard/components/ui/Wizard.vue | 10 +- .../widgets/AutomationActionInput.vue | 4 +- .../components/widgets/FilterInput/Index.vue | 2 +- .../components/widgets/SettingIntroBanner.vue | 2 +- .../widgets/WootWriter/ReplyTopPanel.vue | 2 +- .../widgets/conversation/ConversationCard.vue | 2 +- .../conversation/ConversationSidebar.vue | 2 +- .../conversation/linear/CreateIssue.vue | 6 +- .../composables/spec/useFontSize.spec.js | 175 ++++++++++++++++++ .../dashboard/composables/useFontSize.js | 140 ++++++++++++++ .../dashboard/helper/themeHelper.js | 4 +- .../dashboard/i18n/locale/en/settings.json | 18 ++ .../widget-preview/components/Widget.vue | 2 +- .../settings/automation/AddAutomationRule.vue | 4 +- .../automation/EditAutomationRule.vue | 4 +- .../billing/components/BillingHeader.vue | 2 +- .../components/BaseSettingsListItem.vue | 2 +- .../settings/inbox/InboxChannels.vue | 2 +- .../routes/dashboard/settings/inbox/Index.vue | 4 +- .../dashboard/settings/inbox/Settings.vue | 2 +- .../settings/inbox/WidgetBuilder.vue | 5 +- .../components/SenderNameExamplePreview.vue | 2 +- .../dashboard/settings/macros/MacroNode.vue | 3 +- .../settings/macros/MacroProperties.vue | 4 +- .../settings/profile/AudioAlertTone.vue | 2 +- .../settings/profile/ChangePassword.vue | 8 +- .../dashboard/settings/profile/FontSize.vue | 62 +++++++ .../dashboard/settings/profile/HotKeyCard.vue | 10 +- .../dashboard/settings/profile/Index.vue | 29 ++- .../settings/profile/UserBasicDetails.vue | 8 +- .../reports/components/ReportsWrapper.vue | 2 +- .../routes/dashboard/settings/sla/SlaForm.vue | 12 +- .../dashboard/settings/sla/SlaTimeInput.vue | 6 +- .../shared/components/emoji/EmojiInput.vue | 10 +- app/javascript/v3/components/Form/Select.vue | 2 +- app/javascript/v3/components/Form/Switch.vue | 4 +- 66 files changed, 598 insertions(+), 162 deletions(-) create mode 100644 app/javascript/dashboard/composables/spec/useFontSize.spec.js create mode 100644 app/javascript/dashboard/composables/useFontSize.js create mode 100644 app/javascript/dashboard/routes/dashboard/settings/profile/FontSize.vue diff --git a/app/javascript/dashboard/App.vue b/app/javascript/dashboard/App.vue index c32cb98d2..ae50055fb 100644 --- a/app/javascript/dashboard/App.vue +++ b/app/javascript/dashboard/App.vue @@ -14,6 +14,7 @@ import WootSnackbarBox from './components/SnackbarContainer.vue'; import { setColorTheme } from './helper/themeHelper'; import { isOnOnboardingView } from 'v3/helpers/RouteHelper'; import { useAccount } from 'dashboard/composables/useAccount'; +import { useFontSize } from 'dashboard/composables/useFontSize'; import { registerSubscription, verifyServiceWorkerExistence, @@ -37,8 +38,15 @@ export default { const router = useRouter(); const store = useStore(); const { accountId } = useAccount(); + // Use the font size composable (it automatically sets up the watcher) + const { currentFontSize } = useFontSize(); - return { router, store, currentAccountId: accountId }; + return { + router, + store, + currentAccountId: accountId, + currentFontSize, + }; }, data() { return { diff --git a/app/javascript/dashboard/assets/scss/widgets/_base.scss b/app/javascript/dashboard/assets/scss/widgets/_base.scss index d35c1cfc9..9367e8b2d 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_base.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_base.scss @@ -82,7 +82,7 @@ input[type='url']:not(.reset-base) { } input[type='file'] { - @apply bg-white dark:bg-slate-800 leading-[1.15] mb-4; + @apply bg-white dark:bg-n-solid-1 leading-[1.15] mb-4; } // Select @@ -141,11 +141,16 @@ code { @apply text-xs border-0; &.hljs { - @apply bg-slate-50 dark:bg-slate-700 text-slate-800 dark:text-slate-50 rounded-lg p-5; + @apply bg-n-slate-3 dark:bg-n-solid-3 text-slate-800 dark:text-slate-50 rounded-lg p-5; .hljs-number, .hljs-string { @apply text-red-800 dark:text-red-400; } + + .hljs-name, + .hljs-tag { + @apply text-n-slate-11; + } } } diff --git a/app/javascript/dashboard/components-next/Campaigns/CampaignLayout.vue b/app/javascript/dashboard/components-next/Campaigns/CampaignLayout.vue index 3169dbc3e..184e8bd10 100644 --- a/app/javascript/dashboard/components-next/Campaigns/CampaignLayout.vue +++ b/app/javascript/dashboard/components-next/Campaigns/CampaignLayout.vue @@ -22,7 +22,7 @@ const handleButtonClick = () => {