claude-dev-server 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -191,6 +191,18 @@ html, body {
191
191
  const originalPath = '__CLAUDE_ORIGINAL_PATH__';
192
192
  const iframeSrc = '__CLAUDE_IFRAME_SRC__';
193
193
 
194
+ // Prevent dev.html from being loaded inside an iframe (nested loading)
195
+ // If we detect we're in an iframe, redirect to the actual dev server content
196
+ (function preventNestedLoading() {
197
+ if (window.top !== window.self) {
198
+ // We're inside an iframe - this should not happen for dev.html
199
+ // Redirect this iframe to the actual dev server content
200
+ console.log('[Claude Dev Server Wrapper] Detected nested iframe loading, redirecting to:', iframeSrc);
201
+ window.location.href = iframeSrc;
202
+ return;
203
+ }
204
+ })();
205
+
194
206
  const urlParams = new URLSearchParams(window.location.search);
195
207
  const wsPort = urlParams.get('wsPort');
196
208
 
@@ -500,8 +512,35 @@ html, body {
500
512
  divider.addEventListener('touchstart', startDrag);
501
513
 
502
514
  // Listen for orientation changes
503
- window.matchMedia('(orientation: portrait)').addEventListener('change', (e) => {
515
+ const orientationQuery = window.matchMedia('(orientation: portrait)');
516
+ orientationQuery.addEventListener('change', (e) => {
504
517
  isPortrait = e.matches;
518
+
519
+ // Only need to adjust leftPanel, rightPanel stays flex: 1
520
+ const leftPanelEl = document.querySelector('.claude-dev-server-left');
521
+
522
+ if (e.matches) {
523
+ // Switching to portrait: ensure leftPanel width is 100%
524
+ if (leftPanelEl) {
525
+ leftPanelEl.style.width = '100%';
526
+ }
527
+ } else {
528
+ // Switching to landscape: clear inline styles
529
+ if (leftPanelEl) {
530
+ leftPanelEl.style.width = '';
531
+ leftPanelEl.style.height = '';
532
+ }
533
+ }
534
+
535
+ // Trigger resize events in iframes to notify their content
536
+ setTimeout(() => {
537
+ const iframes = document.querySelectorAll('iframe');
538
+ iframes.forEach(iframe => {
539
+ if (iframe.contentWindow) {
540
+ iframe.contentWindow.dispatchEvent(new Event('resize'));
541
+ }
542
+ });
543
+ }, 100);
505
544
  });
506
545
 
507
546
  function startDrag(e) {
@@ -522,6 +561,7 @@ html, body {
522
561
 
523
562
  if (container && leftPanelEl) {
524
563
  containerSize = isPortrait ? container.offsetHeight : container.offsetWidth;
564
+ // Always measure leftPanel
525
565
  startSize = isPortrait ? leftPanelEl.offsetHeight : leftPanelEl.offsetWidth;
526
566
  }
527
567
 
@@ -541,25 +581,34 @@ html, body {
541
581
 
542
582
  // Use appropriate axis based on orientation
543
583
  const currentValue = isPortrait ? clientY : clientX;
544
- const delta = currentValue - startValue;
584
+ // Calculate delta: dragging down/right = positive, dragging up/left = negative
585
+ let delta = currentValue - startValue;
586
+
587
+ // In portrait with column-reverse: dragging down (positive) should make leftPanel smaller
588
+ if (isPortrait) {
589
+ delta = -delta;
590
+ }
545
591
 
546
592
  let newSize = startSize + delta;
547
593
  let percentage = (newSize / containerSize) * 100;
548
594
  const clamped = Math.max(20, Math.min(80, percentage));
549
595
 
550
596
  const leftPanelEl = document.querySelector('.claude-dev-server-left');
597
+
551
598
  if (leftPanelEl) {
552
- leftPanelEl.style.flex = 'none';
553
599
  if (isPortrait) {
554
- // Portrait: adjust height
600
+ // Portrait: adjust leftPanel (bottom) height, width is 100%
601
+ leftPanelEl.style.flex = 'none';
555
602
  leftPanelEl.style.height = clamped + '%';
556
- leftPanelEl.style.width = '';
603
+ leftPanelEl.style.width = '100%';
557
604
  } else {
558
- // Landscape: adjust width
605
+ // Landscape: adjust leftPanel (left) width
606
+ leftPanelEl.style.flex = 'none';
559
607
  leftPanelEl.style.width = clamped + '%';
560
- leftPanelEl.style.height = '';
561
608
  }
562
609
  }
610
+
611
+ // rightPanel stays flex: 1, no modifications needed
563
612
  }
564
613
 
565
614
  function endDrag() {