Skip to content

Commit 2d3ffdb

Browse files
CopilotPDowney
andauthored
fix(external-services): fix cache comment accuracy, add keyboard reorder instructions, and name magic number constant
Agent-Logs-Url: https://github.com/EngineScript/EngineScript/sessions/993246a3-b5f5-4372-b259-830ad04ed941 Co-authored-by: PDowney <[email protected]>
1 parent a5a1e84 commit 2d3ffdb

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ Changes are organized by date, with the most recent changes listed first.
66

77
## 2026-04-11
88

9+
### 🔧 EXTERNAL-SERVICES.JS CODE QUALITY IMPROVEMENTS
10+
11+
- Updated cache comment from "LRU cache" to "TTL cache and FIFO eviction" to accurately describe the eviction strategy used in `external-services.js`.
12+
- Added keyboard navigation instructions to the settings header text, informing users they can press Enter to activate reorder mode and use arrow keys to move service cards.
13+
- Extracted the magic number `7` (CSSRule.KEYFRAMES_RULE fallback) into a named constant `LEGACY_KEYFRAMES_RULE_TYPE` with an explanatory comment for clarity and maintainability.
14+
15+
## 2026-04-11
16+
917
### 🔧 VHOST IMPORT BUG FIXES & IMPROVEMENTS
1018

1119
- Updated the single-zip database file detection in `scripts/functions/vhost/vhost-import.sh` to search for both `*.sql` and `*.sql.gz` patterns, so compressed database dumps are correctly found and imported instead of failing silently.

config/var/www/admin/control-panel/external-services/external-services.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class ExternalServicesManager {
3333
this.container = document.querySelector(containerSelector);
3434
this.settingsContainer = document.querySelector(settingsContainerSelector);
3535

36-
// State management with LRU cache (5-minute TTL, max 100 entries)
36+
// State management with TTL cache and FIFO eviction (5-minute TTL, max 100 entries)
3737
this.serviceCache = new Map();
3838
this.cacheTTL = 5 * 60 * 1000; // 5 minutes in milliseconds
3939
this.cacheMaxSize = 100; // Limit cache size to prevent memory growth
@@ -489,7 +489,7 @@ export class ExternalServicesManager {
489489
const settingsHeader = document.createElement("div");
490490
settingsHeader.className = "settings-header";
491491
const headerP = document.createElement("p");
492-
headerP.textContent = 'Toggle services to show/hide on the dashboard. Drag service cards to reorder them. Click "Save Changes" to apply. Services are organized by category.';
492+
headerP.textContent = 'Toggle services to show/hide on the dashboard. Drag service cards to reorder them, or use the keyboard: press Enter to activate reorder mode and use arrow keys to move cards. Click "Save Changes" to apply. Services are organized by category.';
493493
settingsHeader.appendChild(headerP);
494494
settingsContent.appendChild(settingsHeader);
495495

@@ -1727,7 +1727,9 @@ export class ExternalServicesManager {
17271727
*/
17281728
hasAnimationKeyframes(animationName) {
17291729
const styleSheets = Array.from(document.styleSheets || []);
1730-
const keyframesType = typeof CSSRule !== 'undefined' ? CSSRule.KEYFRAMES_RULE : 7;
1730+
// Standard CSSOM numeric value for KEYFRAMES_RULE, used when CSSRule.KEYFRAMES_RULE is unavailable (legacy browsers).
1731+
const LEGACY_KEYFRAMES_RULE_TYPE = 7;
1732+
const keyframesType = typeof CSSRule !== 'undefined' ? CSSRule.KEYFRAMES_RULE : LEGACY_KEYFRAMES_RULE_TYPE;
17311733

17321734
for (const styleSheet of styleSheets) {
17331735
const rules = this.getSheetRules(styleSheet);

0 commit comments

Comments
 (0)