UX: hide AI gists on routes where the toggle isn't present (#35717)

AI gists were appearing in some places they shouldn't, like
/my/activity/topics — this adds a check for the correct routes
This commit is contained in:
Kris
2025-10-31 13:12:19 -04:00
committed by GitHub
parent 31db0dc9d9
commit f47f95e6c8
@@ -92,12 +92,33 @@ export default apiInitializer((api) => {
desktop: "topic-list-topic-cell-link-bottom-line__before",
};
function isGistEnabledRoute(routeName) {
if (routeName?.startsWith("discovery.")) {
return true;
}
if (routeName?.startsWith("filter")) {
return true;
}
if (routeName?.startsWith("userPrivateMessages")) {
return true;
}
return false;
}
function renderGistInOutlet(outletName, shouldRenderFn) {
api.renderInOutlet(
outletName,
class extends Component {
static shouldRender(args, context) {
return shouldRenderFn(context);
static shouldRender(args, context, owner) {
if (!shouldRenderFn(context)) {
return false;
}
const router = owner.lookup("service:router");
return isGistEnabledRoute(router.currentRouteName);
}
<template><AiTopicGist @topic={{@topic}} /></template>