From cd5bd143c60225f9f99458188ba9becc018296a3 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Fri, 31 May 2024 18:05:38 -0400 Subject: [PATCH 01/32] fix: resolve the sundar gutka issue, whening opening multiple banis in multipane workspace --- www/main/navigator/shabad/ShabadText.jsx | 19 +++++++- .../navigator/shabad/utils/change-verse.js | 46 +++++++++++++++++-- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/www/main/navigator/shabad/ShabadText.jsx b/www/main/navigator/shabad/ShabadText.jsx index 7b5bf91b..8ea8a0f7 100644 --- a/www/main/navigator/shabad/ShabadText.jsx +++ b/www/main/navigator/shabad/ShabadText.jsx @@ -63,6 +63,10 @@ export const ShabadText = ({ setVerseHistory, setActivePaneId, setShortcuts, + setSundarGutkaBaniId, + setCeremonyId, + setIsCeremonyBani, + setIsSundarGutkaBani, } = useStoreActions((actions) => actions.navigator); const [activeVerse, setActiveVerse] = useState({}); @@ -83,6 +87,15 @@ export const ShabadText = ({ activeShabadId, setActiveShabadId, setPreviousIndex, + baniType, + sundarGutkaBaniId, + setSundarGutkaBaniId, + ceremonyId, + setCeremonyId, + isSundarGutkaBani, + setIsSundarGutkaBani, + isCeremonyBani, + setIsCeremonyBani, }); udpateHistory(shabadId, newTraversedVerse, { verseHistory, @@ -163,8 +176,10 @@ export const ShabadText = ({ updateHomeVerse(initialVerseIndex); setActiveVerse({ [activeVerseIndex]: activeVerseId }); } - if (activeShabadId === null) { - updateTraversedVerse(initialVerseId, initialVerseIndex); + if (activeShabadId === null || sundarGutkaBaniId === null || ceremonyId === null) { + if (initialVerseIndex >= 0) { + updateTraversedVerse(initialVerseId, initialVerseIndex); + } } } }, [filteredItems]); diff --git a/www/main/navigator/shabad/utils/change-verse.js b/www/main/navigator/shabad/utils/change-verse.js index c4557882..d117a664 100644 --- a/www/main/navigator/shabad/utils/change-verse.js +++ b/www/main/navigator/shabad/utils/change-verse.js @@ -31,11 +31,51 @@ export const changeVerse = ( setActiveShabadId, activeShabadId, setPreviousIndex, + baniType, + sundarGutkaBaniId, + setSundarGutkaBaniId, + ceremonyId, + setCeremonyId, + isSundarGutkaBani, + setIsSundarGutkaBani, + isCeremonyBani, + setIsCeremonyBani, }, ) => { - if (clickedShabad !== activeShabadId) { - setActiveShabadId(clickedShabad); - setPreviousIndex(null); + if (baniType === 'bani') { + if (clickedShabad !== sundarGutkaBaniId) { + setSundarGutkaBaniId(clickedShabad); + setPreviousIndex(null); + } + if (!isSundarGutkaBani) { + setIsSundarGutkaBani(true); + } + if (isCeremonyBani) { + setIsCeremonyBani(false); + } + } else if (baniType === 'ceremony') { + if (clickedShabad !== ceremonyId) { + setCeremonyId(clickedShabad); + setPreviousIndex(null); + } + + if (!isSundarGutkaBani) { + setIsSundarGutkaBani(true); + } + if (isCeremonyBani) { + setIsCeremonyBani(false); + } + } else if (baniType === 'shabad') { + if (clickedShabad !== activeShabadId) { + setActiveShabadId(clickedShabad); + setPreviousIndex(null); + } + if (isSundarGutkaBani) { + setIsSundarGutkaBani(false); + } + if (isCeremonyBani) { + setIsCeremonyBani(false); + } } setActiveVerse({ [verseIndex]: newTraversedVerse }); if (activeVerseId !== newTraversedVerse) { From 97593acec263a120b5ef42ddf7e80b3e03334d08 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Fri, 31 May 2024 18:43:49 -0400 Subject: [PATCH 02/32] fix: resolve the active pane glitch when switching workspace --- www/main/navigator/shabad/ShabadText.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/main/navigator/shabad/ShabadText.jsx b/www/main/navigator/shabad/ShabadText.jsx index 8ea8a0f7..615a43db 100644 --- a/www/main/navigator/shabad/ShabadText.jsx +++ b/www/main/navigator/shabad/ShabadText.jsx @@ -176,7 +176,7 @@ export const ShabadText = ({ updateHomeVerse(initialVerseIndex); setActiveVerse({ [activeVerseIndex]: activeVerseId }); } - if (activeShabadId === null || sundarGutkaBaniId === null || ceremonyId === null) { + if (activeShabadId === null && sundarGutkaBaniId === null && ceremonyId === null) { if (initialVerseIndex >= 0) { updateTraversedVerse(initialVerseId, initialVerseIndex); } From 88f1468b3e169260711e6bee20d8ff32c659cebb Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Fri, 31 May 2024 18:44:47 -0400 Subject: [PATCH 03/32] chore: exit the script and continue with build process --- packaging/update-packagejson.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/update-packagejson.js b/packaging/update-packagejson.js index f996b659..a8378f13 100644 --- a/packaging/update-packagejson.js +++ b/packaging/update-packagejson.js @@ -7,7 +7,7 @@ const teamId = process.env.APPLE_TEAM_ID; if (!teamId) { console.error('TEAM_ID is not defined in the environment variables'); - process.exit(1); + process.exit(0); } if (!process.env.I_AM_TRAVIS) { From ee26da7ff4826edb4c1c93a852ef08548e163adf Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Mon, 3 Jun 2024 12:18:16 -0400 Subject: [PATCH 04/32] fix: resolve the font size issue of annoucement/misc slides from quick tools --- www/main/viewer/Slide/QuickTools.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/www/main/viewer/Slide/QuickTools.jsx b/www/main/viewer/Slide/QuickTools.jsx index 0b0c230d..16b64a6a 100644 --- a/www/main/viewer/Slide/QuickTools.jsx +++ b/www/main/viewer/Slide/QuickTools.jsx @@ -2,6 +2,8 @@ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import { useStoreActions, useStoreState } from 'easy-peasy'; +import { convertToCamelCase } from '../../common/utils'; + const remote = require('@electron/remote'); const { i18n } = remote.require('./app'); @@ -76,7 +78,7 @@ const QuickTools = ({ isMiscSlide }) => { }, ]; - const createGlobalPlatformObj = (name, index, action) => { + const createGlobalPlatformObj = (name, toolname, index, action) => { let payload; let actionName; let stateName; @@ -85,8 +87,8 @@ const QuickTools = ({ isMiscSlide }) => { stateName = `content${index}${action}`; actionName = `setContent${index}${action}`; } else { - stateName = `gurbani${action}`; - actionName = `setGurbani${action}`; + stateName = `${toolname}${action}`; + actionName = `set${convertToCamelCase(`${toolname}-${action}`, true)}`; } if (name === 'visibility') { @@ -124,7 +126,7 @@ const QuickTools = ({ isMiscSlide }) => { onClick={() => { global.platform.ipc.send( 'update-global-setting', - JSON.stringify(createGlobalPlatformObj(name, index, actionName)), + JSON.stringify(createGlobalPlatformObj(name, toolName, index, actionName)), ); }} /> From 292468c4c6c13af18a58ede0f1756a99ff0e8db8 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Thu, 6 Jun 2024 11:24:29 -0400 Subject: [PATCH 05/32] fix: resolve bug of single display minimize functionality --- www/main/navigator/Navigator.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/main/navigator/Navigator.jsx b/www/main/navigator/Navigator.jsx index a4da700c..85a2ca0d 100644 --- a/www/main/navigator/Navigator.jsx +++ b/www/main/navigator/Navigator.jsx @@ -13,9 +13,9 @@ const remote = require('@electron/remote'); const { i18n } = remote.require('./app'); const Navigator = () => { - const { minimizedBySingleDisplay, currentWorkspace } = useStoreState( - (state) => state.userSettings, - ); + const { currentWorkspace } = useStoreState((state) => state.userSettings); + + const { minimizedBySingleDisplay } = useStoreState((state) => state.navigator); const { displayWaheguruSlide, From fd8382ae79c2688417248cebc03ad643851648b6 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Thu, 6 Jun 2024 18:06:12 -0400 Subject: [PATCH 06/32] fix: remove the manual url encoding for custom images --- www/main/settings/utils/theme-bg-reader.js | 4 ++-- www/main/settings/utils/theme-bg-uploader.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/main/settings/utils/theme-bg-reader.js b/www/main/settings/utils/theme-bg-reader.js index c9615419..a1211fd6 100644 --- a/www/main/settings/utils/theme-bg-reader.js +++ b/www/main/settings/utils/theme-bg-reader.js @@ -29,8 +29,8 @@ export const upsertCustomBackgrounds = (responseCallback = () => {}) => { .map((file) => ({ name: file, path: `${userBackgroundsPath}/${file}`, - 'background-image': `${userBackgroundsURL}/${file.replace(/(\s)/g, '\\ ')}`, - 'background-image-path': `${userBackgroundsPath}/${file.replace(/(\s)/g, '\\ ')}`, + 'background-image': `${userBackgroundsURL}/${file}`, + 'background-image-path': `${userBackgroundsPath}/${file}`, time: fs.statSync(path.resolve(userBackgroundsPath, file)).mtime.getTime(), })) .sort((a, b) => b.time - a.time), diff --git a/www/main/settings/utils/theme-bg-uploader.js b/www/main/settings/utils/theme-bg-uploader.js index 4f343540..eb255b59 100644 --- a/www/main/settings/utils/theme-bg-uploader.js +++ b/www/main/settings/utils/theme-bg-uploader.js @@ -42,7 +42,7 @@ const imageCheck = (filePath) => { export const removeCustomBackgroundFile = (imagePath) => { fs.unlink(imagePath, (deleteError) => { if (deleteError) { - errorAlert(i18n.t('TOOLBAR.SYNC_CONTROLLER.INTERNET_ERR')); + errorAlert(i18n.t('THEMES.DELETE_ERR', { error: deleteError })); throw deleteError; } }); From e6aabada8fb69b088321965ac11110759c06c4f3 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Fri, 7 Jun 2024 22:52:16 -0400 Subject: [PATCH 07/32] fix: update viewer preview when we change content from dropdown --- .../settings/components/SettingViewer.jsx | 129 +++++++++--------- www/src/scss/_settings.scss | 5 - 2 files changed, 62 insertions(+), 72 deletions(-) diff --git a/www/main/settings/components/SettingViewer.jsx b/www/main/settings/components/SettingViewer.jsx index d079e092..923b0e1c 100644 --- a/www/main/settings/components/SettingViewer.jsx +++ b/www/main/settings/components/SettingViewer.jsx @@ -1,39 +1,22 @@ -import React, { useEffect, useState } from 'react'; +import React from 'react'; import { useStoreState } from 'easy-peasy'; const themes = require('../../../configs/themes.json'); const SettingViewer = () => { const { themeBg } = useStoreState((state) => state.userSettings); - const { slideOrder } = useStoreState((state) => state.viewerSettings); - - const [translationOrder, setTranslationOrder] = useState(); - const [teekaOrder, setTeekaOrder] = useState(); - const [transliterationOrder, setTransliterationOrder] = useState(); - - const orderFunctions = { - translation: (item) => { - if (translationOrder !== item) { - setTranslationOrder(item); - } - }, - transliteration: (item) => { - if (transliterationOrder !== item) { - setTransliterationOrder(item); - } - }, - teeka: (item) => { - if (teekaOrder !== item) { - setTeekaOrder(item); - } - }, - }; const { gurbaniFontSize, content1FontSize, content2FontSize, content3FontSize, + content1Visibility, + content2Visibility, + content3Visibility, + content1, + content2, + content3, displayNextLine, leftAlign, theme, @@ -62,15 +45,19 @@ const SettingViewer = () => { fontSize: `${gurbaniFontSize * 3}px`, }; - const translationStyles = { + const content1Styles = { + display: content1Visibility ? 'block' : 'none', fontSize: `${content1FontSize * 3}px`, + fontWeight: 'normal', }; - const transliterationStyles = { + const content2Styles = { + display: content2Visibility ? 'block' : 'none', fontSize: `${content2FontSize * 3}px`, }; - const teekaStyles = { + const content3Styles = { + display: content3Visibility ? 'block' : 'none', fontSize: `${content3FontSize * 3}px`, }; @@ -80,12 +67,6 @@ const SettingViewer = () => { display: displayNextLine ? 'block' : 'none', }; - useEffect(() => { - slideOrder.forEach((element, index) => { - orderFunctions[element](index + 2); - }); - }, [slideOrder]); - const getLarivaarAssistClass = () => { if (larivaarAssist) { return larivaarAssistType === 'single-color' @@ -104,6 +85,51 @@ const SettingViewer = () => { return ''; }; + const multilingual = { + 'translation-english': ( +
+ + Whatever I ask for from my Lord and Master, he gives that to me. + +
+ ), + 'translation-hindi': ( +
+ + हे भाई ! प्रभू के दास अपने प्रभू से जो कुछ माँगते हैं वह वही कुछ उनको देता है। + +
+ ), + 'translation-spanish': ( +
+ + Lo que sea que el Esclavo del Señor, Nanak recita con sus labios + +
+ ), + 'teeka-punjabi': ( +
+ hy BweI! pRBU dy dws Awpxy pRBU pwsoN jo kuJ mMgdy hn auh auhI kuJ auhnW ƒ dyNdw hY [ +
+ ), + 'transliteration-english': ( +
+ jo maageh Thaakur apune te soiee soiee dhevai || +
+ ), + 'transliteration-hindi': ( +
+ जो मागहि ठाकुर अपुने ते सोई सोई देवै ॥ +
+ ), + 'transliteration-shahmukhi': ( +
+ {' '} + جو ماگه ٹھاکر اپنے تے سوای سوای دےوَے ۔۔ +
+ ), + }; + return ( <>
@@ -157,40 +183,9 @@ const SettingViewer = () => { )}
-

-
-
- Whatever I ask for from my Lord and Master, he gives that to me. -
-
- Lo que sea que el Esclavo del Señor, Nanak recita con sus labios,{' '} -
-
- हे भाई ! प्रभू के दास अपने प्रभू से जो कुछ माँगते हैं वह वही कुछ उनको देता है। -
-
-

-

-
- hy BweI! pRBU dy dws Awpxy pRBU pwsoN jo kuJ mMgdy hn auh auhI kuJ auhnW ƒ dyNdw hY [ -
-

-

-
-
- jo maageh Thaakur apune te soiee soiee dhevai || -
-
- جو ماگه ٹھاکر اپنے تے سوای سوای دےوَے ۔۔ -
-
- जो मागहि ठाकुर अपुने ते सोई सोई देवै ॥ -
-
-

+

{multilingual[content1]}

+

{multilingual[content2]}

+

{multilingual[content3]}

Date: Mon, 10 Jun 2024 19:16:54 -0400 Subject: [PATCH 08/32] fix: hide the content option if the translation does not exist --- www/configs/navigator-settings.json | 4 +++- www/main/settings/components/Setting.jsx | 8 +++++++- www/main/viewer/Slide/QuickTools.jsx | 8 +++++++- www/main/viewer/Slide/Slide.jsx | 26 ++++++++++++++++++++++-- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/www/configs/navigator-settings.json b/www/configs/navigator-settings.json index 3295c0f8..83fe7bab 100644 --- a/www/configs/navigator-settings.json +++ b/www/configs/navigator-settings.json @@ -75,5 +75,7 @@ "homeVerse": false, "content":"", "baniType": "" - } + }, + + "disabledContent": [] } diff --git a/www/main/settings/components/Setting.jsx b/www/main/settings/components/Setting.jsx index d6af0869..f85ef80a 100644 --- a/www/main/settings/components/Setting.jsx +++ b/www/main/settings/components/Setting.jsx @@ -16,6 +16,8 @@ const Setting = ({ settingObj, stateVar, stateFunction }) => { const userSettings = useStoreState((state) => state.userSettings); const userSettingsActions = useStoreActions((state) => state.userSettings); + const { disabledContent } = useStoreState((state) => state.navigator); + const handleInputChange = (event) => { const value = event.target ? event.target.value : event; const { disableSetting } = settingObj; @@ -129,7 +131,11 @@ const Setting = ({ settingObj, stateVar, stateFunction }) => { {options.map((optionObj, optionIndex) => ( {optionObj.options.map((optionName, nameIndex) => ( - ))} diff --git a/www/main/viewer/Slide/QuickTools.jsx b/www/main/viewer/Slide/QuickTools.jsx index 16b64a6a..4e3b761a 100644 --- a/www/main/viewer/Slide/QuickTools.jsx +++ b/www/main/viewer/Slide/QuickTools.jsx @@ -25,6 +25,8 @@ const QuickTools = ({ isMiscSlide }) => { userSettings.content3, ]); + const { disabledContent } = useStoreState((state) => state.navigator); + const dropdownLabel = (option) => { if (option.includes('gurbani')) { return i18n.t(`QUICK_TOOLS.BANI`); @@ -156,7 +158,11 @@ const QuickTools = ({ isMiscSlide }) => { const markup = baniOptions.map((optionObj, optionIndex) => ( {optionObj.options.map((optionName, nameIndex) => ( - ))} diff --git a/www/main/viewer/Slide/Slide.jsx b/www/main/viewer/Slide/Slide.jsx index 69014e42..f2fca7db 100644 --- a/www/main/viewer/Slide/Slide.jsx +++ b/www/main/viewer/Slide/Slide.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import PropTypes from 'prop-types'; -import { useStoreState } from 'easy-peasy'; +import { useStoreActions, useStoreState } from 'easy-peasy'; import { CSSTransition } from 'react-transition-group'; import SlideTeeka from './SlideTeeka'; @@ -28,7 +28,8 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => { content3Visibility, } = useStoreState((state) => state.userSettings); - const { activeVerseId } = useStoreState((state) => state.navigator); + const { activeVerseId, disabledContent } = useStoreState((state) => state.navigator); + const { setDisabledContent } = useStoreActions((state) => state.navigator); const [showVerse, setShowVerse] = useState(true); const [orderMarkup, setOrderMarkup] = useState(null); @@ -69,6 +70,27 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => { }); } }, 100); + if (verseObj && verseObj.Translations) { + const translations = JSON.parse(verseObj.Translations); + + const translationMapping = { + 'en.bdb': 'translation-english', + 'es.sn': 'translation-spanish', + 'hi.ss': 'translation-hindi', + }; + + const missingTranslations = Object.entries(translationMapping) + .filter(([key]) => { + const value = key.split('.').reduce((obj, k) => obj && obj[k], translations); + return !value || !value.trim(); + }) + // eslint-disable-next-line no-unused-vars + .map(([_, identifier]) => identifier); + + if (JSON.stringify(disabledContent) !== JSON.stringify(missingTranslations)) { + setDisabledContent(missingTranslations); + } + } }, [verseObj]); useEffect(() => { From ef98e6d0c9199c7e21ca6f699c93e7d7292c8364 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Mon, 10 Jun 2024 22:39:33 -0400 Subject: [PATCH 09/32] fix: resolve the ceremony load issue --- www/main/navigator/shabad/utils/change-verse.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/main/navigator/shabad/utils/change-verse.js b/www/main/navigator/shabad/utils/change-verse.js index d117a664..84e90442 100644 --- a/www/main/navigator/shabad/utils/change-verse.js +++ b/www/main/navigator/shabad/utils/change-verse.js @@ -59,11 +59,11 @@ export const changeVerse = ( setPreviousIndex(null); } - if (!isSundarGutkaBani) { - setIsSundarGutkaBani(true); + if (isSundarGutkaBani) { + setIsSundarGutkaBani(false); } - if (isCeremonyBani) { - setIsCeremonyBani(false); + if (!isCeremonyBani) { + setIsCeremonyBani(true); } } else if (baniType === 'shabad') { if (clickedShabad !== activeShabadId) { From 6749dd79fab23774c14e06d289a3813703799323 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Tue, 11 Jun 2024 18:09:02 -0400 Subject: [PATCH 10/32] fix: disable bani controller in multipane workspace --- .../bani-controller/components/BaniController.jsx | 7 +++++++ .../navigator/search/hooks/use-new-shabad.jsx | 6 +++++- www/main/navigator/shabad/ShabadText.jsx | 11 +---------- www/src/scss/styles.scss | 15 +++++++++++++-- www/src/scss/themes/helpers/_variables.scss | 1 + 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/www/main/addons/bani-controller/components/BaniController.jsx b/www/main/addons/bani-controller/components/BaniController.jsx index 11a70973..03818b9e 100644 --- a/www/main/addons/bani-controller/components/BaniController.jsx +++ b/www/main/addons/bani-controller/components/BaniController.jsx @@ -77,6 +77,7 @@ const BaniController = ({ onScreenClose, className }) => { content2FontSize, content3FontSize, baniLength, + currentWorkspace, // mangalPosition, } = useStoreState((state) => state.userSettings); @@ -230,6 +231,12 @@ const BaniController = ({ onScreenClose, className }) => {
) : ( <> + {currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE') && ( +

+ + Bani controller is not supported in Multi-Pane workspace. +

+ )}
{codeLabel || i18n.t('TOOLBAR.SYNC_CONTROLLER.UNIQUE_CODE_LABEL')}
diff --git a/www/main/navigator/search/hooks/use-new-shabad.jsx b/www/main/navigator/search/hooks/use-new-shabad.jsx index dae6d062..6492f0d2 100644 --- a/www/main/navigator/search/hooks/use-new-shabad.jsx +++ b/www/main/navigator/search/hooks/use-new-shabad.jsx @@ -111,7 +111,11 @@ export const useNewShabad = () => { if (newSelectedVerse && activeVerseId !== newSelectedVerse) { setActiveVerseId(newSelectedVerse); } - if (window.socket !== undefined && window.socket !== null) { + if ( + window.socket !== undefined && + window.socket !== null && + currentWorkspace !== i18n.t('WORKSPACES.MULTI_PANE') + ) { window.socket.emit('data', { type: 'shabad', host: 'sttm-desktop', diff --git a/www/main/navigator/shabad/ShabadText.jsx b/www/main/navigator/shabad/ShabadText.jsx index 615a43db..6644bffc 100644 --- a/www/main/navigator/shabad/ShabadText.jsx +++ b/www/main/navigator/shabad/ShabadText.jsx @@ -9,7 +9,6 @@ import { ShabadVerse } from '../../common/sttm-ui'; import { changeHomeVerse, changeVerse, - sendToBaniController, filterRequiredVerseItems, udpateHistory, scrollToVerse, @@ -73,7 +72,7 @@ export const ShabadText = ({ const virtuosoRef = useRef(null); const activeVerseRef = useRef(null); - const updateTraversedVerse = (newTraversedVerse, verseIndex, crossPlatformID = null) => { + const updateTraversedVerse = (newTraversedVerse, verseIndex) => { if (isMiscSlide) { setIsMiscSlide(false); } @@ -103,14 +102,6 @@ export const ShabadText = ({ setPaneAttributes, paneAttributes, }); - sendToBaniController(crossPlatformID, filteredItems, newTraversedVerse, baniLength, { - isSundarGutkaBani, - sundarGutkaBaniId, - isCeremonyBani, - ceremonyId, - activeShabadId, - paneAttributes, - }); }; const updateHomeVerse = (verseIndex) => { diff --git a/www/src/scss/styles.scss b/www/src/scss/styles.scss index b54d3b6e..5d187c5a 100644 --- a/www/src/scss/styles.scss +++ b/www/src/scss/styles.scss @@ -155,11 +155,22 @@ button { bottom: 0; height: 100vh; left: 60px; - max-height: 750px; + max-height: 780px; max-width: 850px; overflow: auto; position: fixed; width: calc(100% - 100px); + + .error-msg{ + i { + padding-right: 6px; + } + background: $rust-red; + border-radius: 6px; + color: white; + margin-top: 0; + padding: 6px; + } } .sundar-gutka-wrapper, @@ -606,7 +617,7 @@ button { &.instructions-btn { align-items: center; - background-color: #973737; + background-color: $rust-red; color: white; display: flex; margin: auto; diff --git a/www/src/scss/themes/helpers/_variables.scss b/www/src/scss/themes/helpers/_variables.scss index 4a73d6e2..3776b0ae 100644 --- a/www/src/scss/themes/helpers/_variables.scss +++ b/www/src/scss/themes/helpers/_variables.scss @@ -36,6 +36,7 @@ $bright-red: #ff0000; $cadmium-orange: #e1802f; $princeton-orange: #ff802e; $rust: #b24601; +$rust-red: #973737; $light-green: #27ae60; $apple-green: #65a757; From 7fc338672f0367642b6416f1181e9dd37660d8e7 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Wed, 12 Jun 2024 19:44:06 -0400 Subject: [PATCH 11/32] fix: enable the bani controller in multipane --- .../components/BaniController.jsx | 7 --- .../navigator/search/hooks/use-new-shabad.jsx | 43 +++++++++++------- www/main/navigator/shabad/ShabadText.jsx | 44 +++++++++++++++---- .../navigator/shabad/utils/change-verse.js | 24 +++++----- www/main/navigator/shabad/utils/index.js | 2 +- www/src/scss/styles.scss | 11 ----- 6 files changed, 75 insertions(+), 56 deletions(-) diff --git a/www/main/addons/bani-controller/components/BaniController.jsx b/www/main/addons/bani-controller/components/BaniController.jsx index 03818b9e..11a70973 100644 --- a/www/main/addons/bani-controller/components/BaniController.jsx +++ b/www/main/addons/bani-controller/components/BaniController.jsx @@ -77,7 +77,6 @@ const BaniController = ({ onScreenClose, className }) => { content2FontSize, content3FontSize, baniLength, - currentWorkspace, // mangalPosition, } = useStoreState((state) => state.userSettings); @@ -231,12 +230,6 @@ const BaniController = ({ onScreenClose, className }) => {
) : ( <> - {currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE') && ( -

- - Bani controller is not supported in Multi-Pane workspace. -

- )}
{codeLabel || i18n.t('TOOLBAR.SYNC_CONTROLLER.UNIQUE_CODE_LABEL')}
diff --git a/www/main/navigator/search/hooks/use-new-shabad.jsx b/www/main/navigator/search/hooks/use-new-shabad.jsx index 6492f0d2..88651111 100644 --- a/www/main/navigator/search/hooks/use-new-shabad.jsx +++ b/www/main/navigator/search/hooks/use-new-shabad.jsx @@ -20,7 +20,7 @@ export const useNewShabad = () => { pane3, } = useStoreState((state) => state.navigator); - const { currentWorkspace } = useStoreState((state) => state.userSettings); + const { currentWorkspace, defaultPaneId } = useStoreState((state) => state.userSettings); const { setActiveShabadId, @@ -38,8 +38,21 @@ export const useNewShabad = () => { } = useStoreActions((actions) => actions.navigator); return (newSelectedShabad, newSelectedVerse, newSearchVerse, multiPaneId = false) => { + let shabadPane; if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { - switch (multiPaneId) { + if (!multiPaneId) { + const existingPane = [pane1, pane2, pane3].filter( + (pane) => pane.activeShabad === newSelectedShabad, + ); + if (existingPane.length > 0) { + [shabadPane] = existingPane; + } else { + shabadPane = defaultPaneId; + } + } else { + shabadPane = multiPaneId; + } + switch (shabadPane) { case 1: setPane1({ ...pane1, @@ -95,6 +108,17 @@ export const useNewShabad = () => { if (activeShabadId !== newSelectedShabad) { if (currentWorkspace !== i18n.t('WORKSPACES.MULTI_PANE')) { setActiveShabadId(newSelectedShabad); + if (window.socket !== undefined && window.socket !== null) { + window.socket.emit('data', { + type: 'shabad', + host: 'sttm-desktop', + id: newSelectedShabad, + shabadid: newSelectedShabad, // @deprecated + highlight: newSelectedVerse, + homeId: newSelectedVerse, + verseChange: false, + }); + } } // initialVerseId is the verse which is stored in history @@ -111,20 +135,5 @@ export const useNewShabad = () => { if (newSelectedVerse && activeVerseId !== newSelectedVerse) { setActiveVerseId(newSelectedVerse); } - if ( - window.socket !== undefined && - window.socket !== null && - currentWorkspace !== i18n.t('WORKSPACES.MULTI_PANE') - ) { - window.socket.emit('data', { - type: 'shabad', - host: 'sttm-desktop', - id: newSelectedShabad, - shabadid: newSelectedShabad, // @deprecated - highlight: newSelectedVerse, - homeId: newSelectedVerse, - verseChange: false, - }); - } }; }; diff --git a/www/main/navigator/shabad/ShabadText.jsx b/www/main/navigator/shabad/ShabadText.jsx index 6644bffc..8ba8e118 100644 --- a/www/main/navigator/shabad/ShabadText.jsx +++ b/www/main/navigator/shabad/ShabadText.jsx @@ -10,13 +10,14 @@ import { changeHomeVerse, changeVerse, filterRequiredVerseItems, + filterOverlayVerseItems, udpateHistory, scrollToVerse, saveToHistory, copyToClipboard, intelligentNextVerse, + sendToBaniController, } from './utils'; -import { filterOverlayVerseItems } from './utils/filter-verse-items'; const baniLengthCols = { short: 'existsSGPC', @@ -32,11 +33,15 @@ export const ShabadText = ({ setPaneAttributes, currentPane, }) => { + const [previousVerseIndex, setPreviousIndex] = useState(); const [filteredItems, setFilteredItems] = useState([]); + const [activeVerse, setActiveVerse] = useState({}); const [rawVerses, setRawVerses] = useState([]); - const [previousVerseIndex, setPreviousIndex] = useState(); const [atHome, setHome] = useState(true); + const virtuosoRef = useRef(null); + const activeVerseRef = useRef(null); + const { activeVerseId, isMiscSlide, @@ -66,13 +71,10 @@ export const ShabadText = ({ setCeremonyId, setIsCeremonyBani, setIsSundarGutkaBani, + savedCrossPlatformId, } = useStoreActions((actions) => actions.navigator); - const [activeVerse, setActiveVerse] = useState({}); - - const virtuosoRef = useRef(null); - const activeVerseRef = useRef(null); - const updateTraversedVerse = (newTraversedVerse, verseIndex) => { + const updateTraversedVerse = (newTraversedVerse, verseIndex, crossPlatformId = null) => { if (isMiscSlide) { setIsMiscSlide(false); } @@ -102,6 +104,14 @@ export const ShabadText = ({ setPaneAttributes, paneAttributes, }); + sendToBaniController(crossPlatformId, filteredItems, newTraversedVerse, baniLength, { + isSundarGutkaBani, + sundarGutkaBaniId, + isCeremonyBani, + ceremonyId, + activeShabadId, + paneAttributes, + }); }; const updateHomeVerse = (verseIndex) => { @@ -175,6 +185,15 @@ export const ShabadText = ({ } }, [filteredItems]); + useEffect(() => { + const baniVerseIndex = filteredItems.findIndex( + (obj) => obj.crossPlatformId === savedCrossPlatformId, + ); + if (baniVerseIndex >= 0) { + updateTraversedVerse(filteredItems[baniVerseIndex].ID, baniVerseIndex); + } + }, [savedCrossPlatformId]); + useEffect(() => { const overlayVerse = filterOverlayVerseItems(rawVerses, activeVerseId); ipcRenderer.send( @@ -184,7 +203,16 @@ export const ShabadText = ({ live: liveFeed, }), ); - }, [activeShabadId, activeVerseId]); + if ([activeShabadId, sundarGutkaBaniId, ceremonyId].includes(paneAttributes.activeShabad)) { + setPaneAttributes({ + ...paneAttributes, + activeVerse: activeVerseId, + }); + const verseIndex = filteredItems.findIndex((verse) => verse.verseId === activeVerseId); + if (verseIndex >= 0) setActiveVerse({ [verseIndex]: activeVerseId }); + scrollToVerse(activeVerseId, filteredItems, virtuosoRef); + } + }, [activeShabadId, activeVerseId, sundarGutkaBaniId, ceremonyId]); const getVerse = (direction) => { let verseIndex = null; diff --git a/www/main/navigator/shabad/utils/change-verse.js b/www/main/navigator/shabad/utils/change-verse.js index 84e90442..be158dd0 100644 --- a/www/main/navigator/shabad/utils/change-verse.js +++ b/www/main/navigator/shabad/utils/change-verse.js @@ -100,34 +100,34 @@ export const sendToBaniController = ( if (window.socket !== undefined && window.socket !== null) { let baniVerse; if (!crossPlatformId) { - baniVerse = activeShabad.find((obj) => obj.ID === newTraversedVerse); + baniVerse = activeShabad.find((obj) => obj.verseId === newTraversedVerse); } - if (isSundarGutkaBani) { + if (isSundarGutkaBani && sundarGutkaBaniId) { window.socket.emit('data', { host: 'sttm-desktop', type: 'bani', - id: sundarGutkaBaniId, - shabadid: sundarGutkaBaniId, // @deprecated - highlight: crossPlatformId || baniVerse.crossPlatformID, + id: paneAttributes.activeShabad, + shabadid: paneAttributes.activeShabad, // @deprecated + highlight: crossPlatformId || baniVerse.crossPlatformId, baniLength, // mangalPosition, verseChange: false, }); - } else if (isCeremonyBani) { + } else if (isCeremonyBani && ceremonyId) { window.socket.emit('data', { host: 'sttm-desktop', type: 'ceremony', - id: ceremonyId, - shabadid: ceremonyId, // @deprecated - highlight: crossPlatformId || baniVerse.crossPlatformID, + id: paneAttributes.activeShabad, + shabadid: paneAttributes.activeShabad, // @deprecated + highlight: crossPlatformId || baniVerse.crossPlatformId, verseChange: false, }); - } else { + } else if (activeShabadId) { window.socket.emit('data', { type: 'shabad', host: 'sttm-desktop', - id: activeShabadId, - shabadid: activeShabadId, // @deprecated + id: paneAttributes.activeShabad, + shabadid: paneAttributes.activeShabad, // @deprecated highlight: newTraversedVerse, homeId: paneAttributes.homeVerse, verseChange: false, diff --git a/www/main/navigator/shabad/utils/index.js b/www/main/navigator/shabad/utils/index.js index b889bceb..217bc57d 100644 --- a/www/main/navigator/shabad/utils/index.js +++ b/www/main/navigator/shabad/utils/index.js @@ -4,7 +4,7 @@ export { udpateHistory, intelligentNextVerse, } from './change-verse'; -export { filterRequiredVerseItems } from './filter-verse-items'; +export { filterRequiredVerseItems, filterOverlayVerseItems } from './filter-verse-items'; export { changeHomeVerse } from './change-home-verse'; export { scrollToVerse } from './scroll-to-verse'; export { saveToHistory } from './save-to-history'; diff --git a/www/src/scss/styles.scss b/www/src/scss/styles.scss index 5d187c5a..5ad57907 100644 --- a/www/src/scss/styles.scss +++ b/www/src/scss/styles.scss @@ -160,17 +160,6 @@ button { overflow: auto; position: fixed; width: calc(100% - 100px); - - .error-msg{ - i { - padding-right: 6px; - } - background: $rust-red; - border-radius: 6px; - color: white; - margin-top: 0; - padding: 6px; - } } .sundar-gutka-wrapper, From fd1116189fbad5b549868c5628d54bf6f21168a3 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Thu, 13 Jun 2024 17:54:29 -0400 Subject: [PATCH 12/32] fix: rename the empty space in files to underscore --- www/main/settings/utils/theme-bg-uploader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/main/settings/utils/theme-bg-uploader.js b/www/main/settings/utils/theme-bg-uploader.js index eb255b59..2bc34ad6 100644 --- a/www/main/settings/utils/theme-bg-uploader.js +++ b/www/main/settings/utils/theme-bg-uploader.js @@ -57,7 +57,10 @@ export const uploadImage = async (evt) => { return new Promise((resolve, reject) => { try { const filePath = evt.target.files[0].path; - const newPath = path.resolve(userBackgroundsPath, evt.target.files[0].name); + const newPath = path.resolve( + userBackgroundsPath, + evt.target.files[0].name.replaceAll(' ', '_'), + ); // eslint-disable-next-line no-param-reassign evt.target.value = ''; From 8bc484e0bfe8a9626fdfc942b17aa8f600934980 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Thu, 13 Jun 2024 18:55:23 -0400 Subject: [PATCH 13/32] fix: switch to default background on theme selection; code optimizations --- www/main/common/sttm-ui/tile/Tile.jsx | 4 ++-- www/main/navigator/shabad/ShabadContent.jsx | 6 +++++- www/main/settings/components/Categories.jsx | 1 + www/main/settings/components/ThemeContainer.jsx | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/www/main/common/sttm-ui/tile/Tile.jsx b/www/main/common/sttm-ui/tile/Tile.jsx index d965dca0..583f2571 100644 --- a/www/main/common/sttm-ui/tile/Tile.jsx +++ b/www/main/common/sttm-ui/tile/Tile.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { joinClasses } from '../../utils'; +import { classNames, joinClasses } from '../../utils'; const Tile = ({ children, @@ -32,7 +32,7 @@ const Tile = ({ className={`ui-tile ${tileClassname}`} style={theme ? getThemeSwatchStyles(theme) : null} > - {children || content} + {children || content} ); }; diff --git a/www/main/navigator/shabad/ShabadContent.jsx b/www/main/navigator/shabad/ShabadContent.jsx index ef7f130c..3854b2a8 100644 --- a/www/main/navigator/shabad/ShabadContent.jsx +++ b/www/main/navigator/shabad/ShabadContent.jsx @@ -373,7 +373,11 @@ const ShabadContent = () => { setTimeout(() => { const currentIndex = activeShabad.findIndex((obj) => obj.ID === activeVerseId); // Ignoring flower verse to avoid unwanted scroll during asa di vaar - if (activeVerseId !== 61 && activeShabad[currentIndex].Gurmukhi !== ',') { + if ( + currentIndex >= 0 && + activeVerseId !== 61 && + activeShabad[currentIndex].Gurmukhi !== ',' + ) { virtuosoRef.current.scrollToIndex({ index: currentIndex, behavior: 'smooth', diff --git a/www/main/settings/components/Categories.jsx b/www/main/settings/components/Categories.jsx index e761f263..82663047 100644 --- a/www/main/settings/components/Categories.jsx +++ b/www/main/settings/components/Categories.jsx @@ -28,6 +28,7 @@ const SettingsFactory = ({ subCategory }) => { addonObj.forEach((add, index) => { addonMarkup.push( { if (currentTheme !== theme.key) { applyTheme(theme, false, setTheme, setThemeBg, themeBg); } + setDefaultBg(theme, setThemeBg, themeBg); }} className={theme['background-video'] ? 'video-theme-instance' : 'theme-instance'} theme={theme} @@ -93,7 +94,7 @@ const ThemeContainer = () => { applyTheme(tile, 'custom', setTheme, setThemeBg); }} onRemove={() => { - removeCustomBackgroundFile(tile['background-image-path'].replace(/\\(\s)/g, ' ')); + removeCustomBackgroundFile(tile['background-image-path']); upsertCustomBackgrounds(setCustomThemes); if (tile['background-image'] === themeBg.url.href) { const currentThemeInstance = themes.filter( From 6d9baaed27cc647e7ea31c5ee4d315cf2b77b767 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Fri, 14 Jun 2024 11:26:58 -0400 Subject: [PATCH 14/32] fix: code optimizations; fix the scroll bug in multipane --- www/main/navigator/shabad/ShabadText.jsx | 6 +- .../navigator/shabad/utils/change-verse.js | 72 ++++++++++--------- .../settings/components/SettingViewer.jsx | 28 ++++---- 3 files changed, 56 insertions(+), 50 deletions(-) diff --git a/www/main/navigator/shabad/ShabadText.jsx b/www/main/navigator/shabad/ShabadText.jsx index 8ba8e118..92b61fb9 100644 --- a/www/main/navigator/shabad/ShabadText.jsx +++ b/www/main/navigator/shabad/ShabadText.jsx @@ -203,7 +203,11 @@ export const ShabadText = ({ live: liveFeed, }), ); - if ([activeShabadId, sundarGutkaBaniId, ceremonyId].includes(paneAttributes.activeShabad)) { + if ( + (isCeremonyBani && ceremonyId === paneAttributes.activeShabad) || + (isSundarGutkaBani && sundarGutkaBaniId === paneAttributes.activeShabad) || + (!isSundarGutkaBani && !isCeremonyBani && activeShabadId === paneAttributes.activeShabad) + ) { setPaneAttributes({ ...paneAttributes, activeVerse: activeVerseId, diff --git a/www/main/navigator/shabad/utils/change-verse.js b/www/main/navigator/shabad/utils/change-verse.js index be158dd0..678a6c41 100644 --- a/www/main/navigator/shabad/utils/change-verse.js +++ b/www/main/navigator/shabad/utils/change-verse.js @@ -42,40 +42,46 @@ export const changeVerse = ( setIsCeremonyBani, }, ) => { - if (baniType === 'bani') { - if (clickedShabad !== sundarGutkaBaniId) { - setSundarGutkaBaniId(clickedShabad); - setPreviousIndex(null); - } - if (!isSundarGutkaBani) { - setIsSundarGutkaBani(true); - } - if (isCeremonyBani) { - setIsCeremonyBani(false); - } - } else if (baniType === 'ceremony') { - if (clickedShabad !== ceremonyId) { - setCeremonyId(clickedShabad); - setPreviousIndex(null); - } + switch (baniType) { + case 'bani': + if (clickedShabad !== sundarGutkaBaniId) { + setSundarGutkaBaniId(clickedShabad); + setPreviousIndex(null); + } + if (!isSundarGutkaBani) { + setIsSundarGutkaBani(true); + } + if (isCeremonyBani) { + setIsCeremonyBani(false); + } + break; + case 'ceremony': + if (clickedShabad !== ceremonyId) { + setCeremonyId(clickedShabad); + setPreviousIndex(null); + } - if (isSundarGutkaBani) { - setIsSundarGutkaBani(false); - } - if (!isCeremonyBani) { - setIsCeremonyBani(true); - } - } else if (baniType === 'shabad') { - if (clickedShabad !== activeShabadId) { - setActiveShabadId(clickedShabad); - setPreviousIndex(null); - } - if (isSundarGutkaBani) { - setIsSundarGutkaBani(false); - } - if (isCeremonyBani) { - setIsCeremonyBani(false); - } + if (isSundarGutkaBani) { + setIsSundarGutkaBani(false); + } + if (!isCeremonyBani) { + setIsCeremonyBani(true); + } + break; + case 'shabad': + if (clickedShabad !== activeShabadId) { + setActiveShabadId(clickedShabad); + setPreviousIndex(null); + } + if (isSundarGutkaBani) { + setIsSundarGutkaBani(false); + } + if (isCeremonyBani) { + setIsCeremonyBani(false); + } + break; + default: + break; } setActiveVerse({ [verseIndex]: newTraversedVerse }); if (activeVerseId !== newTraversedVerse) { diff --git a/www/main/settings/components/SettingViewer.jsx b/www/main/settings/components/SettingViewer.jsx index 923b0e1c..90d20b82 100644 --- a/www/main/settings/components/SettingViewer.jsx +++ b/www/main/settings/components/SettingViewer.jsx @@ -45,21 +45,17 @@ const SettingViewer = () => { fontSize: `${gurbaniFontSize * 3}px`, }; - const content1Styles = { - display: content1Visibility ? 'block' : 'none', - fontSize: `${content1FontSize * 3}px`, - fontWeight: 'normal', - }; - - const content2Styles = { - display: content2Visibility ? 'block' : 'none', - fontSize: `${content2FontSize * 3}px`, + const contentAttributes = { + 1: { visibility: content1Visibility, fontSize: content1FontSize }, + 2: { visibility: content2Visibility, fontSize: content2FontSize }, + 3: { visibility: content3Visibility, fontSize: content3FontSize }, }; - const content3Styles = { - display: content3Visibility ? 'block' : 'none', - fontSize: `${content3FontSize * 3}px`, - }; + const getContentStyles = (contentId) => ({ + display: contentAttributes[contentId].visibility ? 'block' : 'none', + fontSize: `${contentAttributes[contentId].fontSize * 3}px`, + fontWeight: 'normal', + }); const nextLineStyles = { fontSize: `${gurbaniFontSize * 3}px`, @@ -183,9 +179,9 @@ const SettingViewer = () => { )}

-

{multilingual[content1]}

-

{multilingual[content2]}

-

{multilingual[content3]}

+

{multilingual[content1]}

+

{multilingual[content2]}

+

{multilingual[content3]}

Date: Fri, 14 Jun 2024 11:27:16 -0400 Subject: [PATCH 15/32] chore: update the version to 9.2.2 --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e62c579d..45dcac2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sttm-desktop", - "version": "9.2.1", + "version": "9.2.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sttm-desktop", - "version": "9.2.1", + "version": "9.2.2", "hasInstallScript": true, "license": "OSL-3.0", "dependencies": { diff --git a/package.json b/package.json index 7cc2c0df..6e9eac33 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "productName": "SikhiToTheMax", "name": "sttm-desktop", - "version": "9.2.1", + "version": "9.2.2", "description": "The SikhiToTheMax desktop app", "main": "app.js", "scripts": { @@ -216,4 +216,4 @@ "NSAllowsArbitraryLoads": true } } -} \ No newline at end of file +} From 3bca7d2342a29e268c0d55315b525ead0b13df7b Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Fri, 14 Jun 2024 11:32:09 -0400 Subject: [PATCH 16/32] chore: add the changelog text for 9.2.2 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34b4a845..5f10ce97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ ## New Updates +### 9.2.2 - ਊਨਾ Release _June 18, 2024_ + +#### Misc. bug fix and other improvements +- Enhanced Bani Controller: Improved functionality when using the Bani Controller in a multipane workspace. +- Improved Theme Handling: Enhanced support for custom images during theme changes. +- Restored Font Size Adjustments: Restored the ability to change the font size for miscellaneous slides such as "Waheguru" and "Mool Mantra." +- Code and Style Improvements: Various code refactors and stylistic enhancements to improve performance and maintainability. + +**We would love to hear from you if there a feature that you have been waiting for. Send us your feedback at [sttm.co/feedback](https://www.sttm.co/feedback).** +
+ ### 9.2.1 - ਊਨਾ Release _May 24, 2024_ #### New Features From c1f416fe4b557c1f3831766611ae8c661cfa58ab Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Fri, 14 Jun 2024 12:51:41 -0400 Subject: [PATCH 17/32] fix: restore the ability to open fav shabads in multipane --- .../misc/components/favoritePane.jsx | 3 ++ www/main/navigator/shabad/FavShabadIcon.jsx | 51 ++++++++++++------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/www/main/navigator/misc/components/favoritePane.jsx b/www/main/navigator/misc/components/favoritePane.jsx index 6191887c..701594b4 100644 --- a/www/main/navigator/misc/components/favoritePane.jsx +++ b/www/main/navigator/misc/components/favoritePane.jsx @@ -128,6 +128,7 @@ export const FavoritePane = ({ className, paneId }) => { ...pane1, content: i18n.t('MULTI_PANE.SHABAD'), activeShabad: shabadId, + baniType: 'shabad', }); break; case 2: @@ -135,6 +136,7 @@ export const FavoritePane = ({ className, paneId }) => { ...pane2, content: i18n.t('MULTI_PANE.SHABAD'), activeShabad: shabadId, + baniType: 'shabad', }); break; case 3: @@ -142,6 +144,7 @@ export const FavoritePane = ({ className, paneId }) => { ...pane3, content: i18n.t('MULTI_PANE.SHABAD'), activeShabad: shabadId, + baniType: 'shabad', }); break; default: diff --git a/www/main/navigator/shabad/FavShabadIcon.jsx b/www/main/navigator/shabad/FavShabadIcon.jsx index 62b7484d..d53d7229 100644 --- a/www/main/navigator/shabad/FavShabadIcon.jsx +++ b/www/main/navigator/shabad/FavShabadIcon.jsx @@ -12,9 +12,17 @@ const { i18n } = remote.require('./app'); const FavShabadIcon = ({ paneId }) => { const [isLoading, setLoading] = useState(false); const favBtnRef = useRef(null); - const { activeShabadId, activeVerseId, favShabad, pane1, pane2, pane3 } = useStoreState( - (state) => state.navigator, - ); + const { + activeShabadId, + activeVerseId, + favShabad, + pane1, + pane2, + pane3, + isSundarGutkaBani, + isCeremonyBani, + } = useStoreState((state) => state.navigator); + const { currentWorkspace } = useStoreState((state) => state.userSettings); const { setFavShabad } = useStoreActions((state) => state.navigator); @@ -23,21 +31,25 @@ const FavShabadIcon = ({ paneId }) => { const [currentShabad, setCurrentShabad] = useState(activeShabadId); const [currentVerse, setCurrentVerse] = useState(activeVerseId); const [favShabadIndex, setFavShabadIndex] = useState(-1); + const [baniType, setBaniType] = useState(''); useEffect(() => { if (paneId) { switch (paneId) { case 1: setCurrentShabad(pane1.activeShabad); - setCurrentVerse(pane1.versesRead[0]); + setCurrentVerse(pane1.activeVerse); + setBaniType(pane1.baniType); break; case 2: setCurrentShabad(pane2.activeShabad); - setCurrentVerse(pane2.versesRead[0]); + setCurrentVerse(pane2.activeVerse); + setBaniType(pane2.baniType); break; case 3: setCurrentShabad(pane3.activeShabad); - setCurrentVerse(pane3.versesRead[0]); + setCurrentVerse(pane3.activeVerse); + setBaniType(pane3.baniType); break; default: break; @@ -69,17 +81,22 @@ const FavShabadIcon = ({ paneId }) => { }); }; - if (currentShabad && !isLoading && userToken) { - return ( - - ); + if ( + baniType === 'shabad' || + (currentWorkspace !== i18n.t('WORKSPACES.MULTI_PANE') && !isSundarGutkaBani && !isCeremonyBani) + ) { + if (currentShabad && !isLoading && userToken) { + return ( + + ); + } } return null; }; From 7af6fb5c9c1b3618a6f5d0462a1812af42dca15c Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Fri, 14 Jun 2024 12:52:03 -0400 Subject: [PATCH 18/32] fix: resolve the ceremonies glitch with changing theme --- www/main/addons/ceremonies/components/CeremonyPane.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/main/addons/ceremonies/components/CeremonyPane.jsx b/www/main/addons/ceremonies/components/CeremonyPane.jsx index e6100df0..cd4ac55a 100644 --- a/www/main/addons/ceremonies/components/CeremonyPane.jsx +++ b/www/main/addons/ceremonies/components/CeremonyPane.jsx @@ -53,7 +53,7 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => { setPaneSelectorActive(true); }; - const onThemeClick = (theme, multipaneId = null) => { + const onThemeClick = (event, theme, multipaneId = null) => { let parsedTheme = theme; if (typeof theme === 'string') { parsedTheme = JSON.parse(theme); @@ -183,7 +183,7 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => { if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { openPaneMenu(e, themes.light); } else { - onThemeClick(themes.light); + onThemeClick(e, themes.light); } }} className="theme-instance" From ecb727e6d6435dd67b8fb07ed28b9d3504be7e25 Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Mon, 17 Jun 2024 11:05:26 -0400 Subject: [PATCH 19/32] fix: show larivaar and larivaar assist in preview window of bani overlay for all layouts; issue #1975 --- www/obs/index.html | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/www/obs/index.html b/www/obs/index.html index 3866f02c..e9c2e447 100644 --- a/www/obs/index.html +++ b/www/obs/index.html @@ -247,13 +247,16 @@ document.body.style.backgroundColor = overlayColor; - const $gurbani = document.querySelector('.o-gurbani'); - const { overlayLarivaar, larivaarAssist } = overlayPrefs; - let line = ''; - if ($gurbani.children.length) { - line = [...$gurbani.children].map(word => word.innerHTML).join(' '); - } - $gurbani.innerHTML = assist(line, overlayLarivaar, larivaarAssist); + const $gurbaniWrapper = document.querySelectorAll('.o-gurbani'); + + $gurbaniWrapper.forEach($gurbani => { + let line = ''; + const { overlayLarivaar, larivaarAssist } = overlayPrefs; + if ($gurbani.children.length) { + line = [...$gurbani.children].map(word => word.innerHTML).join(' '); + } + $gurbani.innerHTML = assist(line, overlayLarivaar, larivaarAssist); + }); }; socket.on('show-line', request => { From 8557c396ce1316c88680e3edb85654ef0939934d Mon Sep 17 00:00:00 2001 From: Gauravjeet Singh Date: Mon, 17 Jun 2024 11:05:56 -0400 Subject: [PATCH 20/32] fix: restore the gurmukhi toggle switch bug in annoucement overlay; issue #1974 --- www/main/addons/announcement/components/Annoucement.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/main/addons/announcement/components/Annoucement.jsx b/www/main/addons/announcement/components/Annoucement.jsx index c4347a18..50cf89cc 100644 --- a/www/main/addons/announcement/components/Annoucement.jsx +++ b/www/main/addons/announcement/components/Annoucement.jsx @@ -87,7 +87,7 @@ const Announcement = ({ isGurmukhi }) => {