Skip to content

Commit 3ff7b7c

Browse files
committed
Updated chat bar UI with modern styles
1 parent 0d2b6d9 commit 3ff7b7c

1 file changed

Lines changed: 42 additions & 24 deletions

File tree

src/vs/workbench/contrib/roopik/browser/projectMode/scripts/inspectModeScript.ts

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -405,31 +405,35 @@ export const INSPECT_MODE_SCRIPT = `
405405
'position: fixed',
406406
'z-index: 2147483647',
407407
'display: none',
408-
'background: #1e1e1e',
409-
'border: 1px solid #3c3c3c',
410-
'border-radius: 8px',
411-
'padding: 10px',
412-
'box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4)',
413-
'width: 500px'
408+
'background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)',
409+
'border: 1px solid rgba(255, 255, 255, 0.15)',
410+
'border-radius: 12px',
411+
'padding: 12px 14px',
412+
'box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset',
413+
'max-width: 520px',
414+
'width: calc(100vw - 32px)',
415+
'backdrop-filter: blur(10px)',
416+
'box-sizing: border-box'
414417
].join(';');
415418
416419
// Chat input container (input + send button)
417420
const chatInputContainer = document.createElement('div');
418-
chatInputContainer.style.cssText = 'display: flex; gap: 8px; align-items: center;';
421+
chatInputContainer.style.cssText = 'display: flex; gap: 10px; align-items: center;';
419422
420423
const chatInput = document.createElement('input');
421424
chatInput.type = 'text';
422425
chatInput.placeholder = 'Describe changes...';
423426
chatInput.style.cssText = [
424427
'flex: 1',
425-
'background: #2d2d2d',
426-
'border: 1px solid #3c3c3c',
427-
'border-radius: 4px',
428-
'padding: 10px 12px',
429-
'color: #cccccc',
430-
'font-size: 13px',
428+
'background: rgba(255, 255, 255, 0.05)',
429+
'border: 1px solid rgba(255, 255, 255, 0.2)',
430+
'border-radius: 8px',
431+
'padding: 12px 16px',
432+
'color: #e0e0e0',
433+
'font-size: 14px',
431434
'font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif',
432-
'outline: none'
435+
'outline: none',
436+
'transition: border-color 0.2s ease, box-shadow 0.2s ease'
433437
].join(';');
434438
435439
const chatSendBtn = document.createElement('button');
@@ -446,16 +450,17 @@ export const INSPECT_MODE_SCRIPT = `
446450
sendSvg.appendChild(sendPath);
447451
chatSendBtn.appendChild(sendSvg);
448452
chatSendBtn.style.cssText = [
449-
'background: #7c3aed',
453+
'background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%)',
450454
'border: none',
451-
'border-radius: 4px',
452-
'padding: 8px',
455+
'border-radius: 8px',
456+
'padding: 10px 12px',
453457
'cursor: pointer',
454458
'color: white',
455459
'display: flex',
456460
'align-items: center',
457461
'justify-content: center',
458-
'transition: opacity 0.2s ease'
462+
'transition: all 0.2s ease',
463+
'box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4)'
459464
].join(';');
460465
461466
// Enable/disable send button based on input
@@ -467,6 +472,14 @@ export const INSPECT_MODE_SCRIPT = `
467472
}
468473
469474
chatInput.addEventListener('input', updateSendButtonState);
475+
chatInput.addEventListener('focus', function() {
476+
chatInput.style.borderColor = 'rgba(124, 58, 237, 0.6)';
477+
chatInput.style.boxShadow = '0 0 0 2px rgba(124, 58, 237, 0.2)';
478+
});
479+
chatInput.addEventListener('blur', function() {
480+
chatInput.style.borderColor = 'rgba(255, 255, 255, 0.2)';
481+
chatInput.style.boxShadow = 'none';
482+
});
470483
chatInput.addEventListener('keypress', function(e) {
471484
if (e.key === 'Enter' && chatInput.value.trim()) {
472485
sendChatMessage(chatInput.value.trim());
@@ -610,8 +623,8 @@ export const INSPECT_MODE_SCRIPT = `
610623
isChatOpen = true;
611624
612625
var rect = selectedElement.getBoundingClientRect();
613-
var barHeight = 60; // Clean input bar height
614-
var barWidth = 500;
626+
var barHeight = 60;
627+
var barWidth = 520; // Match CSS width
615628
616629
// Determine position: prefer below element, fallback to above
617630
var top, left;
@@ -627,9 +640,14 @@ export const INSPECT_MODE_SCRIPT = `
627640
top = window.innerHeight - barHeight - 20;
628641
}
629642
630-
// Horizontal: center under element, but keep in viewport
631-
left = rect.left + (rect.width / 2) - (barWidth / 2);
632-
left = Math.max(10, Math.min(left, window.innerWidth - barWidth - 10));
643+
// Horizontal positioning - CSS handles responsive width via max-width + calc
644+
var viewportWidth = window.innerWidth;
645+
var margin = 16;
646+
var actualBarWidth = Math.min(barWidth, viewportWidth - margin * 2);
647+
648+
// Center under element, but keep in viewport with margin
649+
left = rect.left + (rect.width / 2) - (actualBarWidth / 2);
650+
left = Math.max(margin, Math.min(left, viewportWidth - actualBarWidth - margin));
633651
634652
chatBar.style.top = top + 'px';
635653
chatBar.style.left = left + 'px';
@@ -668,7 +686,7 @@ export const INSPECT_MODE_SCRIPT = `
668686
669687
// Close chat bar when clicking outside
670688
document.addEventListener('click', function(e) {
671-
if (isChatOpen && !chatBar.contains(e.target) && e.target !== chatIcon) {
689+
if (isChatOpen && !chatBar.contains(e.target) && e.target !== chatButton && !chatButton.contains(e.target)) {
672690
closeChatBar();
673691
}
674692
}, true);

0 commit comments

Comments
 (0)