Get rid of TopicsPage functionality.

The motivation for this is that currently we are focusing on bulk
actions on the search and dashboard page. Given this code is not
complete, it's unclear how much of it will remain relevant once we
revisit the concept of a holistic view of a topic. As such this code is
currently dead.

Change-Id: I044b9a7ff28a3f63d6cdad7005f5685b5c48a6ca
diff --git a/polygerrit-ui/app/elements/core/gr-navigation/gr-navigation.ts b/polygerrit-ui/app/elements/core/gr-navigation/gr-navigation.ts
index f8f4787..8541d5d 100644
--- a/polygerrit-ui/app/elements/core/gr-navigation/gr-navigation.ts
+++ b/polygerrit-ui/app/elements/core/gr-navigation/gr-navigation.ts
@@ -249,17 +249,11 @@
   commentLink?: boolean;
 }
 
-export interface GenerateUrlTopicViewParams {
-  view: GerritView.TOPIC;
-  topic?: string;
-}
-
 export type GenerateUrlParameters =
   | GenerateUrlSearchViewParameters
   | GenerateUrlChangeViewParameters
   | GenerateUrlRepoViewParameters
   | GenerateUrlDashboardViewParameters
-  | GenerateUrlTopicViewParams
   | GenerateUrlGroupViewParameters
   | GenerateUrlEditViewParameters
   | GenerateUrlRootViewParameters
@@ -617,16 +611,6 @@
     );
   },
 
-  navigateToTopicPage(topic: string) {
-    this._navigate(
-      this._getUrlFor({
-        view: GerritView.TOPIC,
-        topic,
-      }),
-      true /* redirect */
-    );
-  },
-
   /**
    * @param basePatchNum The string 'PARENT' can be used for none.
    */
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
index 5c0a2ea..64771f5 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
@@ -43,7 +43,6 @@
   isGenerateUrlDiffViewParameters,
   RepoDetailView,
   WeblinkType,
-  GenerateUrlTopicViewParams,
 } from '../gr-navigation/gr-navigation';
 import {getAppContext} from '../../../services/app-context';
 import {convertToPatchSetNum} from '../../../utils/patch-set-util';
@@ -78,14 +77,11 @@
   toSearchParams,
 } from '../../../utils/url-util';
 import {Execution, LifeCycle, Timing} from '../../../constants/reporting';
-import {KnownExperimentId} from '../../../services/flags/flags';
 
 const RoutePattern = {
   ROOT: '/',
 
   DASHBOARD: /^\/dashboard\/(.+)$/,
-  // TODO(dhruvsri): remove /c once Change 322894 lands
-  TOPIC: /^\/c\/topic\/([^/]*)\/?$/,
   CUSTOM_DASHBOARD: /^\/dashboard\/?$/,
   PROJECT_DASHBOARD: /^\/p\/(.+)\/\+\/dashboard\/(.+)/,
   LEGACY_PROJECT_DASHBOARD: /^\/projects\/(.+),dashboards\/(.+)/,
@@ -315,8 +311,6 @@
 
   private readonly restApiService = getAppContext().restApiService;
 
-  private readonly flagsService = getAppContext().flagsService;
-
   start() {
     if (!this._app) {
       return;
@@ -363,8 +357,6 @@
       url = this._generateChangeUrl(params);
     } else if (params.view === GerritView.DASHBOARD) {
       url = this._generateDashboardUrl(params);
-    } else if (params.view === GerritView.TOPIC) {
-      url = this._generateTopicPageUrl(params);
     } else if (
       params.view === GerritView.DIFF ||
       params.view === GerritView.EDIT
@@ -587,10 +579,6 @@
     }
   }
 
-  _generateTopicPageUrl(params: GenerateUrlTopicViewParams) {
-    return `/c/topic/${params.topic ?? ''}`;
-  }
-
   _sectionsToEncodedParams(sections: DashboardSection[], repoName?: RepoName) {
     return sections.map(section => {
       // If there is a repo name provided, make sure to substitute it into the
@@ -907,8 +895,6 @@
 
     this._mapRoute(RoutePattern.DASHBOARD, '_handleDashboardRoute');
 
-    this._mapRoute(RoutePattern.TOPIC, '_handleTopicRoute');
-
     this._mapRoute(
       RoutePattern.CUSTOM_DASHBOARD,
       '_handleCustomDashboardRoute'
@@ -1233,13 +1219,6 @@
     });
   }
 
-  _handleTopicRoute(data: PageContextWithQueryMap) {
-    this._setParams({
-      view: GerritView.TOPIC,
-      topic: data.params[0],
-    });
-  }
-
   /**
    * Handle custom dashboard routes.
    *
@@ -1557,16 +1536,6 @@
   }
 
   _handleQueryRoute(data: PageContextWithQueryMap) {
-    if (this.flagsService.isEnabled(KnownExperimentId.TOPICS_PAGE)) {
-      const query = data.params[0];
-      const terms = query.split(' ');
-      if (terms.length === 1) {
-        const tokens = terms[0].split(':');
-        if (tokens[0] === 'topic') {
-          return GerritNav.navigateToTopicPage(tokens[1]);
-        }
-      }
-    }
     this._setParams({
       view: GerritView.SEARCH,
       query: data.params[0],
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router_test.js b/polygerrit-ui/app/elements/core/gr-router/gr-router_test.js
index 148286e..31028d5 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router_test.js
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router_test.js
@@ -19,11 +19,10 @@
 import './gr-router.js';
 import {page} from '../../../utils/page-wrapper-utils.js';
 import {GerritNav} from '../gr-navigation/gr-navigation.js';
-import {stubBaseUrl, stubRestApi, addListenerForTest, stubFlags} from '../../../test/test-utils.js';
+import {stubBaseUrl, stubRestApi, addListenerForTest} from '../../../test/test-utils.js';
 import {_testOnly_RoutePattern} from './gr-router.js';
 import {GerritView} from '../../../services/router/router-model.js';
 import {ParentPatchSetNum} from '../../../types/common.js';
-import {KnownExperimentId} from '../../../services/flags/flags.js';
 
 const basicFixture = fixtureFromElement('gr-router');
 
@@ -215,7 +214,6 @@
       '_handleTagListFilterOffsetRoute',
       '_handleTagListFilterRoute',
       '_handleTagListOffsetRoute',
-      '_handleTopicRoute',
       '_handlePluginScreen',
     ];
 
@@ -261,15 +259,6 @@
   });
 
   suite('generateUrl', () => {
-    test('topic page', () => {
-      const params = {
-        view: GerritView.TOPIC,
-        topic: 'ggh',
-      };
-      assert.equal(element._generateUrl(params),
-          '/c/topic/ggh');
-    });
-
     test('search', () => {
       let params = {
         view: GerritNav.View.SEARCH,
@@ -675,21 +664,6 @@
       });
     });
 
-    test('_handleQueryRoute to topic page', () => {
-      stubFlags('isEnabled').withArgs(KnownExperimentId.TOPICS_PAGE)
-          .returns(true);
-      const navStub = sinon.stub(GerritNav, 'navigateToTopicPage');
-      let data = {params: ['topic:abcd']};
-      element._handleQueryRoute(data);
-
-      assert.isTrue(navStub.called);
-
-      // multiple terms so topic page is not loaded
-      data = {params: ['topic:abcd owner:self']};
-      element._handleQueryRoute(data);
-      assert.isTrue(navStub.calledOnce);
-    });
-
     test('_handleQueryLegacySuffixRoute', () => {
       element._handleQueryLegacySuffixRoute({path: '/q/foo+bar,n,z'});
       assert.isTrue(redirectStub.calledOnce);
@@ -1240,19 +1214,6 @@
       });
     });
 
-    suite('topic routes', () => {
-      test('_handleTopicRoute', () => {
-        const url = '/c/topic/super complex-topic name with spaces/';
-        const groups = url.match(_testOnly_RoutePattern.TOPIC);
-
-        const data = {params: groups.slice(1)};
-        assertDataToParams(data, '_handleTopicRoute', {
-          view: GerritView.TOPIC,
-          topic: 'super complex-topic name with spaces',
-        });
-      });
-    });
-
     suite('plugin routes', () => {
       test('_handlePluginListOffsetRoute', () => {
         const data = {params: {}};
diff --git a/polygerrit-ui/app/elements/gr-app-element.ts b/polygerrit-ui/app/elements/gr-app-element.ts
index b25417c..0037f36 100644
--- a/polygerrit-ui/app/elements/gr-app-element.ts
+++ b/polygerrit-ui/app/elements/gr-app-element.ts
@@ -21,7 +21,6 @@
 import './documentation/gr-documentation-search/gr-documentation-search';
 import './change-list/gr-change-list-view/gr-change-list-view';
 import './change-list/gr-dashboard-view/gr-dashboard-view';
-import './topic/gr-topic-view';
 import './change/gr-change-view/gr-change-view';
 import './core/gr-error-manager/gr-error-manager';
 import './core/gr-keyboard-shortcuts-dialog/gr-keyboard-shortcuts-dialog';
@@ -144,9 +143,6 @@
   _showDashboardView?: boolean;
 
   @property({type: Boolean})
-  _showTopicView?: boolean;
-
-  @property({type: Boolean})
   _showChangeView?: boolean;
 
   @property({type: Boolean})
@@ -354,7 +350,6 @@
     this.$.errorView.classList.remove('show');
     this._showChangeListView = view === GerritView.SEARCH;
     this._showDashboardView = view === GerritView.DASHBOARD;
-    this._showTopicView = view === GerritView.TOPIC;
     this._showChangeView = view === GerritView.CHANGE;
     this._showDiffView = view === GerritView.DIFF;
     this._showSettingsView = view === GerritView.SETTINGS;
diff --git a/polygerrit-ui/app/elements/gr-app-element_html.ts b/polygerrit-ui/app/elements/gr-app-element_html.ts
index 5bee20c..5b96720 100644
--- a/polygerrit-ui/app/elements/gr-app-element_html.ts
+++ b/polygerrit-ui/app/elements/gr-app-element_html.ts
@@ -130,9 +130,6 @@
         view-state="{{_viewState.dashboardView}}"
       ></gr-dashboard-view>
     </template>
-    <template is="dom-if" if="[[_showTopicView]]">
-      <gr-topic-view params="[[params]]"></gr-topic-view>
-    </template>
     <!-- Note that the change view does not have restamp="true" set, because we
          want to re-use it as long as the change number does not change. -->
     <template id="dom-if-change-view" is="dom-if" if="[[_showChangeView]]">
diff --git a/polygerrit-ui/app/elements/gr-app-types.ts b/polygerrit-ui/app/elements/gr-app-types.ts
index 9c0ce9e..e5748fc 100644
--- a/polygerrit-ui/app/elements/gr-app-types.ts
+++ b/polygerrit-ui/app/elements/gr-app-types.ts
@@ -46,11 +46,6 @@
   title?: string;
 }
 
-export interface AppElementTopicParams {
-  view: GerritView.TOPIC;
-  topic?: string;
-}
-
 export interface AppElementGroupParams {
   view: GerritView.GROUP;
   detail?: GroupDetailView;
@@ -152,7 +147,6 @@
 
 export type AppElementParams =
   | AppElementDashboardParams
-  | AppElementTopicParams
   | AppElementGroupParams
   | AppElementAdminParams
   | AppElementChangeViewParams
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-summary.ts b/polygerrit-ui/app/elements/topic/gr-topic-summary.ts
deleted file mode 100644
index 81e5686..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-summary.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {customElement, property, state} from 'lit/decorators';
-import {LitElement, html, PropertyValues} from 'lit-element/lit-element';
-import {getAppContext} from '../../services/app-context';
-import '../shared/gr-button/gr-button';
-
-/**
- * A summary of a topic with buttons for performing topic-level operations.
- */
-@customElement('gr-topic-summary')
-export class GrTopicSummary extends LitElement {
-  @property({type: String})
-  topicName?: string;
-
-  @state()
-  private changeCount?: number;
-
-  private restApiService = getAppContext().restApiService;
-
-  override willUpdate(changedProperties: PropertyValues) {
-    // TODO: receive data from the model once it is added.
-    if (changedProperties.has('topicName')) {
-      this.restApiService
-        .getChanges(undefined /* changesPerPage */, `topic:${this.topicName}`)
-        .then(response => {
-          this.changeCount = response?.length ?? 0;
-        });
-    }
-  }
-
-  override render() {
-    if (this.topicName === undefined) {
-      return;
-    }
-    return html`
-      <span>Topic: ${this.topicName}</span>
-      <span>${this.changeCount} changes</span>
-      <gr-button>Reply</gr-button>
-      <gr-button>Select Changes</gr-button>
-    `;
-  }
-}
-
-declare global {
-  interface HTMLElementTagNameMap {
-    'gr-topic-summary': GrTopicSummary;
-  }
-}
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-summary_test.ts b/polygerrit-ui/app/elements/topic/gr-topic-summary_test.ts
deleted file mode 100644
index 33a9029..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-summary_test.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import '../../test/common-test-setup-karma';
-import {createChange} from '../../test/test-data-generators';
-import {queryAll, stubRestApi} from '../../test/test-utils';
-import './gr-topic-summary';
-import {GrTopicSummary} from './gr-topic-summary';
-
-const basicFixture = fixtureFromElement('gr-topic-summary');
-const topicName = 'myTopic';
-
-suite('gr-topic-summary tests', () => {
-  let element: GrTopicSummary;
-
-  setup(async () => {
-    stubRestApi('getChanges')
-      .withArgs(undefined, `topic:${topicName}`)
-      .resolves([createChange(), createChange(), createChange()]);
-    element = basicFixture.instantiate();
-    element.topicName = topicName;
-    await element.updateComplete;
-  });
-
-  test('shows topic information', () => {
-    const labels = queryAll<HTMLSpanElement>(element, 'span');
-    assert.equal(labels[0].textContent, `Topic: ${topicName}`);
-    assert.equal(labels[1].textContent, '3 changes');
-  });
-});
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-tree-repo.ts b/polygerrit-ui/app/elements/topic/gr-topic-tree-repo.ts
deleted file mode 100644
index 234f058..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-tree-repo.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import './gr-topic-tree-row';
-import {customElement, property} from 'lit/decorators';
-import {LitElement, html, css} from 'lit-element/lit-element';
-import '../shared/gr-button/gr-button';
-import {ChangeInfo, RepoName} from '../../api/rest-api';
-
-/**
- * A view of changes that all belong to the same repository.
- */
-@customElement('gr-topic-tree-repo')
-export class GrTopicTreeRepo extends LitElement {
-  @property({type: String})
-  repoName?: RepoName;
-
-  @property({type: Array})
-  changes?: ChangeInfo[];
-
-  static override styles = css`
-    :host {
-      display: contents;
-    }
-  `;
-
-  override render() {
-    if (this.repoName === undefined || this.changes === undefined) {
-      return;
-    }
-    // TODO: Groups of related changes should be separated within the repository.
-    return html`
-      <h2>Repo ${this.repoName}</h2>
-      ${this.changes.map(change => this.renderTreeRow(change))}
-    `;
-  }
-
-  private renderTreeRow(change: ChangeInfo) {
-    return html`<gr-topic-tree-row .change=${change}></gr-topic-tree-row>`;
-  }
-}
-
-declare global {
-  interface HTMLElementTagNameMap {
-    'gr-topic-tree-repo': GrTopicTreeRepo;
-  }
-}
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-tree-repo_test.ts b/polygerrit-ui/app/elements/topic/gr-topic-tree-repo_test.ts
deleted file mode 100644
index 2e903b5..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-tree-repo_test.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {RepoName} from '../../api/rest-api';
-import '../../test/common-test-setup-karma';
-import {createChange} from '../../test/test-data-generators';
-import {queryAndAssert} from '../../test/test-utils';
-import './gr-topic-tree-repo';
-import {GrTopicTreeRepo} from './gr-topic-tree-repo';
-
-const basicFixture = fixtureFromElement('gr-topic-tree-repo');
-const repoName = 'myRepo' as RepoName;
-
-suite('gr-topic-tree-repo tests', () => {
-  let element: GrTopicTreeRepo;
-
-  setup(async () => {
-    element = basicFixture.instantiate();
-    element.repoName = repoName;
-    element.changes = [createChange()];
-    await element.updateComplete;
-  });
-
-  test('shows repository name', () => {
-    const heading = queryAndAssert<HTMLHeadingElement>(element, 'h2');
-    assert.equal(heading.textContent, `Repo ${repoName}`);
-  });
-});
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-tree-row.ts b/polygerrit-ui/app/elements/topic/gr-topic-tree-row.ts
deleted file mode 100644
index 0355bee..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-tree-row.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {customElement, property} from 'lit/decorators';
-import {LitElement, html, css} from 'lit-element/lit-element';
-import '../shared/gr-button/gr-button';
-import {ChangeInfo} from '../../api/rest-api';
-
-// TODO: copied from gr-change-list-item. Extract both places to a util.
-enum ChangeSize {
-  XS = 10,
-  SMALL = 50,
-  MEDIUM = 250,
-  LARGE = 1000,
-}
-
-/**
- * A single change shown as part of the topic tree.
- */
-@customElement('gr-topic-tree-row')
-export class GrTopicTreeRow extends LitElement {
-  @property({type: Object})
-  change?: ChangeInfo;
-
-  static override styles = css`
-    :host {
-      display: contents;
-    }
-  `;
-
-  override render() {
-    if (this.change === undefined) {
-      return;
-    }
-    const authorName =
-      this.change.revisions?.[this.change.current_revision!].commit?.author
-        .name;
-    return html`
-      <tr>
-        <td>${this.computeSize(this.change)}</td>
-        <td>${this.change.subject}</td>
-        <td>${this.change.topic}</td>
-        <td>${this.change.branch}</td>
-        <td>${authorName}</td>
-        <td>${this.change.status}</td>
-      </tr>
-    `;
-  }
-
-  // TODO: copied from gr-change-list-item. Extract both places to a util.
-  private computeSize(change: ChangeInfo) {
-    const delta = change.insertions + change.deletions;
-    if (isNaN(delta) || delta === 0) {
-      return;
-    }
-    if (delta < ChangeSize.XS) {
-      return 'XS';
-    } else if (delta < ChangeSize.SMALL) {
-      return 'S';
-    } else if (delta < ChangeSize.MEDIUM) {
-      return 'M';
-    } else if (delta < ChangeSize.LARGE) {
-      return 'L';
-    } else {
-      return 'XL';
-    }
-  }
-}
-
-declare global {
-  interface HTMLElementTagNameMap {
-    'gr-topic-tree-row': GrTopicTreeRow;
-  }
-}
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-tree-row_test.ts b/polygerrit-ui/app/elements/topic/gr-topic-tree-row_test.ts
deleted file mode 100644
index e73cf13..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-tree-row_test.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {ChangeInfo, ChangeStatus, TopicName} from '../../api/rest-api';
-import '../../test/common-test-setup-karma';
-import {
-  createChangeViewChange,
-  TEST_BRANCH_ID,
-  TEST_SUBJECT,
-} from '../../test/test-data-generators';
-import {queryAll} from '../../test/test-utils';
-import './gr-topic-tree-row';
-import {GrTopicTreeRow} from './gr-topic-tree-row';
-
-const basicFixture = fixtureFromElement('gr-topic-tree-row');
-
-suite('gr-topic-tree-row tests', () => {
-  let element: GrTopicTreeRow;
-  const change: ChangeInfo = {
-    ...createChangeViewChange(),
-    insertions: 50,
-    topic: 'myTopic' as TopicName,
-  };
-
-  setup(async () => {
-    element = basicFixture.instantiate();
-    element.change = change;
-    await element.updateComplete;
-  });
-
-  test('shows columns of change information', () => {
-    const columns = queryAll<HTMLTableCellElement>(element, 'td');
-    assert.equal(columns[0].textContent, 'M');
-    assert.equal(columns[1].textContent, TEST_SUBJECT);
-    assert.equal(columns[2].textContent, 'myTopic');
-    assert.equal(columns[3].textContent, TEST_BRANCH_ID);
-    assert.equal(columns[4].textContent, 'Test name');
-    assert.equal(columns[5].textContent, ChangeStatus.NEW);
-  });
-
-  test('shows unknown size', async () => {
-    element.change = {...change, insertions: 0, deletions: 0};
-    await element.updateComplete;
-
-    const columns = queryAll<HTMLTableCellElement>(element, 'td');
-    assert.equal(columns[0].textContent, '');
-  });
-
-  test('shows XS size', async () => {
-    element.change = {...change, insertions: 3, deletions: 6};
-    await element.updateComplete;
-
-    const columns = queryAll<HTMLTableCellElement>(element, 'td');
-    assert.equal(columns[0].textContent, 'XS');
-  });
-
-  test('shows S size', async () => {
-    element.change = {...change, insertions: 9, deletions: 40};
-    await element.updateComplete;
-
-    const columns = queryAll<HTMLTableCellElement>(element, 'td');
-    assert.equal(columns[0].textContent, 'S');
-  });
-
-  test('shows M size', async () => {
-    element.change = {...change, insertions: 249, deletions: 0};
-    await element.updateComplete;
-
-    const columns = queryAll<HTMLSpanElement>(element, 'td');
-    assert.equal(columns[0].textContent, 'M');
-  });
-
-  test('shows L size', async () => {
-    element.change = {...change, insertions: 499, deletions: 500};
-    await element.updateComplete;
-
-    const columns = queryAll<HTMLTableCellElement>(element, 'td');
-    assert.equal(columns[0].textContent, 'L');
-  });
-
-  test('shows XL size', async () => {
-    element.change = {...change, insertions: 1000, deletions: 1};
-    await element.updateComplete;
-
-    const columns = queryAll<HTMLTableCellElement>(element, 'td');
-    assert.equal(columns[0].textContent, 'XL');
-  });
-});
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-tree.ts b/polygerrit-ui/app/elements/topic/gr-topic-tree.ts
deleted file mode 100644
index a993d90..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-tree.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import './gr-topic-tree-repo';
-import {customElement, property, state} from 'lit/decorators';
-import {LitElement, html, PropertyValues} from 'lit-element/lit-element';
-import {getAppContext} from '../../services/app-context';
-import '../shared/gr-button/gr-button';
-import {ChangeInfo, RepoName} from '../../api/rest-api';
-
-/**
- * A tree-like dashboard showing changes related to a topic, organized by
- * repository.
- */
-@customElement('gr-topic-tree')
-export class GrTopicTree extends LitElement {
-  @property({type: String})
-  topicName?: string;
-
-  @state()
-  private changesByRepo = new Map<RepoName, ChangeInfo[]>();
-
-  private restApiService = getAppContext().restApiService;
-
-  override willUpdate(changedProperties: PropertyValues) {
-    // TODO: Receive data from the model once it is added.
-    if (changedProperties.has('topicName')) {
-      this.loadAndSortChangesFromTopic();
-    }
-  }
-
-  override render() {
-    return html`
-      <table>
-        <thead>
-          <tr>
-            <td>Size</td>
-            <td>Subject</td>
-            <td>Topic</td>
-            <td>Branch</td>
-            <td>Owner</td>
-            <td>Status</td>
-          </tr>
-        </thead>
-        <tbody>
-          ${Array.from(this.changesByRepo).map(([repoName, changes]) =>
-            this.renderRepoSection(repoName, changes)
-          )}
-        </tbody>
-      </table>
-    `;
-  }
-
-  private renderRepoSection(repoName: RepoName, changes: ChangeInfo[]) {
-    return html`
-      <gr-topic-tree-repo
-        .repoName=${repoName}
-        .changes=${changes}
-      ></gr-topic-tree-repo>
-    `;
-  }
-
-  private async loadAndSortChangesFromTopic(): Promise<void> {
-    const changesInTopic = this.topicName
-      ? await this.restApiService.getChangesWithSameTopic(this.topicName)
-      : [];
-    const changesSubmittedTogether = await this.loadChangesSubmittedTogether(
-      changesInTopic
-    );
-    this.changesByRepo.clear();
-    for (const change of changesSubmittedTogether) {
-      if (this.changesByRepo.has(change.project)) {
-        this.changesByRepo.get(change.project)!.push(change);
-      } else {
-        this.changesByRepo.set(change.project, [change]);
-      }
-    }
-    this.requestUpdate();
-  }
-
-  private async loadChangesSubmittedTogether(
-    changesInTopic?: ChangeInfo[]
-  ): Promise<ChangeInfo[]> {
-    // All changes in the topic will be submitted together, so we can use any of
-    // them for the request to getChangesSubmittedTogether as long as the topic
-    // is not empty.
-    if (!changesInTopic || changesInTopic.length === 0) {
-      return [];
-    }
-    const response = await this.restApiService.getChangesSubmittedTogether(
-      changesInTopic[0]._number,
-      ['NON_VISIBLE_CHANGES', 'CURRENT_REVISION', 'CURRENT_COMMIT']
-    );
-    return response?.changes ?? [];
-  }
-}
-
-declare global {
-  interface HTMLElementTagNameMap {
-    'gr-topic-tree': GrTopicTree;
-  }
-}
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-tree_test.ts b/polygerrit-ui/app/elements/topic/gr-topic-tree_test.ts
deleted file mode 100644
index 72e14b8..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-tree_test.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {ChangeInfo, RepoName} from '../../api/rest-api';
-import '../../test/common-test-setup-karma';
-import {createChange} from '../../test/test-data-generators';
-import {mockPromise, queryAll, stubRestApi} from '../../test/test-utils';
-import {SubmittedTogetherInfo} from '../../types/common';
-import './gr-topic-tree';
-import {GrTopicTree} from './gr-topic-tree';
-import {GrTopicTreeRepo} from './gr-topic-tree-repo';
-
-const basicFixture = fixtureFromElement('gr-topic-tree');
-
-const repo1Name = 'repo1' as RepoName;
-const repo2Name = 'repo2' as RepoName;
-const repo3Name = 'repo3' as RepoName;
-
-function createChangeForRepo(repoName: string): ChangeInfo {
-  return {...createChange(), project: repoName as RepoName};
-}
-
-suite('gr-topic-tree tests', () => {
-  let element: GrTopicTree;
-  const repo1ChangeOutsideTopic = createChangeForRepo(repo1Name);
-  const repo1ChangesInTopic = [
-    createChangeForRepo(repo1Name),
-    createChangeForRepo(repo1Name),
-  ];
-  const repo2ChangesInTopic = [
-    createChangeForRepo(repo2Name),
-    createChangeForRepo(repo2Name),
-  ];
-  const repo3ChangesInTopic = [
-    createChangeForRepo(repo3Name),
-    createChangeForRepo(repo3Name),
-  ];
-
-  setup(async () => {
-    stubRestApi('getChangesWithSameTopic')
-      .withArgs('myTopic')
-      .resolves([
-        ...repo1ChangesInTopic,
-        ...repo2ChangesInTopic,
-        ...repo3ChangesInTopic,
-      ]);
-    const changesSubmittedTogetherPromise =
-      mockPromise<SubmittedTogetherInfo>();
-    stubRestApi('getChangesSubmittedTogether').returns(
-      changesSubmittedTogetherPromise
-    );
-    element = basicFixture.instantiate();
-    element.topicName = 'myTopic';
-
-    // The first update will trigger the data to be loaded. The second update
-    // will be rendering the loaded data.
-    await element.updateComplete;
-    changesSubmittedTogetherPromise.resolve({
-      changes: [
-        ...repo1ChangesInTopic,
-        repo1ChangeOutsideTopic,
-        ...repo2ChangesInTopic,
-        ...repo3ChangesInTopic,
-      ],
-      non_visible_changes: 0,
-    });
-    await changesSubmittedTogetherPromise;
-    await element.updateComplete;
-  });
-
-  test('groups changes by repo', () => {
-    const repoSections = queryAll<GrTopicTreeRepo>(
-      element,
-      'gr-topic-tree-repo'
-    );
-    assert.lengthOf(repoSections, 3);
-    assert.equal(repoSections[0].repoName, repo1Name);
-    assert.sameMembers(repoSections[0].changes!, [
-      ...repo1ChangesInTopic,
-      repo1ChangeOutsideTopic,
-    ]);
-    assert.equal(repoSections[1].repoName, repo2Name);
-    assert.sameMembers(repoSections[1].changes!, repo2ChangesInTopic);
-    assert.equal(repoSections[2].repoName, repo3Name);
-    assert.sameMembers(repoSections[2].changes!, repo3ChangesInTopic);
-  });
-});
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-view.ts b/polygerrit-ui/app/elements/topic/gr-topic-view.ts
deleted file mode 100644
index 86099b5..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-view.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {customElement, property, state} from 'lit/decorators';
-import {LitElement, html, PropertyValues} from 'lit';
-import {AppElementTopicParams} from '../gr-app-types';
-import {getAppContext} from '../../services/app-context';
-import {KnownExperimentId} from '../../services/flags/flags';
-import {GerritNav} from '../core/gr-navigation/gr-navigation';
-import {GerritView} from '../../services/router/router-model';
-import './gr-topic-summary';
-import './gr-topic-tree';
-
-/**
- * A page showing all information about a topic and changes that are related
- * to that topic.
- */
-@customElement('gr-topic-view')
-export class GrTopicView extends LitElement {
-  @property({type: Object})
-  params?: AppElementTopicParams;
-
-  @state()
-  topicName?: string;
-
-  private readonly flagsService = getAppContext().flagsService;
-
-  override willUpdate(changedProperties: PropertyValues) {
-    if (changedProperties.has('params')) {
-      this.paramsChanged();
-    }
-  }
-
-  override render() {
-    if (this.topicName === undefined) {
-      return;
-    }
-    // TODO: Add topic selector
-    return html`
-      <gr-topic-summary .topicName=${this.topicName}></gr-topic-summary>
-      <gr-topic-tree .topicName=${this.topicName}></gr-topic-tree>
-    `;
-  }
-
-  paramsChanged() {
-    if (this.params?.view !== GerritView.TOPIC) return;
-    this.topicName = this.params?.topic;
-    if (
-      !this.flagsService.isEnabled(KnownExperimentId.TOPICS_PAGE) &&
-      this.topicName
-    ) {
-      GerritNav.navigateToSearchQuery(`topic:${this.topicName}`);
-    }
-  }
-}
-
-declare global {
-  interface HTMLElementTagNameMap {
-    'gr-topic-view': GrTopicView;
-  }
-}
diff --git a/polygerrit-ui/app/elements/topic/gr-topic-view_test.ts b/polygerrit-ui/app/elements/topic/gr-topic-view_test.ts
deleted file mode 100644
index 726fca2..0000000
--- a/polygerrit-ui/app/elements/topic/gr-topic-view_test.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * @license
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {KnownExperimentId} from '../../services/flags/flags';
-import '../../test/common-test-setup-karma';
-import {createGenerateUrlTopicViewParams} from '../../test/test-data-generators';
-import {stubFlags} from '../../test/test-utils';
-import {GerritNav} from '../core/gr-navigation/gr-navigation';
-import './gr-topic-view';
-import {GrTopicView} from './gr-topic-view';
-
-const basicFixture = fixtureFromElement('gr-topic-view');
-
-suite('gr-topic-view tests', () => {
-  let element: GrTopicView;
-  let redirectStub: sinon.SinonStub;
-
-  async function commonSetup(experimentEnabled: boolean) {
-    redirectStub = sinon.stub(GerritNav, 'navigateToSearchQuery');
-    stubFlags('isEnabled')
-      .withArgs(KnownExperimentId.TOPICS_PAGE)
-      .returns(experimentEnabled);
-    element = basicFixture.instantiate();
-    element.params = createGenerateUrlTopicViewParams();
-    await element.updateComplete;
-  }
-
-  suite('experiment enabled', () => {
-    setup(async () => {
-      await commonSetup(true);
-    });
-    test('does not redirect to search results page if experiment is enabled', () => {
-      assert.isTrue(redirectStub.notCalled);
-    });
-  });
-
-  suite('experiment disabled', () => {
-    setup(async () => {
-      await commonSetup(false);
-    });
-    test('redirects to search results page if experiment is disabled', () => {
-      assert.isTrue(redirectStub.calledWith('topic:myTopic'));
-    });
-  });
-});
diff --git a/polygerrit-ui/app/services/flags/flags.ts b/polygerrit-ui/app/services/flags/flags.ts
index 44e3ec7..dd056c8 100644
--- a/polygerrit-ui/app/services/flags/flags.ts
+++ b/polygerrit-ui/app/services/flags/flags.ts
@@ -29,7 +29,6 @@
   NEW_IMAGE_DIFF_UI = 'UiFeature__new_image_diff_ui',
   CHECKS_DEVELOPER = 'UiFeature__checks_developer',
   SUBMIT_REQUIREMENTS_UI = 'UiFeature__submit_requirements_ui',
-  TOPICS_PAGE = 'UiFeature__topics_page',
   CHECK_RESULTS_IN_DIFFS = 'UiFeature__check_results_in_diffs',
   DIFF_RENDERING_LIT = 'UiFeature__diff_rendering_lit',
 }
diff --git a/polygerrit-ui/app/services/router/router-model.ts b/polygerrit-ui/app/services/router/router-model.ts
index 5bd228b..221e55b 100644
--- a/polygerrit-ui/app/services/router/router-model.ts
+++ b/polygerrit-ui/app/services/router/router-model.ts
@@ -35,7 +35,6 @@
   ROOT = 'root',
   SEARCH = 'search',
   SETTINGS = 'settings',
-  TOPIC = 'topic',
 }
 
 export interface RouterState {
diff --git a/polygerrit-ui/app/test/test-data-generators.ts b/polygerrit-ui/app/test/test-data-generators.ts
index 1abb0b9..626a650 100644
--- a/polygerrit-ui/app/test/test-data-generators.ts
+++ b/polygerrit-ui/app/test/test-data-generators.ts
@@ -112,10 +112,7 @@
 import {GerritView} from '../services/router/router-model';
 import {ChangeComments} from '../elements/diff/gr-comment-api/gr-comment-api';
 import {EditRevisionInfo, ParsedChangeInfo} from '../types/types';
-import {
-  GenerateUrlEditViewParameters,
-  GenerateUrlTopicViewParams,
-} from '../elements/core/gr-navigation/gr-navigation';
+import {GenerateUrlEditViewParameters} from '../elements/core/gr-navigation/gr-navigation';
 import {
   DetailedLabelInfo,
   QuickLabelInfo,
@@ -510,13 +507,6 @@
   };
 }
 
-export function createGenerateUrlTopicViewParams(): GenerateUrlTopicViewParams {
-  return {
-    view: GerritView.TOPIC,
-    topic: 'myTopic',
-  };
-}
-
 export function createRequirement(): Requirement {
   return {
     status: RequirementStatus.OK,