Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
fix(ui): match retry and act handoff buttons to subscribe secondary style
Emre Sokulluaa20e06dc231
diff --git a/src/chrome/src/ui/sidepanel.js b/src/chrome/src/ui/sidepanel.jsindex 8d975eb2f..108831bc7 100644--- a/src/chrome/src/ui/sidepanel.js+++ b/src/chrome/src/ui/sidepanel.js@@ -6654,6 +6654,15 @@ function bindErrorRetryButton(btn) {}function rebindRetryButtons() {+ document.querySelectorAll('.error-retry-btn').forEach((btn) => {+ // Migrate pre-text-style icon-only buttons restored from chat history.+ if (!btn.textContent?.trim()) {+ btn.replaceChildren();+ btn.textContent = t('sp.retry');+ if (!btn.getAttribute('aria-label')) btn.setAttribute('aria-label', t('sp.retry'));+ if (!btn.title) btn.title = t('sp.retry');+ }+ });document.querySelectorAll('.error-retry-btn, .planner-request-failure-retry-btn, .ask-act-handoff-btn').forEach(bindErrorRetryButton);}@@ -11350,13 +11359,9 @@ function addErrorRetryButton(msgEl, retryPayload) {const btn = document.createElement('button');btn.type = 'button';btn.className = 'error-retry-btn';+ btn.textContent = t('sp.retry');btn.title = t('sp.retry');btn.setAttribute('aria-label', t('sp.retry'));- btn.innerHTML = `- <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">- <polyline points="23 4 23 10 17 10"></polyline>- <path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>- </svg>`;if (configureRetryButton(btn, retryPayload)) {msgEl.querySelector('.message-content')?.appendChild(btn);}diff --git a/src/chrome/styles/sidepanel.css b/src/chrome/styles/sidepanel.cssindex 156a44c16..ed6ef1e72 100644--- a/src/chrome/styles/sidepanel.css+++ b/src/chrome/styles/sidepanel.css@@ -3854,64 +3854,45 @@ html[data-ui-scale="175"] .conversation-action-label {}.message.error.retryable .message-content {- position: relative;- padding-right: 42px;- min-height: 42px;+ display: flex;+ flex-direction: column;+ align-items: flex-start;+ gap: 10px;}-.error-retry-btn {- position: absolute;- right: 8px;- bottom: 7px;- width: 24px;- height: 24px;+.error-retry-btn,+.ask-act-handoff-btn {display: inline-flex;align-items: center;justify-content: center;- border: 1px solid rgba(244, 67, 54, 0.35);+ padding: 8px 22px;border-radius: 6px;- background: rgba(244, 67, 54, 0.08);- color: var(--error-soft);+ font-size: 13px;+ font-weight: 600;cursor: pointer;+ white-space: nowrap;transition: background 0.15s, border-color 0.15s, color 0.15s;+ background: transparent;+ color: var(--accent);+ border: 1px solid var(--accent);}-.error-retry-btn svg {- width: 14px;- height: 14px;- fill: none;- stroke: currentColor;- stroke-width: 2;- stroke-linecap: round;- stroke-linejoin: round;+.ask-act-handoff-btn {+ margin-top: 10px;+ max-width: 100%;+ white-space: normal;}.error-retry-btn:hover,-.error-retry-btn:focus-visible {- background: rgba(244, 67, 54, 0.18);- border-color: rgba(244, 67, 54, 0.55);- color: var(--text-primary);-}--.ask-act-handoff-btn {- display: inline-flex;- align-items: center;- justify-content: center;- margin-top: 10px;- padding: 6px 11px;- border: 1px solid rgba(96, 165, 250, 0.45);- border-radius: 6px;- background: rgba(96, 165, 250, 0.12);+.ask-act-handoff-btn:hover {+ background: var(--accent-dim);color: var(--text-primary);- cursor: pointer;- font: inherit;- transition: background 0.15s, border-color 0.15s, color 0.15s;}-.ask-act-handoff-btn:hover,+.error-retry-btn:focus-visible,.ask-act-handoff-btn:focus-visible {- background: rgba(96, 165, 250, 0.22);- border-color: rgba(96, 165, 250, 0.7);+ outline: 2px solid var(--accent);+ outline-offset: 2px;}/* WebBrain Compass quota / subscribe prompt — bare URL upgraded to a button */diff --git a/src/firefox/src/ui/sidepanel.js b/src/firefox/src/ui/sidepanel.jsindex d95ff3cb1..0b0eefd7c 100644--- a/src/firefox/src/ui/sidepanel.js+++ b/src/firefox/src/ui/sidepanel.js@@ -6488,6 +6488,15 @@ function bindErrorRetryButton(btn) {}function rebindRetryButtons() {+ document.querySelectorAll('.error-retry-btn').forEach((btn) => {+ // Migrate pre-text-style icon-only buttons restored from chat history.+ if (!btn.textContent?.trim()) {+ btn.replaceChildren();+ btn.textContent = t('sp.retry');+ if (!btn.getAttribute('aria-label')) btn.setAttribute('aria-label', t('sp.retry'));+ if (!btn.title) btn.title = t('sp.retry');+ }+ });document.querySelectorAll('.error-retry-btn, .planner-request-failure-retry-btn, .ask-act-handoff-btn').forEach(bindErrorRetryButton);}@@ -10952,13 +10961,9 @@ function addErrorRetryButton(msgEl, retryPayload) {const btn = document.createElement('button');btn.type = 'button';btn.className = 'error-retry-btn';+ btn.textContent = t('sp.retry');btn.title = t('sp.retry');btn.setAttribute('aria-label', t('sp.retry'));- btn.innerHTML = `- <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">- <polyline points="23 4 23 10 17 10"></polyline>- <path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>- </svg>`;if (configureRetryButton(btn, retryPayload)) {msgEl.querySelector('.message-content')?.appendChild(btn);}diff --git a/src/firefox/styles/sidepanel.css b/src/firefox/styles/sidepanel.cssindex 1bd30f880..dfb26c28d 100644--- a/src/firefox/styles/sidepanel.css+++ b/src/firefox/styles/sidepanel.css@@ -3693,64 +3693,45 @@ html[data-ui-scale="175"] .conversation-action-label {}.message.error.retryable .message-content {- position: relative;- padding-right: 42px;- min-height: 42px;+ display: flex;+ flex-direction: column;+ align-items: flex-start;+ gap: 10px;}-.error-retry-btn {- position: absolute;- right: 8px;- bottom: 7px;- width: 24px;- height: 24px;+.error-retry-btn,+.ask-act-handoff-btn {display: inline-flex;align-items: center;justify-content: center;- border: 1px solid rgba(244, 67, 54, 0.35);+ padding: 8px 22px;border-radius: 6px;- background: rgba(244, 67, 54, 0.08);- color: var(--error-soft);+ font-size: 13px;+ font-weight: 600;cursor: pointer;+ white-space: nowrap;transition: background 0.15s, border-color 0.15s, color 0.15s;+ background: transparent;+ color: var(--accent);+ border: 1px solid var(--accent);}-.error-retry-btn svg {- width: 14px;- height: 14px;- fill: none;- stroke: currentColor;- stroke-width: 2;- stroke-linecap: round;- stroke-linejoin: round;+.ask-act-handoff-btn {+ margin-top: 10px;+ max-width: 100%;+ white-space: normal;}.error-retry-btn:hover,-.error-retry-btn:focus-visible {- background: rgba(244, 67, 54, 0.18);- border-color: rgba(244, 67, 54, 0.55);- color: var(--text-primary);-}--.ask-act-handoff-btn {- display: inline-flex;- align-items: center;- justify-content: center;- margin-top: 10px;- padding: 6px 11px;- border: 1px solid rgba(96, 165, 250, 0.45);- border-radius: 6px;- background: rgba(96, 165, 250, 0.12);+.ask-act-handoff-btn:hover {+ background: var(--accent-dim);color: var(--text-primary);- cursor: pointer;- font: inherit;- transition: background 0.15s, border-color 0.15s, color 0.15s;}-.ask-act-handoff-btn:hover,+.error-retry-btn:focus-visible,.ask-act-handoff-btn:focus-visible {- background: rgba(96, 165, 250, 0.22);- border-color: rgba(96, 165, 250, 0.7);+ outline: 2px solid var(--accent);+ outline-offset: 2px;}/* WebBrain Compass quota / subscribe prompt — bare URL upgraded to a button */