From bc91237d7c54bdcd15c5c39a55def50d172bb659 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Sat, 12 Aug 2023 16:53:58 +0200 Subject: [PATCH] Refactor usage of tooltips for flexibility This commit introduces a new Vue component to handle tooltips. It acts as a wrapper for the `v-tooltip`. It enhances the maintainability, readability and portability of tooltips by enabling the direct inclusion of inline HTML in the tooltip components. It solves issues such as absence of linting or editor support and cumbersome string concatenation. It also provides an abstraction layer that simplifies the switching between different tooltip implementations, which would allow a smooth migration to Vue 3 (see #230). --- docs/presentation.md | 11 +- .../Instructions/CodeInstruction.vue | 20 ++-- .../Instructions/InstructionList.vue | 32 +++--- .../Scripts/Menu/Selector/TheSelector.vue | 101 +++++++++++------- .../components/Shared/TooltipWrapper.vue | 65 +++++++++++ 5 files changed, 171 insertions(+), 58 deletions(-) create mode 100644 src/presentation/components/Shared/TooltipWrapper.vue diff --git a/docs/presentation.md b/docs/presentation.md index 7dee1eb3..49595164 100644 --- a/docs/presentation.md +++ b/docs/presentation.md @@ -61,9 +61,16 @@ Stateful components can mutate and/or react to state changes (e.g., user selecti 📖 Refer to [architecture.md | Application State](./architecture.md#application-state) for an overview of event handling and [application.md | Application State](./presentation.md#application-state) for an in-depth understanding of state management in the application layer. -## Modals +## Shared UI components -- [ModalDialog.vue](./../src/presentation/components/Shared/Modal/ModalDialog.vue) is a shared component utilized for rendering modal windows. +Shared UI components promote consistency and simplifies the creation of the front-end. + +In order to maintain portability and easy maintainability, the preference is towards using homegrown components over third-party ones or comprehensive UI frameworks like Quasar. + +Shared components include: + +- [ModalDialog.vue](./../src/presentation/components/Shared/Modal/ModalDialog.vue) is utilized for rendering modal windows. +- [TooltipWrapper.vue](./../src/presentation/components/Shared/TooltipWrapper.vue) acts as a wrapper for rendering tooltips. ## Sass naming convention diff --git a/src/presentation/components/Code/CodeButtons/Instructions/CodeInstruction.vue b/src/presentation/components/Code/CodeButtons/Instructions/CodeInstruction.vue index 012756d6..8137c92a 100644 --- a/src/presentation/components/Code/CodeButtons/Instructions/CodeInstruction.vue +++ b/src/presentation/components/Code/CodeButtons/Instructions/CodeInstruction.vue @@ -2,20 +2,28 @@ $ - + + + + + +