Expand All Comments by default

Hi @David_Hauslaib,

The extension works perfectly for me and is very helpful :slight_smile:

However, I actually prefer to expand all comments only when I need to do, so I created a bookmarklet.
When I click the icon in the bookmark bar, “X more comments”, “See more”, and “Show X previous updates” are clicked and all comments are expanded.
It might be more useful to develop a Chrome extension with the same feature, but for now I think this is a good quick way.

// Add a bookmark from any page, click "More..." or "Edit..." and add this:
javascript:(function(){
	const expandLink = document.querySelector('.TaskStoryFeed-expandLink');
	if (expandLink && expandLink.textContent.match(/\d/)) expandLink.click();
	document.querySelectorAll('.TruncatedRichText-expand').forEach(link => link.click());
	document.querySelectorAll('.TaskStoryFeed-expandMiniStoriesLink').forEach(link => link.click());
})();

// `match(/\d/)` → We need to check that the expand link is not "Hide earlier comments"
// `expandLink.click();` works immediately so I didn't need to use `setTimeout` for `forEach(link => link.click());`
// EDIT: I added a line to expand "mini stories" with `.TaskStoryFeed-expandMiniStoriesLink`

Update in July 2022: I created Introduction to Asana bookmarklets to discuss more about bookmarklets and show more examples.

1 Like