diff --git a/extension/content.js b/extension/content.js index 0bfdbeb..904d7e7 100644 --- a/extension/content.js +++ b/extension/content.js @@ -875,16 +875,29 @@ function ensureTrackerActionsContainer(container) { container.appendChild(actionsContainer); } + // Pull any legacy/orphan action elements into the single canonical actions container. + const orphanActions = Array.from( + container.querySelectorAll('.fb-tracker-ai-wrapper, .fb-tracker-webapp-link') + ).filter((node) => node && node.parentElement && node.parentElement !== actionsContainer); + orphanActions.forEach((node) => actionsContainer.appendChild(node)); + + // Keep action row last so status/content remains on its own row. + if (actionsContainer.parentElement === container) { + container.appendChild(actionsContainer); + } + actionsContainer.style.cssText = ` - margin-left: auto; + margin-left: 0; + margin-top: 4px; display: flex; align-items: center; - justify-content: flex-end; + justify-content: flex-start; gap: 8px; flex-wrap: wrap; min-width: 0; + width: 100%; max-width: 100%; - flex: 1 1 auto; + flex: 0 0 100%; `; return actionsContainer; @@ -6287,6 +6300,7 @@ async function addAICommentButton(container, postElement) { transition: transform 0.2s ease, box-shadow 0.2s ease; flex: 0 1 auto; max-width: 100%; + white-space: nowrap; `; const button = document.createElement('button');