From c7ada89a7f2e46a2f3eb21f0e3f607dd0c1c9844 Mon Sep 17 00:00:00 2001 From: Tinker Date: Tue, 15 Sep 2026 13:04:34 +0200 Subject: [PATCH 1/2] [FIRE-34881] Make Library root folder optional, toggled from the inventory gear menu --- indra/newview/app_settings/settings.xml | 13 ++++++ indra/newview/llinventorypanel.cpp | 41 ++++++++++++++++++- indra/newview/llinventorypanel.h | 4 ++ indra/newview/llpanelmaininventory.cpp | 17 ++++++++ .../xui/en/menu_inventory_gear_default.xml | 16 ++++++++ 5 files changed, 90 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2093e0b8005..0d5e5bb07fa 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -23916,6 +23916,19 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + + FSShowLibraryFolder + + Comment + Show/hide the Library root folder in the Inventory floater + Persist + 1 + Type + Boolean + Value + 1 + + StatsReportMaxDuration Comment diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index dc4828c30f6..b3a9c57e444 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1122,10 +1122,49 @@ void LLInventoryPanel::initRootContent() // Default case: always add "My Inventory" root first, "Library" root second // If we run out of time, this still should create root folders buildNewViews(gInventory.getRootFolderID()); // My Inventory - buildNewViews(gInventory.getLibraryRootFolderID()); // Library + // [FIRE-34881] Library root is now optional, toggled from the + // inventory gear menu, instead of being permanently disabled + // buildNewViews(gInventory.getLibraryRootFolderID()); // Library + if (gSavedSettings.getBOOL("FSShowLibraryFolder")) + { + buildNewViews(gInventory.getLibraryRootFolderID()); // Library + } + // } } +// [FIRE-34881] Build or tear down the Library root view live, without a restart. +// Only touches this panel's folder VIEW - the underlying gInventory data for +// Library stays loaded regardless, since other systems (default attachments, +// outfit lookups, etc.) depend on being able to resolve the Library folder ID. +void LLInventoryPanel::setLibraryFolderVisible(bool visible) +{ + const LLUUID library_id = gInventory.getLibraryRootFolderID(); + if (library_id.isNull()) + { + return; + } + + LLFolderViewItem* library_view = getItemByID(library_id); + if (visible) + { + if (!library_view) + { + buildNewViews(library_id); + } + } + else + { + if (library_view) + { + // Same pattern used elsewhere in this file to tear down a folder's + // view: drop it from the item map, then destroy the UI element. + removeItemID(library_id); + library_view->destroyView(); + } + } +} +// LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 6df59ee737a..03f29746b53 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -292,6 +292,10 @@ class LLInventoryPanel : public LLPanel void initFolderRoot(); void initializeViewBuilding(); + // [FIRE-34881] Build or tear down the Library root view live, without a restart + void setLibraryFolderVisible(bool visible); + // + protected: void openStartFolderOrMyInventory(); // open the first level of inventory void onItemsCompletion(); // called when selected items are complete diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 7aced76ff3c..45a3d0c203d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2711,6 +2711,17 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) gSavedSettings.setBOOL("InventoryShowFavoritesTab", visibility); mFilterTabs->setTabVisibility(mFavoritesPanel, visibility); } + // [FIRE-34881] Show/hide the Library root folder live + if (command_name == "toggle_library") + { + bool visibility = !gSavedSettings.getBOOL("FSShowLibraryFolder"); + gSavedSettings.setBOOL("FSShowLibraryFolder", visibility); + if (mAllItemsPanel) + { + mAllItemsPanel->setLibraryFolderVisible(visibility); + } + } + // } void LLPanelMainInventory::onVisibilityChange( bool new_visibility ) @@ -2952,6 +2963,12 @@ bool LLPanelMainInventory::isActionChecked(const LLSD& userdata) { return mFilterTabs->getTabVisibility(mFavoritesPanel); } + // [FIRE-34881] Reflect current Library root visibility in the gear menu checkmark + if (command_name == "library") + { + return gSavedSettings.getBOOL("FSShowLibraryFolder"); + } + // if (command_name == "add_objects_on_double_click") { diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml index 678cd49c90c..72a7606a261 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml @@ -124,6 +124,22 @@ function="Inventory.GearDefault.Visible" parameter="multi_folder_view" /> + + + + + + + Date: Tue, 15 Sep 2026 13:04:35 +0200 Subject: [PATCH 2/2] [FIRE-34881] Force a rearrange after building the Library folder view so it actually appears --- indra/newview/llinventorypanel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index b3a9c57e444..3f2a8e4e0c8 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1151,6 +1151,11 @@ void LLInventoryPanel::setLibraryFolderVisible(bool visible) if (!library_view) { buildNewViews(library_id); + // New folder views are added invisible with no rearrange request + // (LLFolderViewFolder::addFolder() has that call commented out, + // see addItem()/addFolder() in llfolderviewitem.cpp) - without + // this, the folder exists in the model but never actually draws. + mFolderRoot.get()->arrangeAll(); } } else @@ -1159,6 +1164,8 @@ void LLInventoryPanel::setLibraryFolderVisible(bool visible) { // Same pattern used elsewhere in this file to tear down a folder's // view: drop it from the item map, then destroy the UI element. + // destroyView() -> extractItem() already calls requestArrange() + // internally, so no extra rearrange call is needed on this side. removeItemID(library_id); library_view->destroyView(); }