diff --git a/indra/newview/llfloaterprofilelegacy.cpp b/indra/newview/llfloaterprofilelegacy.cpp
index e2dde1b597cf2c3b03c2b5d58d4d7ea9fc557896..13fc840164a9c7f1a92fa82afe0f419704059f0b 100644
--- a/indra/newview/llfloaterprofilelegacy.cpp
+++ b/indra/newview/llfloaterprofilelegacy.cpp
@@ -70,7 +70,12 @@ void LLFloaterProfileLegacy::onAvatarNameCache(const LLUUID& agent_id, const LLA
 	mAvatarNameCacheConnection.disconnect();
 }
 
-void LLFloaterProfileLegacy::openTab(std::string_view tab_name) const
+void LLFloaterProfileLegacy::showTab(std::string_view tab_name) const
 {
-    if (mPanel) { mPanel->showAccordion(tab_name, true); }
+    if (mPanel) { mPanel->showTab(tab_name, true); }
+}
+
+std::string_view LLFloaterProfileLegacy::getShownTab() const
+{
+    return mPanel != nullptr ? mPanel->getShownTab() : LLStringUtil::null;
 }
diff --git a/indra/newview/llfloaterprofilelegacy.h b/indra/newview/llfloaterprofilelegacy.h
index 545447422f13062065f05de47e361846baf85d47..9729009a146ce495d37a0c61605e1ac61a5e5af7 100644
--- a/indra/newview/llfloaterprofilelegacy.h
+++ b/indra/newview/llfloaterprofilelegacy.h
@@ -42,7 +42,8 @@ class LLFloaterProfileLegacy final : public LLFloater
 	LLFloaterProfileLegacy(LLSD const& key);
 	BOOL postBuild() override;
 	void onOpen(const LLSD& key) override;
-    void openTab(std::string_view tab_name) const;
+    void showTab(std::string_view tab_name) const;
+    std::string_view getShownTab() const;
 
 private:
 	~LLFloaterProfileLegacy() override;
diff --git a/indra/newview/llpanelprofilelegacy.cpp b/indra/newview/llpanelprofilelegacy.cpp
index 0b1f631a4868ecb1ad9633542ae2a4dd14ae6162..f39090fcb2cda42e659730b207608a0788032de8 100644
--- a/indra/newview/llpanelprofilelegacy.cpp
+++ b/indra/newview/llpanelprofilelegacy.cpp
@@ -497,7 +497,7 @@ void LLPanelProfileLegacy::processProperties(void* data, EAvatarProcessorType ty
 			const LLAvatarGroups* pData = static_cast<LLAvatarGroups*>(data);
 			if(!pData || getAvatarId() != pData->avatar_id) return;
 			
-			showAccordion("avatar_groups_tab", !pData->group_list.empty());
+			showTab("avatar_groups_tab", !pData->group_list.empty());
 			break;
 		}
 		// These are handled by their respective panels
@@ -523,13 +523,19 @@ void LLPanelProfileLegacy::setProgress(bool started)
 		indicator->stop();
 }
 
-void LLPanelProfileLegacy::showAccordion(std::string_view name, bool show)
+void LLPanelProfileLegacy::showTab(std::string_view name, bool show) const
 {
 	LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name);
 	tab->setVisible(show);
 	getChild<LLAccordionCtrl>("avatar_accordion")->arrange();
 }
 
+std::string_view LLPanelProfileLegacy::getShownTab() const
+{
+    const LLAccordionCtrlTab* tab = getChild<LLAccordionCtrl>("avatar_accordion")->getExpandedTab();
+    return tab != nullptr ? tab->getTitle() : LLStringUtil::null;
+}
+
 void LLPanelProfileLegacy::onCommitAction(const LLSD& userdata)
 {
 	const std::string action = userdata.asString();
@@ -1192,9 +1198,9 @@ void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelClassifiedSave(LLPanelCla
 		c_item->setMouseUpCallback(boost::bind(&LLPanelProfilePicks::updateButtons, this));
 		c_item->childSetAction("info_chevron", boost::bind(&LLPanelProfilePicks::onClickInfo, this));
 
-		// order does matter, showAccordion will invoke arrange for accordions.
+		// order does matter, showTab will invoke arrange for accordions.
 		//mClassifiedsAccTab->changeOpenClose(false);
-		//showAccordion("tab_classifieds", true);
+		//showTab("tab_classifieds", true);
 	}
 	else if (panel->isNewWithErrors())
 	{
diff --git a/indra/newview/llpanelprofilelegacy.h b/indra/newview/llpanelprofilelegacy.h
index dd3e77df3a9fcc0d14dd5581d8f84896dfdbb259..a56f9f1c3a0b61ce98bd18a288dcac466fa820d7 100644
--- a/indra/newview/llpanelprofilelegacy.h
+++ b/indra/newview/llpanelprofilelegacy.h
@@ -54,7 +54,8 @@ class LLPanelProfileLegacy final : public LLPanelProfileLegacyTab
 	BOOL postBuild() override;
 	void onOpen(const LLSD& key) override;
 	void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override;
-    void showAccordion(std::string_view name, bool show);
+    void showTab(std::string_view name, bool show) const;
+    std::string_view getShownTab() const;
 
 protected:
 	void openPanel(LLPanel* panel, const LLSD& params);