extraInfo: show extra info in the canned responses list
Bug: twpowertools:93
Change-Id: I8d81391cb931f2096c704b50ff4f3cc9037b8c6e
diff --git a/src/contentScripts/communityConsole/main.js b/src/contentScripts/communityConsole/main.js
index a534f38..73ed360 100644
--- a/src/contentScripts/communityConsole/main.js
+++ b/src/contentScripts/communityConsole/main.js
@@ -44,6 +44,10 @@
// Unified profile iframe
'iframe',
+
+ // Canned response tags or toolbelt (for the extra info feature)
+ '.tags',
+ '.toolbelt',
];
function handleCandidateNode(node) {
@@ -149,6 +153,15 @@
unifiedProfilesFix.checkIframe(node)) {
unifiedProfilesFix.fixIframe(node);
}
+
+ // Show additional details in the canned responses view.
+ if (node.matches('ec-canned-response-row .tags')) {
+ window.TWPTExtraInfo.injectAtCRIfEnabled(node, /* isExpanded = */ false);
+ }
+ if (node.matches('ec-canned-response-row .main .toolbelt')) {
+ const tags = node.parentNode?.querySelector?.('.tags');
+ if (tags) window.TWPTExtraInfo.injectAtCRIfEnabled(tags, /* isExpanded = */ true);
+ }
}
}