diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php b/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php --- a/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php +++ b/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php @@ -85,10 +85,12 @@ $rename_uri = id(new PhutilURI($rename_uri)) ->replaceQueryParam('contextPHID', $context_phid); - $selected = 0; - $key_list = array_keys($config); + // In the future we may persist which panel was selected. + // At the moment we have always selected the first one. + $selected = (string)head($key_list); + $next_keys = array(); $prev_keys = array(); for ($ii = 0; $ii < count($key_list); $ii++) { @@ -96,6 +98,7 @@ $prev_keys[$key_list[$ii]] = idx($key_list, $ii - 1); } + // Note that $idx can be something like "0", "1" or "asdasd98". foreach ($config as $idx => $tab_spec) { $panel_id = idx($tab_spec, 'panelID'); $subpanel = idx($panels, $panel_id); @@ -111,7 +114,7 @@ $name = pht('Unnamed Tab'); } - $is_selected = (string)$idx === (string)$selected; + $is_selected = (string)$idx === $selected; $tab_view = id(new PHUIListItemView()) ->setHref('#') @@ -261,6 +264,8 @@ // TODO: Maybe we should persist which panel the user selected, so it // remains selected across page loads. + // Note that $idx can be something like "0", "1" or "asdasd98". + $content = array(); $panel_list = array(); $no_headers = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_NONE; @@ -282,7 +287,7 @@ $panel_content = pht('(Invalid Panel)'); } - $is_selected = (string)$idx === (string)$selected; + $is_selected = (string)$idx === $selected; $content_id = celerity_generate_unique_node_id();