@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.

Seperate repository home and browse view in tab menu

Summary:
The tab menu in a repository can be a bit confusing. The first tab will be rendered active for two distinctive states:

- the home view in the currently selected branch
- the browse view in the currently selected branch

This diff will give the home view a dedicated extra tab. When switching the branches, we won't switch between home and browse view like it is done now.

And I have changed the crumb text for the browse view to "Code" to match it up with the tab name.

Additionally the readme is now the first content on the home view.

Fixes T15728

Test Plan: Browse in your favorite repos and feel an UX elevation.

Reviewers: O1 Blessed Committers, avivey, valerio.bozzolan

Reviewed By: O1 Blessed Committers, avivey, valerio.bozzolan

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15728

Differential Revision: https://we.phorge.it/D25538

+19 -7
+13 -1
src/applications/diffusion/controller/DiffusionController.php
··· 211 211 $view_name = pht('History'); 212 212 break; 213 213 case 'browse': 214 - $view_name = pht('Browse'); 214 + $view_name = pht('Code'); 215 215 break; 216 216 case 'lint': 217 217 $view_name = pht('Lint'); ··· 501 501 $repository = $drequest->getRepository(); 502 502 503 503 $view = new PHUIListView(); 504 + 505 + $view->addMenuItem( 506 + id(new PHUIListItemView()) 507 + ->setKey('home') 508 + ->setName(pht('Home')) 509 + ->setIcon('fa-home') 510 + ->setHref($drequest->generateURI( 511 + array( 512 + 'action' => 'branch', 513 + 'path' => '', 514 + ))) 515 + ->setSelected($key == 'home')); 504 516 505 517 $view->addMenuItem( 506 518 id(new PHUIListItemView())
+6 -6
src/applications/diffusion/controller/DiffusionRepositoryController.php
··· 109 109 ->setErrors(array($empty_message)); 110 110 } 111 111 112 - $tabs = $this->buildTabsView('code'); 112 + $tabs = $this->buildTabsView('home'); 113 113 114 114 $clone_uri = $drequest->generateURI( 115 115 array( ··· 243 243 $readme = null; 244 244 } 245 245 246 + if ($readme) { 247 + $content[] = $readme; 248 + } 249 + 246 250 $content[] = $this->buildBrowseTable( 247 251 $browse_results, 248 252 $browse_paths, 249 253 $browse_exception, 250 254 $browse_pager); 251 - 252 - if ($readme) { 253 - $content[] = $readme; 254 - } 255 255 256 256 try { 257 257 $branch_button = $this->buildBranchList($drequest); ··· 396 396 foreach ($branches as $branch) { 397 397 $branch_uri = $drequest->generateURI( 398 398 array( 399 - 'action' => 'browse', 399 + 'action' => 'branch', 400 400 'branch' => $branch->getShortname(), 401 401 )); 402 402 $actions->addAction(