Skip to content

Commit 5a0a1c0

Browse files
committed
Touch up theme aplicator
1 parent b7a6f13 commit 5a0a1c0

File tree

6 files changed

+12
-27
lines changed

6 files changed

+12
-27
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ npm build.js
4545

4646
## TODO List
4747

48+
### Element inspector
49+
* [ ] Fix element inspector aplication
50+
* [ ] Add element inspector to AI
51+
4852
### Editor
4953

5054
* [ ] Reduce editor bundle size (~1.4 MB currently)
@@ -56,6 +60,7 @@ npm build.js
5660
### UI
5761
* [ ] Fix editor optimizations
5862
* [ ] Can you make it so if you have mutiple scripts running at once on the same page the notifications will expand verticlly and not all overlap
63+
* [ ] Improve AI settings UI layout
5964

6065
---
6166

src/_locales/en/messages.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,9 @@
386386
"aiSettingsSelectProvider": {
387387
"message": "Select a provider..."
388388
},
389-
"aiSettingsProviderHint": {
390-
"message": "Choose your AI provider"
391-
},
392389
"aiSettingsApiKey": {
393390
"message": "API Key"
394391
},
395-
"aiSettingsApiKeyHint": {
396-
"message": "Your API key is stored locally and never sent to external servers"
397-
},
398392
"aiSettingsApiEndpoint": {
399393
"message": "API Endpoint"
400394
},
@@ -410,9 +404,6 @@
410404
"aiSettingsFetchModels": {
411405
"message": "Fetch Models"
412406
},
413-
"aiSettingsModelHint": {
414-
"message": "AI model to use for code generation"
415-
},
416407
"aiSettingsAdvanced": {
417408
"message": "Advanced Settings"
418409
},

src/ai_dom_editor/settings/ai_settings.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>AI DOM Editor Settings</title>
77
<link rel="stylesheet" href="../../assets/styles/ai/ai_settings.css">
8+
<script src="../../utils/theme_manager.js"></script>
89
</head>
910
<body>
1011
<div class="settings-container">
@@ -42,7 +43,6 @@ <h3>Getting Started</h3>
4243
<li>OpenAI: <a href="https://platform.openai.com/api-keys" target="_blank">platform.openai.com</a></li>
4344
<li>Anthropic: <a href="https://console.anthropic.com/" target="_blank">console.anthropic.com</a></li>
4445
<li>Google Gemini: <a href="https://aistudio.google.com/app/apikey" target="_blank">aistudio.google.com</a></li>
45-
<li>For Gemini: Select "Google (Gemini)" provider and your model - the endpoint will be configured automatically</li>
4646
</ul>
4747
</div>
4848
</div>
@@ -87,7 +87,6 @@ <h2>AI Provider Configuration</h2>
8787
<option value="aimlapi">AIML API</option>
8888
<option value="custom">Custom Endpoint</option>
8989
</select>
90-
<span class="form-hint">Choose your AI provider</span>
9190
</div>
9291

9392
<!-- API Key -->
@@ -107,7 +106,6 @@ <h2>AI Provider Configuration</h2>
107106
<i data-feather="eye" width="18" height="18"></i>
108107
</button>
109108
</div>
110-
<span class="form-hint">Your API key is stored locally and never sent to external servers</span>
111109
</div>
112110

113111
<!-- Endpoint (shown for custom provider) -->
@@ -139,7 +137,6 @@ <h2>AI Provider Configuration</h2>
139137
Fetch Models
140138
</button>
141139
</div>
142-
<span class="form-hint">AI model to use for code generation</span>
143140
</div>
144141

145142
<!-- Advanced Settings -->

src/ai_dom_editor/settings/ai_settings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class AISettings {
5555
}
5656

5757
async init() {
58+
window.applyTheme();
5859
await this.loadSettings();
5960
this.setupEventListeners();
6061
feather.replace();

src/editor/editor.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ class ScriptEditor {
335335
}
336336
this.setupBackgroundConnection();
337337
this.codeEditorManager.updateEditorLintAndAutocomplete();
338-
this.applyTheme();
338+
window.applyTheme();
339339

340340
setTimeout(() => this.codeEditorManager.focus(), 100);
341341
} catch (error) {
@@ -470,25 +470,17 @@ class ScriptEditor {
470470

471471
const { code, sourceUrl } = aiData;
472472

473-
console.log('📥 Loading AI-generated script...');
474-
475473
// Validate and enhance the AI-generated script
476474
const enhanced = ScriptAnalyzer.validateAndEnhanceMetadata(code, {
477475
url: sourceUrl || '',
478476
hostname: sourceUrl ? new URL(sourceUrl).hostname : '',
479477
userPrompt: 'AI Generated Script'
480478
});
481-
482-
// Log detected APIs and any warnings
483-
console.log('🔍 Analysis complete:');
484-
console.log(' 📊 Detected GM APIs:', Object.keys(enhanced.detectedApis || {}).length);
485479

486480
if (enhanced.warnings && enhanced.warnings.length > 0) {
487-
console.log(' ⚠️ Issues found and fixed:');
488481
enhanced.warnings.forEach(warning => {
489-
console.log(` - ${warning.message}`);
490482
if (warning.suggestion) {
491-
console.log(` 💡 ${warning.suggestion}`);
483+
console.log(` ${warning.suggestion}`);
492484
}
493485
});
494486

@@ -516,9 +508,8 @@ class ScriptEditor {
516508
// Clean up storage
517509
await chrome.storage.local.remove(key);
518510

519-
console.log('✅ AI script loaded successfully');
520511
} catch (err) {
521-
console.error('Error loading AI script:', err);
512+
console.error('Error loading AI script:', err);
522513
this.ui.showStatusMessage('Failed to load AI-generated script', 'error');
523514
}
524515
}

src/utils/theme_manager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
function applyTheme() {
1+
window.applyTheme = function() {
22
chrome.storage.local.get('settings', function(result) {
33
if (result.settings && result.settings.accentColor) {
44
document.documentElement.style.setProperty('--accent-color', result.settings.accentColor);
55
} else {
66
document.documentElement.style.setProperty('--accent-color', '#007bff');
77
}
88
});
9-
}
9+
}

0 commit comments

Comments
 (0)