Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit a774e26

Browse files
authored
support showing panel on all pages (#1208)
Previously, the panel would only be displayed on the blob or tree pages. Now it can appear on any page. There are no panel views yet that are intended to show up on other pages, but it is now possible. This change also makes it so that the panel takes up the full screen width, even on tree/blob pages. Previously it only took up the partial width starting at the sidebar (if open) on the left. Having more width in the panel is more important than having more height on the sidebar, so this change is beneficial. (It also is much simpler to implement this way rather than continuing to have the panel take partial width on tree/blob page, because it allows the panel to be rendered in a single place high up in the React component hierarchy.)
1 parent c965368 commit a774e26

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

web/src/Layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { GlobalDebug } from './global/GlobalDebug'
1414
import { KeybindingsProps } from './keybindings'
1515
import { IntegrationsToast } from './marketing/IntegrationsToast'
1616
import { GlobalNavbar } from './nav/GlobalNavbar'
17+
import { ResizablePanel } from './panel/Panel'
1718
import { RepoHeaderActionButton } from './repo/RepoHeader'
1819
import { RepoRevContainerRoute } from './repo/RepoRevContainer'
1920
import { LayoutRouteProps } from './routes'
@@ -115,6 +116,11 @@ export const Layout: React.FunctionComponent<LayoutProps> = props => {
115116
)
116117
})}
117118
</Switch>
119+
<ResizablePanel
120+
history={props.history}
121+
location={props.location}
122+
extensionsController={props.extensionsController}
123+
/>
118124
<GlobalDebug {...props} />
119125
</div>
120126
)

web/src/panel/Panel.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
width: 100%;
1717

1818
&--resizable {
19-
min-height: 10rem;
20-
max-height: 80%;
19+
min-height: 6rem;
20+
max-height: calc(100% - 3rem);
21+
width: 100%;
2122
}
2223

2324
&__empty {

web/src/panel/Panel.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export interface PanelItem extends Tab<string> {
3030
}
3131

3232
interface Props extends ExtensionsControllerProps {
33-
isLightTheme: boolean
3433
location: H.Location
3534
history: H.History
3635
}

web/src/repo/routes.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react'
22
import { Redirect, RouteComponentProps } from 'react-router'
33
import { getModeFromPath } from '../../../shared/src/languages'
4-
import { ResizablePanel } from '../panel/Panel'
54
import { formatHash, isLegacyFragment, parseHash } from '../util/url'
65
import { BlobPage } from './blob/BlobPage'
76
import { RepositoryCommitsPage } from './commits/RepositoryCommitsPage'
@@ -110,7 +109,6 @@ export const repoRevContainerRoutes: ReadonlyArray<RepoRevContainerRoute> = [
110109
isLightTheme={context.isLightTheme}
111110
/>
112111
)}
113-
<ResizablePanel {...context} />
114112
</div>
115113
)}
116114
</>

0 commit comments

Comments
 (0)