Skip to content

Commit 200b80d

Browse files
authored
Chart above fold (PostHog#3142)
* Update TrendInsight minHeight to keep chart above the fold * Refactor Insights main content for clarity * Fix PostHog FOSS sync * Remove extraneous div
1 parent 427e4fa commit 200b80d

File tree

2 files changed

+26
-41
lines changed

2 files changed

+26
-41
lines changed

.github/workflows/posthog-foss.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
ref: master
2626
token: ${{ secrets.SYNC_GITHUB_TOKEN }} # SYNC_GITHUB_TOKEN is a PAT token with the workflows scope which is not in GITHUB_TOKEN
2727
- name: Commit "Sync and remove all non-FOSS parts"
28-
uses: EndBug/add-and-commit@v4
28+
uses: EndBug/add-and-commit@v7
2929
with:
3030
author_name: PostHog Bot
3131
author_email: [email protected]
3232
message: 'Sync and remove all non-FOSS parts'
33-
remove: ['-r ee/', '-r .github/']
33+
remove: '["-r ee/", "-r .github/"]'
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.SYNC_GITHUB_TOKEN }}

frontend/src/scenes/insights/Insights.js

+24-39
Original file line numberDiff line numberDiff line change
@@ -263,44 +263,29 @@ function _Insights() {
263263
}
264264
headStyle={{ backgroundColor: 'rgba(0,0,0,.03)' }}
265265
>
266-
<div>
267-
{showErrorMessage ? (
268-
<ErrorMessage />
269-
) : (
270-
showTimeoutMessage && <TimeOut isLoading={isLoading} />
271-
)}
272-
<div
273-
style={{
274-
display: showErrorMessage || showTimeoutMessage ? 'none' : 'block',
275-
}}
276-
>
277-
{featureFlags['remove-shownas']
278-
? {
279-
[`${ViewType.TRENDS}`]: <TrendInsight view={ViewType.TRENDS} />,
280-
[`${ViewType.STICKINESS}`]: (
281-
<TrendInsight view={ViewType.STICKINESS} />
282-
),
283-
[`${ViewType.LIFECYCLE}`]: (
284-
<TrendInsight view={ViewType.LIFECYCLE} />
285-
),
286-
[`${ViewType.SESSIONS}`]: (
287-
<TrendInsight view={ViewType.SESSIONS} />
288-
),
289-
[`${ViewType.FUNNELS}`]: <FunnelInsight />,
290-
[`${ViewType.RETENTION}`]: <RetentionContainer />,
291-
[`${ViewType.PATHS}`]: <Paths />,
292-
}[activeView]
293-
: {
294-
[`${ViewType.TRENDS}`]: <TrendInsight view={ViewType.TRENDS} />,
295-
[`${ViewType.SESSIONS}`]: (
296-
<TrendInsight view={ViewType.SESSIONS} />
297-
),
298-
[`${ViewType.FUNNELS}`]: <FunnelInsight />,
299-
[`${ViewType.RETENTION}`]: <RetentionContainer />,
300-
[`${ViewType.PATHS}`]: <Paths />,
301-
}[activeView]}
302-
</div>
303-
</div>
266+
{showErrorMessage ? (
267+
<ErrorMessage />
268+
) : showTimeoutMessage ? (
269+
<TimeOut isLoading={isLoading} />
270+
) : featureFlags['remove-shownas'] ? (
271+
{
272+
[`${ViewType.TRENDS}`]: <TrendInsight view={ViewType.TRENDS} />,
273+
[`${ViewType.STICKINESS}`]: <TrendInsight view={ViewType.STICKINESS} />,
274+
[`${ViewType.LIFECYCLE}`]: <TrendInsight view={ViewType.LIFECYCLE} />,
275+
[`${ViewType.SESSIONS}`]: <TrendInsight view={ViewType.SESSIONS} />,
276+
[`${ViewType.FUNNELS}`]: <FunnelInsight />,
277+
[`${ViewType.RETENTION}`]: <RetentionContainer />,
278+
[`${ViewType.PATHS}`]: <Paths />,
279+
}[activeView]
280+
) : (
281+
{
282+
[`${ViewType.TRENDS}`]: <TrendInsight view={ViewType.TRENDS} />,
283+
[`${ViewType.SESSIONS}`]: <TrendInsight view={ViewType.SESSIONS} />,
284+
[`${ViewType.FUNNELS}`]: <FunnelInsight />,
285+
[`${ViewType.RETENTION}`]: <RetentionContainer />,
286+
[`${ViewType.PATHS}`]: <Paths />,
287+
}[activeView]
288+
)}
304289
</Card>
305290
{!showErrorMessage && !showTimeoutMessage && activeView === ViewType.FUNNELS && (
306291
<Card>
@@ -324,7 +309,7 @@ function TrendInsight({ view }) {
324309
{(_filters.actions || _filters.events || _filters.session) && (
325310
<div
326311
style={{
327-
minHeight: '70vh',
312+
minHeight: 'calc(90vh - 16rem)',
328313
position: 'relative',
329314
}}
330315
>

0 commit comments

Comments
 (0)