Skip to content

Commit 60012c7

Browse files
committed
fix 29
1 parent 6a60cf5 commit 60012c7

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

css/styles.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ main {
5454
flex-direction: column;
5555
height: 100%;
5656
position: relative;
57-
padding-bottom: 30px; /* Reduced space for status message */
57+
padding-top: 30px; /* Add space at top for status message */
58+
padding-bottom: 5px; /* Reduced bottom padding */
5859
}
5960

6061
.screen-content {
@@ -163,8 +164,8 @@ main {
163164
justify-content: flex-start;
164165
align-items: center;
165166
text-align: center;
166-
padding-top: 5px;
167-
padding-bottom: 60px; /* Reduced space for email button */
167+
padding-top: 10px; /* Reduced padding */
168+
padding-bottom: 50px; /* Reduced space for email button */
168169
}
169170

170171
.celebration-header {
@@ -224,7 +225,7 @@ main {
224225
gap: 8px;
225226
width: 100%;
226227
position: absolute;
227-
bottom: 35px; /* Moved up to ensure visibility */
228+
bottom: 30px; /* Moved up slightly */
228229
}
229230

230231
.action-button.email {
@@ -249,7 +250,7 @@ main {
249250
align-items: center;
250251
justify-content: center;
251252
position: absolute;
252-
bottom: 5px;
253+
top: 45px; /* Move to top instead of bottom */
253254
left: 5px;
254255
right: 5px;
255256
border: 2px solid;

js/mood-palette.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ function resetApp() {
506506
// Plugin message handler for LLM responses
507507
window.onPluginMessage = function(data) {
508508
console.log('Received plugin message:', data);
509-
showStatus('PROCESSING RESPONSE...', 'info');
510509

511510
if (data.data) {
512511
try {
@@ -538,11 +537,13 @@ window.onPluginMessage = function(data) {
538537
resetApp();
539538
}, 2000);
540539
}
541-
// Handle case where LLM requests image URL (fallback) - make this more specific
542-
else if (data.message.includes('Please provide an image URL') ||
543-
data.message.includes('need an image URL') ||
544-
data.message.includes('upload the image')) {
545-
showStatus('LLM REQUESTS IMAGE URL - UPLOADING...', 'info');
540+
// Handle case where LLM requests image URL (fallback) - make this more comprehensive
541+
else if (data.message.includes('image') &&
542+
(data.message.includes('url') ||
543+
data.message.includes('link') ||
544+
data.message.includes('file') ||
545+
data.message.includes('upload'))) {
546+
showStatus('LLM NEEDS IMAGE URL - UPLOADING...', 'info');
546547
console.log('LLM requested image URL, using catbox fallback');
547548
// Use catbox as fallback only when LLM explicitly requests it
548549
fallbackToCatboxAnalysis();
@@ -660,9 +661,9 @@ function sendImageToLLM() {
660661
// Log the image data info for debugging
661662
console.log('Sending image to LLM. Image data length:', capturedImageData ? capturedImageData.length : 'null');
662663

663-
// Send image data directly to LLM for analysis
664+
// Send image data directly to LLM for analysis with more specific instructions
664665
const payload = {
665-
message: `Please analyze the colors in this image and provide exactly 5 dominant colors in hex format. Response format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}.`,
666+
message: `I'm sending you an image captured from the R1 device's camera. Please analyze this image and extract exactly 5 dominant colors in hex format. Return ONLY a JSON object in this exact format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}. Do not request an image URL as I'm sending the image data directly.`,
666667
useLLM: true,
667668
wantsR1Response: false, // Set to false to get JSON response
668669
imageData: capturedImageData // Send image data directly
@@ -706,9 +707,9 @@ async function fallbackToCatboxAnalysis() {
706707
throw new Error('Invalid image URL received');
707708
}
708709

709-
// Send image URL to LLM for analysis
710+
// Send image URL to LLM for analysis with clearer instructions
710711
const payload = {
711-
message: `Please analyze the colors in this image and provide exactly 5 dominant colors in hex format. Response format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}. Image URL: ${imageUrl}`,
712+
message: `I've uploaded the image to ${imageUrl}. Please analyze this image and extract exactly 5 dominant colors in hex format. Return ONLY a JSON object in this exact format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}.`,
712713
useLLM: true,
713714
wantsR1Response: false // Set to false to get JSON response
714715
};

0 commit comments

Comments
 (0)