@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove menu item pinning from Home and Favorites profile menus

Summary:
Ref T12174.

- Home now always uses the topmost item (falling back to "magic home") and no longer supports pinning. If any personal item may be a default item, it will always be picked over any global item.
- Favorites doesn't use defaults anyway, but no longer has misleading UI suggesting it might.

Test Plan:
- Saw no pinning UI on Home/Favorites.
- Added a personal dashboard on Home, it automatically became the new default.
- Pinned stuff normally on Projects.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12174

Differential Revision: https://secure.phabricator.com/D17298

+32 -11
+32 -11
src/applications/search/engine/PhabricatorProfileMenuEngine.php
··· 287 287 $content = $this->buildItemHideContent($selected_item); 288 288 break; 289 289 case 'default': 290 + if (!$this->isMenuEnginePinnable()) { 291 + return new Aphront404Response(); 292 + } 290 293 $content = $this->buildItemDefaultContent( 291 294 $selected_item, 292 295 $item_list); ··· 459 462 continue; 460 463 } 461 464 462 - if ($item->isDefault()) { 463 - $default = $item; 464 - break; 465 + // If this engine doesn't support pinning items, don't respect any 466 + // setting which might be present in the database. 467 + if ($this->isMenuEnginePinnable()) { 468 + if ($item->isDefault()) { 469 + $default = $item; 470 + break; 471 + } 465 472 } 466 473 467 474 if ($first === null) { ··· 709 716 return true; 710 717 } 711 718 719 + /** 720 + * Does this engine support pinning items? 721 + * 722 + * Personalizable menus disable pinning by default since it creates a number 723 + * of weird edge cases without providing many benefits for current menus. 724 + * 725 + * @return bool True if items may be pinned as default items. 726 + */ 727 + protected function isMenuEnginePinnable() { 728 + return !$this->isMenuEnginePersonalizable(); 729 + } 730 + 712 731 private function buildMenuEditModeContent() { 713 732 $viewer = $this->getViewer(); 714 733 ··· 833 852 $default_uri = $this->getItemURI("default/{$builtin_key}/"); 834 853 } 835 854 836 - if ($item->isDefault()) { 837 - $default_icon = 'fa-thumb-tack green'; 838 - $default_text = pht('Current Default'); 839 - } else if ($item->canMakeDefault()) { 840 - $default_icon = 'fa-thumb-tack'; 841 - $default_text = pht('Make Default'); 842 - } else { 843 - $default_text = null; 855 + $default_text = null; 856 + 857 + if ($this->isMenuEnginePinnable()) { 858 + if ($item->isDefault()) { 859 + $default_icon = 'fa-thumb-tack green'; 860 + $default_text = pht('Current Default'); 861 + } else if ($item->canMakeDefault()) { 862 + $default_icon = 'fa-thumb-tack'; 863 + $default_text = pht('Make Default'); 864 + } 844 865 } 845 866 846 867 if ($default_text !== null) {