From 0a94805df4f5597a50515d199461a1e80beadc90 Mon Sep 17 00:00:00 2001 From: Rhythm Aich Date: Sun, 12 Jan 2025 01:51:22 +0530 Subject: [PATCH 1/4] Added size adjustment functionality for popup window --- popup/App.tsx | 10 ++++++++- .../modals/SettingsModalContent.tsx | 22 +++++++++++++++++++ popup/index.css | 2 +- types/popupWindowSize.ts | 12 ++++++++++ types/settings.ts | 3 +++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 types/popupWindowSize.ts diff --git a/popup/App.tsx b/popup/App.tsx index 0831ac8..70b530a 100644 --- a/popup/App.tsx +++ b/popup/App.tsx @@ -53,6 +53,7 @@ import { getClipboardSnapshot, watchClipboardSnapshot } from "~storage/clipboard import { getEntryIdToTags, watchEntryIdToTags } from "~storage/entryIdToTags"; import { getFavoriteEntryIds, watchFavoriteEntryIds } from "~storage/favoriteEntryIds"; import { getSettings, watchSettings } from "~storage/settings"; +import { PopupSizeMap, type PopupSizeDimensions } from "~types/popupWindowSize"; import { Tab } from "~types/tab"; import { getEntries, watchEntries } from "~utils/storage"; import { defaultBorderColor, lightOrDark } from "~utils/sx"; @@ -102,6 +103,8 @@ export const App = () => { const [settings, setSettings] = useAtom(settingsAtom); const setEntryIdToTags = useSetAtom(entryIdToTagsAtom); const [changelogViewedAt, setChangelogViewedAt] = useAtom(changelogViewedAtAtom); + const windowSize: PopupSizeDimensions = PopupSizeMap[settings.popupWindowSize]; + useEffect(() => { (async () => setEntries(await getEntries()))(); watchEntries((entries) => { @@ -152,7 +155,12 @@ export const App = () => { } return ( - + diff --git a/popup/components/modals/SettingsModalContent.tsx b/popup/components/modals/SettingsModalContent.tsx index bfa7053..4802c3f 100644 --- a/popup/components/modals/SettingsModalContent.tsx +++ b/popup/components/modals/SettingsModalContent.tsx @@ -38,6 +38,7 @@ import { z } from "zod"; import { settingsAtom } from "~popup/states/atoms"; import { setSettings } from "~storage/settings"; +import { PopupSize } from "~types/popupWindowSize"; import { Tab } from "~types/tab"; import { removeActionBadgeText, setActionBadgeText } from "~utils/actionBadge"; import { getClipboardHistoryIOExport, importFile } from "~utils/importExport"; @@ -165,6 +166,27 @@ export const SettingsModalContent = () => { /> ({ borderColor: defaultBorderColor(theme) })} /> + + + Adjust size + Change the size of the extension popup window + + Date: Tue, 14 Jan 2025 14:27:50 +0530 Subject: [PATCH 3/4] Update text in popup/components/modals/SettingsModalContent.tsx Co-authored-by: Andy Young --- popup/components/modals/SettingsModalContent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/popup/components/modals/SettingsModalContent.tsx b/popup/components/modals/SettingsModalContent.tsx index 3edcdd9..400a9ab 100644 --- a/popup/components/modals/SettingsModalContent.tsx +++ b/popup/components/modals/SettingsModalContent.tsx @@ -169,7 +169,7 @@ export const SettingsModalContent = () => { Window Size - Change the size of the extension popup window + Select the size of the extension's window.