googleapis/mcp-toolbox · info

Failed to save panel width:

Error message

Failed to save panel width:

What it means

After the user finishes dragging the panel resize handle (onMouseUp), resize.js saves the new width to localStorage via setItem. If storage is unavailable or quota is exceeded, the write throws and the code logs this warning. The layout still works for the session; persistence is simply skipped.

Source

Thrown at internal/server/static/js/resize.js:77

        const clampedWidth = Math.max(MIN_WIDTH, Math.min(newWidth, maxWidth));
        setPanelWidth(secondNav, clampedWidth);
    };

    const onMouseUp = () => {
        document.removeEventListener('mousemove', onMouseMove);
        document.removeEventListener('mouseup', onMouseUp);

        resizeHandle.classList.remove('active');
        document.body.style.cursor = '';
        document.body.style.userSelect = '';

        // Save width to localStorage
        try {
            localStorage.setItem(STORAGE_KEY, secondNav.offsetWidth.toString());
        } catch (e) {
            // localStorage may be unavailable in private browsing mode
            console.warn('Failed to save panel width:', e);
        }
    };

    resizeHandle.addEventListener('mousedown', (e) => {
        startX = e.clientX;
        startWidth = secondNav.offsetWidth;
        resizeHandle.classList.add('active');
        document.body.style.cursor = 'ew-resize';
        document.body.style.userSelect = 'none';
        e.preventDefault();

        document.addEventListener('mousemove', onMouseMove);
        document.addEventListener('mouseup', onMouseUp);
    });

    // Handle window resize to enforce max width
    window.addEventListener('resize', () => {
        const currentWidth = secondNav.offsetWidth;

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. No action required — resizing still works, only persistence is skipped
  2. Free browser storage / clear old site data to resolve quota errors
  3. Allow site data for the toolbox origin in browser settings
  4. Reopen the UI outside private browsing to persist the width
Defensive patterns

Strategy: try-catch

Validate before calling

function canPersist() {
  try { localStorage.setItem('__t', '1'); localStorage.removeItem('__t'); return true; } catch (e) { return false; }
}

Try / catch

try { localStorage.setItem(key, width); } catch (e) { console.debug('width not persisted:', e); }

Prevention

When it happens

Trigger: Completing a panel resize while localStorage.setItem throws: storage blocked by browser settings/extensions, private browsing, quota exceeded (storage full), or document sandboxed.

Common situations: Quota-full browsers with many stored sites; privacy extensions; embedded UI in sandboxed iframe; enterprise policies disabling web storage.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/21cbea79e16c728f. Report an issue: GitHub.