Skip to content

Commit 9b04e15

Browse files
committed
2 parents ed9b76f + f78e741 commit 9b04e15

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

code-notes.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ The OneClickPrompts extension enhances AI chat platforms like ChatGPT, Claude, C
6060
* **Dependencies:**
6161
* **config.js (Service Worker):** Directly communicates with the service worker using `chrome.runtime.sendMessage` to save and load panel settings per website hostname. Sends messages with types 'getFloatingPanelSettings' and 'saveFloatingPanelSettings'.
6262
* **utils.js:** Uses utility functions for logging.
63-
* **profile-switcher.js:** For managing profile switching within the floating panel.
6463

6564
### `floating-panel-ui-creation.js`
6665

@@ -71,6 +70,9 @@ The OneClickPrompts extension enhances AI chat platforms like ChatGPT, Claude, C
7170
* `makeDraggable()`: Enables drag functionality on an element via a handle
7271
* `positionPanelAtCursor()`: Positions the panel relative to the mouse cursor
7372
* `createPanelToggleButton()`: Creates the toggle button for summoning the floating panel
73+
* **Dependencies:**
74+
* **floating-panel.js:** Uses the namespace and properties defined here
75+
* **utils.js:** Uses logging utilities
7476

7577
### `floating-panel-ui-interaction.js`
7678

@@ -81,6 +83,10 @@ The OneClickPrompts extension enhances AI chat platforms like ChatGPT, Claude, C
8183
* `updatePanelFromSettings()`: Updates the panel's appearance and position
8284
* `restorePanelState()`: Restores the panel visibility based on saved settings
8385
* `refreshButtonsInPanel()`: Refreshes the buttons displayed in the panel after a profile switch
86+
* **Dependencies:**
87+
* **floating-panel.js:** Uses the namespace and properties defined here
88+
* **utils.js:** Uses logging utilities
89+
* **floating-panel-ui-creation.js:** Calls methods from here during panel initialization
8490

8591
### `floating-panel-settings.js`
8692

@@ -91,6 +97,11 @@ The OneClickPrompts extension enhances AI chat platforms like ChatGPT, Claude, C
9197
* `debouncedSavePanelSettings()`: Waits 150ms before saving to reduce storage operations
9298
* `loadAvailableProfiles()`: Gets list of profiles from the service worker
9399
* `switchToProfile()`: Changes the current profile and refreshes floating panel content
100+
* **Dependencies:**
101+
* **floating-panel.js:** Uses the namespace and properties defined here
102+
* **floating-panel-ui-creation.js:** Calls the profile switcher creation method
103+
* **floating-panel-ui-interaction.js:** Calls methods to update the UI and refresh buttons
104+
* **config.js (Service Worker):** Communicates with the service worker for settings persistence
94105

95106
### Code File Dependencies for Floating Panel:
96107

@@ -107,6 +118,13 @@ The OneClickPrompts extension enhances AI chat platforms like ChatGPT, Claude, C
107118
3. Panel is positioned and displayed immediately
108119
4. Settings are saved asynchronously
109120

121+
* **Implementation Notes:**
122+
* The floating panel UI was split into creation and interaction files to better separate concerns
123+
* Creation methods handle the DOM structure and initial behavior setup
124+
* Interaction methods manage state transitions and dynamic behavior
125+
* All methods share the same namespace (`window.MaxExtensionFloatingPanel`) defined in `floating-panel.js`
126+
* This modular approach makes the code more maintainable while preserving functionality
127+
110128
### `init.js`
111129

112130
* **Purpose:** Main initialization script for the content script.

0 commit comments

Comments
 (0)