From 9d2b74a6b471aac4b896575fa31ab3b473f8a1eb Mon Sep 17 00:00:00 2001 From: Aarkay Pathak Date: Wed, 12 Nov 2025 01:13:44 +0530 Subject: [PATCH 1/3] Feat: Make on-page popup resizable and fix layout --- package-lock.json | 39 ++++++++++++------------ src/components/FloatingToolbar/index.jsx | 7 +---- src/content-script/styles.scss | 23 ++++++++++++-- src/popup/styles.scss | 2 +- 4 files changed, 41 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92c40029..7b42233f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -134,6 +134,7 @@ "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.7", @@ -2492,8 +2493,7 @@ "node_modules/@types/scheduler": { "version": "0.16.6", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.6.tgz", - "integrity": "sha512-Vlktnchmkylvc9SnwwwozTv04L/e1NykF5vgoQ0XTmI8DD+wxfjQuHuvHS3p0r2jz2x2ghPs2h1FVeDirIteWA==", - "peer": true + "integrity": "sha512-Vlktnchmkylvc9SnwwwozTv04L/e1NykF5vgoQ0XTmI8DD+wxfjQuHuvHS3p0r2jz2x2ghPs2h1FVeDirIteWA==" }, "node_modules/@types/tough-cookie": { "version": "4.0.5", @@ -2723,6 +2723,7 @@ "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2778,6 +2779,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -3410,6 +3412,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001688", "electron-to-chromium": "^1.5.73", @@ -3806,7 +3809,6 @@ "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", "dev": true, - "peer": true, "dependencies": { "is-what": "^3.14.1" }, @@ -4265,8 +4267,7 @@ "node_modules/csstype": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", - "peer": true + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/data-uri-to-buffer": { "version": "4.0.1", @@ -4669,7 +4670,6 @@ "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", "dev": true, "optional": true, - "peer": true, "dependencies": { "prr": "~1.0.1" }, @@ -4881,6 +4881,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -5672,6 +5673,7 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.9.0.tgz", "integrity": "sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==", "license": "MIT", + "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -6093,6 +6095,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.20.6" } @@ -6156,7 +6159,6 @@ "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", "dev": true, "optional": true, - "peer": true, "bin": { "image-size": "bin/image-size.js" }, @@ -6643,8 +6645,7 @@ "version": "3.14.1", "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/isarray": { "version": "2.0.5", @@ -7353,7 +7354,6 @@ "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "optional": true, - "peer": true, "dependencies": { "pify": "^4.0.1", "semver": "^5.6.0" @@ -7368,7 +7368,6 @@ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "optional": true, - "peer": true, "bin": { "semver": "bin/semver" } @@ -8268,7 +8267,6 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true, "optional": true, - "peer": true, "bin": { "mime": "cli.js" }, @@ -8393,7 +8391,6 @@ "integrity": "sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==", "dev": true, "optional": true, - "peer": true, "dependencies": { "debug": "^3.2.6", "iconv-lite": "^0.6.3", @@ -8412,7 +8409,6 @@ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "optional": true, - "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -8720,7 +8716,6 @@ "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", "dev": true, - "peer": true, "engines": { "node": ">= 0.10" } @@ -8838,7 +8833,6 @@ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true, "optional": true, - "peer": true, "engines": { "node": ">=6" } @@ -8969,6 +8963,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.1", @@ -9578,6 +9573,7 @@ "resolved": "https://registry.npmjs.org/preact/-/preact-10.22.1.tgz", "integrity": "sha512-jRYbDDgMpIb5LHq3hkI0bbl+l/TQ9UnkdQ0ww+lp+4MMOdqaUYdFc5qeyP+IV8FAd/2Em7drVPeKdQxsiWCf/A==", "license": "MIT", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" @@ -9735,8 +9731,7 @@ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "node_modules/pseudomap": { "version": "1.0.2", @@ -9839,6 +9834,7 @@ "version": "17.1.2", "resolved": "https://registry.npmjs.org/@preact/compat/-/compat-17.1.2.tgz", "integrity": "sha512-7pOZN9lMDDRQ+6aWvjwTp483KR8/zOpfS83wmOo3zfuLKdngS8/5RLbsFWzFZMGdYlotAhX980hJ75bjOHTwWg==", + "peer": true, "peerDependencies": { "preact": "*" } @@ -9860,6 +9856,7 @@ "version": "17.1.2", "resolved": "https://registry.npmjs.org/@preact/compat/-/compat-17.1.2.tgz", "integrity": "sha512-7pOZN9lMDDRQ+6aWvjwTp483KR8/zOpfS83wmOo3zfuLKdngS8/5RLbsFWzFZMGdYlotAhX980hJ75bjOHTwWg==", + "peer": true, "peerDependencies": { "preact": "*" } @@ -10453,6 +10450,7 @@ "integrity": "sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", "immutable": "^4.0.0", @@ -10508,8 +10506,7 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "node_modules/saxes": { "version": "6.0.0", @@ -10548,6 +10545,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -11789,6 +11787,7 @@ "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", diff --git a/src/components/FloatingToolbar/index.jsx b/src/components/FloatingToolbar/index.jsx index e44665ec..02f6ca6a 100644 --- a/src/components/FloatingToolbar/index.jsx +++ b/src/components/FloatingToolbar/index.jsx @@ -4,7 +4,6 @@ import PropTypes from 'prop-types' import { config as toolsConfig } from '../../content-script/selection-tools' import { getClientPosition, isMobile, setElementPositionInViewport } from '../../utils' import Draggable from 'react-draggable' -import { useClampWindowSize } from '../../hooks/use-clamp-window-size' import { useTranslation } from 'react-i18next' import { useConfig } from '../../hooks/use-config.mjs' @@ -19,7 +18,6 @@ function FloatingToolbar(props) { const [closeable, setCloseable] = useState(props.closeable) const [position, setPosition] = useState(getClientPosition(props.container)) const [virtualPosition, setVirtualPosition] = useState({ x: 0, y: 0 }) - const windowSize = useClampWindowSize([750, 1500], [0, Infinity]) const config = useConfig(() => { setRender(true) if (!triggered && selection) { @@ -92,10 +90,7 @@ function FloatingToolbar(props) { onStop={dragEvent.onStop} position={virtualPosition} > -
+
Date: Wed, 12 Nov 2025 01:51:05 +0530 Subject: [PATCH 2/3] Fix: Apply code review suggestions --- src/content-script/styles.scss | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/content-script/styles.scss b/src/content-script/styles.scss index 52f96dcb..a056c934 100644 --- a/src/content-script/styles.scss +++ b/src/content-script/styles.scss @@ -1362,10 +1362,9 @@ border: 0; border-top: 1px solid var(--theme-border-color); width: 100%; - // height: 100%; <-- COMMENT OUT OR DELETE THIS LINE - height: 70px; /* <-- SET A FIXED STARTING HEIGHT */ - min-height: 70px; /* <-- SET A MINIMUM HEIGHT */ - resize: none !important; /* <-- DISABLE THE TEXTAREA'S OWN RESIZE */ + height: 70px; + min-height: 70px; + resize: none !important; background-color: var(--theme-color); color: var(--font-color); @@ -1463,6 +1462,8 @@ overflow: hidden; min-width: 350px; min-height: 300px; + max-width: 90vw; + max-height: 90vh; display: flex; flex-direction: column; From 60e4731549a2657fe51c3c227a633f2001259685 Mon Sep 17 00:00:00 2001 From: Aarkay Pathak Date: Wed, 12 Nov 2025 14:40:11 +0530 Subject: [PATCH 3/3] Fix: Style 'Ask ChatGPT' button on Google search page --- src/components/FloatingToolbar/index.jsx | 2 +- src/content-script/styles.scss | 2222 +++++++++++----------- 2 files changed, 1120 insertions(+), 1104 deletions(-) diff --git a/src/components/FloatingToolbar/index.jsx b/src/components/FloatingToolbar/index.jsx index 02f6ca6a..171a66a8 100644 --- a/src/components/FloatingToolbar/index.jsx +++ b/src/components/FloatingToolbar/index.jsx @@ -90,7 +90,7 @@ function FloatingToolbar(props) { onStop={dragEvent.onStop} position={virtualPosition} > -
+