Page MenuHomePhabricator

New 'default' homepage
ClosedPublic

Authored by chad on Aug 25 2016, 4:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 5:14 PM
Unknown Object (File)
Sat, Apr 13, 2:04 PM
Unknown Object (File)
Fri, Apr 12, 10:54 PM
Unknown Object (File)
Fri, Apr 12, 7:55 AM
Unknown Object (File)
Fri, Apr 12, 7:55 AM
Unknown Object (File)
Fri, Apr 12, 7:55 AM
Unknown Object (File)
Thu, Apr 4, 8:41 PM
Unknown Object (File)
Thu, Apr 4, 8:45 AM
Subscribers

Details

Summary

Ref T11132. This is a new default default (no dashboard) homepage. It offers (Diffs) (Tasks) (Repositories) in the main column and (Feed) in the side column. No NUX stuff, No logged out public view (upcoming diff). This should be complete, but unclear how to bucketize Differential.

Test Plan

Test new account's default homepage.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

chad retitled this revision from to New 'default' homepage.
chad updated this object.
chad edited the test plan for this revision. (Show Details)
chad added a reviewer: epriestley.

Oh, hmm, the bucketing thing is probably a bit messy. Maybe try this?

  • Sort of follow what PhabricatorDashboardQueryPanelType does to actually run the query through the entire SearchEngine, not just the RevisionQuery.
  • You can probably do $saved = $engine->buildSavedQueryFromBuiltin('active'); to get the right $saved object (corresponding to Differential's default query).

I don't know how much of a pain that will be. If that takes more than like 10 minutes and you haven't fixed it, I can go figure out how to force it to work.

If the viewer is not logged in, I think bucketing fails (at best, it doesn't make sense). We might want to do this for logged-out users?

  • Run 'all' instead of 'active' for Differential?
  • Query open instead of open + assigned for Maniphest?

Specifically, this thing:

public function renderPanelContent(
  PhabricatorUser $viewer,
  PhabricatorDashboardPanel $panel,
  PhabricatorDashboardPanelRenderingEngine $engine) {

  $engine = $this->getSearchEngine($panel);

  $engine->setViewer($viewer);
  $engine->setContext(PhabricatorApplicationSearchEngine::CONTEXT_PANEL);

  $key = $panel->getProperty('key');
  if ($engine->isBuiltinQuery($key)) {
    $saved = $engine->buildSavedQueryFromBuiltin($key);
  } else {
    $saved = id(new PhabricatorSavedQueryQuery())
      ->setViewer($viewer)
      ->withEngineClassNames(array(get_class($engine)))
      ->withQueryKeys(array($key))
      ->executeOne();
  }

  if (!$saved) {
    throw new Exception(
      pht(
        'Query "%s" is unknown to application search engine "%s"!',
        $key,
        get_class($engine)));
  }

  $query = $engine->buildQueryFromSavedQuery($saved);
  $pager = $engine->newPagerForSavedQuery($saved);

  if ($panel->getProperty('limit')) {
    $limit = (int)$panel->getProperty('limit');
    if ($pager->getPageSize() !== 0xFFFF) {
      $pager->setPageSize($limit);
    }
  }

  $results = $engine->executeQuery($query, $pager);

  return $engine->renderResults($results, $saved);
}

I think you can do like:

$engine = new DifferentialRevisionSearchEngine();
$saved = $engine->buildSavedQueryFromBuiltin('active');
$query = $engine->buildQueryFromSavedQuery($saved);
$pager = $engine->newPagerForSavedQuery($saved);
$pager->setPageSize(10);
$results = $engine->executeQuery($query, $pager);
$view = $engine->renderResults($results, $saved);

Not sure if that actually works or not, but maybe it's not too far off.

good time to remove welcome.html?

chad edited edge metadata.
  • swap to using SearchEngine
  • basic fallback for logged out viewers. no diffs, open tasks.
epriestley edited edge metadata.

We should also completely remove these config options:

  • maniphest.priorities.unbreak-now
  • maniphest.priorities.needs-triage
  • welcome.html

...and add them to PhabricatorExtraConfigSetupCheck. We can do that in a followup or I can shoot you a diff for it, though. I'll write up a couple sentences about how to keep welcome.html limping along in a task somewhere for the changelog just in case it's still in use.

This revision is now accepted and ready to land.Aug 25 2016, 6:21 PM
This revision was automatically updated to reflect the committed changes.